Revision: 200949
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 08:52:52 +0200
changeset 0 8c5d936e5675
child 1 b5888e2aa472
Revision: 200949 Kit: 200951
group/bld.inf
gsprofilesrv_plat/filelist_api/filelist_api.metaxml
gsprofilesrv_plat/filelist_api/group/bld.inf
gsprofilesrv_plat/filelist_api/inc/CFLDController.h
gsprofilesrv_plat/filelist_api/inc/CFLDFileListContainer.h
gsprofilesrv_plat/filelist_api/inc/FileListModel.hrh
gsprofilesrv_plat/filelist_api/inc/FileListModel.rh
gsprofilesrv_plat/filelist_api/inc/MFLDFileListBoxObserver.h
gsprofilesrv_plat/group/bld.inf
gsprofilesrv_plat/profiles_engine_api/group/bld.inf
gsprofilesrv_plat/profiles_engine_api/inc/CProfileChangeNotifyHandler.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfile.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfile3DToneSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileChangeObserver.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileEngine.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileEngineExtended.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtended.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtraSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtraTones.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileFeedbackSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileName.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfilePresence.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfilePttSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSet3DToneSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetExtraSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetExtraTones.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetFeedbackSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetName.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetPresence.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetPttSettings.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetTones.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileTones.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfileUtilitySingleton.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfilesLocalFeatures.h
gsprofilesrv_plat/profiles_engine_api/inc/MProfilesNamesArray.h
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEng.hrh
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEng.rh
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineConstants.h
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineDomainCRKeys.h
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineDomainConstants.h
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineInternalCRKeys.h
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineInternalPSKeys.h
gsprofilesrv_plat/profiles_engine_api/inc/ProfileEnginePrivatePSKeys.h
gsprofilesrv_plat/profiles_engine_api/inc/ProfileInternal.hrh
gsprofilesrv_plat/profiles_engine_api/inc/ProfilesVariant.hrh
gsprofilesrv_plat/profiles_engine_api/inc/SecondaryDisplayProfilesAPI.h
gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h
gsprofilesrv_plat/profiles_engine_api/profiles_engine_api.metaxml
gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf
gsprofilesrv_plat/profiles_mediafilelist_api/group/bld.inf
gsprofilesrv_plat/profiles_mediafilelist_api/inc/mediafilelist.h
gsprofilesrv_plat/profiles_mediafilelist_api/profiles_mediafilelist_api.metaxml
gsprofilesrv_plat/settings_backgroundimage_api/group/bld.inf
gsprofilesrv_plat/settings_backgroundimage_api/inc/BackgroundImage.h
gsprofilesrv_plat/settings_backgroundimage_api/inc/GsAsyncImageHandling.h
gsprofilesrv_plat/settings_backgroundimage_api/inc/MGsAsyncImageHandlingObserver.h
gsprofilesrv_plat/settings_backgroundimage_api/settings_backgroundimage_api.metaxml
gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/bld.inf
gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/settings_backgroundimage_api.mk
gsprofilesrv_plat/settings_framework_api/group/bld.inf
gsprofilesrv_plat/settings_framework_api/inc/GSBaseContainer.h
gsprofilesrv_plat/settings_framework_api/inc/GSBaseView.h
gsprofilesrv_plat/settings_framework_api/inc/GSChildViewManager.h
gsprofilesrv_plat/settings_framework_api/inc/GSCommon.hrh
gsprofilesrv_plat/settings_framework_api/inc/GSCommon.rh
gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h
gsprofilesrv_plat/settings_framework_api/inc/GSParentContainer.h
gsprofilesrv_plat/settings_framework_api/inc/GSParentPlugin.h
gsprofilesrv_plat/settings_framework_api/inc/GSPluginLoader.h
gsprofilesrv_plat/settings_framework_api/inc/GSPrivatePluginProviderIds.h
gsprofilesrv_plat/settings_framework_api/inc/GSPubSubsListener.h
gsprofilesrv_plat/settings_framework_api/inc/GSSettingId.h
gsprofilesrv_plat/settings_framework_api/inc/GSTabHelper.h
gsprofilesrv_plat/settings_framework_api/inc/GSTabbedView.h
gsprofilesrv_plat/settings_framework_api/inc/GSTabbedViewOwner.h
gsprofilesrv_plat/settings_framework_api/inc/GeneralSettingsVariant.hrh
gsprofilesrv_plat/settings_framework_api/inc/MGSSettingPSObserver.h
gsprofilesrv_plat/settings_framework_api/inc/MGSWatchDog.h
gsprofilesrv_plat/settings_framework_api/loc/gs.loc
gsprofilesrv_plat/settings_framework_api/settings_framework_api.metaxml
gsprofilesrv_plat/settings_framework_api/tsrc/group/bld.inf
gsprofilesrv_plat/settings_framework_api/tsrc/group/settings_framework_api.mk
gsprofilesrv_plat/settings_launch_api/group/bld.inf
gsprofilesrv_plat/settings_launch_api/inc/GSLauncher.h
gsprofilesrv_plat/settings_launch_api/settings_launch_api.metaxml
gsprofilesrv_plat/settings_launch_api/tsrc/group/bld.inf
gsprofilesrv_plat/settings_launch_api/tsrc/group/settings_launch_api.mk
gsprofilesrv_plat/settings_listbox_api/group/bld.inf
gsprofilesrv_plat/settings_listbox_api/inc/GSListBox.h
gsprofilesrv_plat/settings_listbox_api/settings_listbox_api.metaxml
gsprofilesrv_plat/settings_listbox_api/tsrc/group/bld.inf
gsprofilesrv_plat/settings_listbox_api/tsrc/group/settings_listbox_api.mk
gsprofilesrv_plat/settings_plugin_api/group/bld.inf
gsprofilesrv_plat/settings_plugin_api/inc/GSFWViewUIDs.h
gsprofilesrv_plat/settings_plugin_api/inc/GSPluginInterface.h
gsprofilesrv_plat/settings_plugin_api/settings_plugin_api.metaxml
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/bwins/SettingsPluginApiTestu.def
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/tcSettingsPluginApiTest.cfg
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/ui_SettingsPluginApiTest.cfg
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/eabi/SettingsPluginApiTestu.def
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.iby
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.mmp
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.pkg
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/bld.inf
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/SettingsPluginApiTest.h
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/TestGSPlugin.h
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/SettingsPluginApiTest.bat
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/testframework_SettingsPluginApiTest.ini
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTest.cpp
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTestblocks.cpp
gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/TestGSPlugin.cpp
gsprofilesrv_plat/settings_uis_cenrep_collection_api/group/bld.inf
gsprofilesrv_plat/settings_uis_cenrep_collection_api/inc/SettingsInternalCRKeys.h
gsprofilesrv_plat/settings_uis_cenrep_collection_api/settings_uis_cenrep_collection_api.metaxml
gsprofilesrv_pub/group/bld.inf
gsprofilesrv_pub/profiles_engine_active_profile_settings_api/group/bld.inf
gsprofilesrv_pub/profiles_engine_active_profile_settings_api/inc/ProfileEngineSDKCRKeys.h
gsprofilesrv_pub/profiles_engine_active_profile_settings_api/profiles_engine_active_profile_settings_api.metaxml
gsprofilesrv_pub/profiles_engine_wrapper_api/group/bld.inf
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngActiveProfileObserver.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngAlertToneSeeker.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngAlertToneSeekerObserver.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngEngine.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngNotifyHandler.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfile.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileActivationObserver.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileName.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileNameArray.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileNameArrayObserver.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileObserver.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngToneSettings.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngTones.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/ProEngFactory.h
gsprofilesrv_pub/profiles_engine_wrapper_api/inc/Profile.hrh
gsprofilesrv_pub/profiles_engine_wrapper_api/profiles_engine_wrapper_api.metaxml
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/Bmarm/ProEngWrapAPIU.DEF
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/Bwins/ProEngWrapAPIU.DEF
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/EABI/ProEngWrapAPIU.def
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.cfg
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.mmp
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI_DoxyFile.txt
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/TestFramework.ini
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/bld.inf
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/proeng_c.bat
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/proeng_z.bat
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/inc/CSchedulerUtility.h
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/inc/ProEngWrapAPI.h
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.SIS
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.pkg
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/CSchedulerUtility.cpp
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPI.cpp
gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPIBlocks.cpp
gssettingsuis/Gs/BWINS/BackgroundImageU.DEF
gssettingsuis/Gs/BWINS/GSEcomPluginU.DEF
gssettingsuis/Gs/BWINS/GSFrameworkU.DEF
gssettingsuis/Gs/BWINS/GSListBoxU.DEF
gssettingsuis/Gs/BWINS/GSServerEngineU.DEF
gssettingsuis/Gs/Cenrep/SettingsPrivateCRKeys.h
gssettingsuis/Gs/Cenrep/keys_s60settingsuis.xls
gssettingsuis/Gs/Data/GSCommonResources.rss
gssettingsuis/Gs/Data/SoftReject.rss
gssettingsuis/Gs/Data/backup_registration.xml
gssettingsuis/Gs/EABI/BackgroundImageU.DEF
gssettingsuis/Gs/EABI/GSEcomPluginU.DEF
gssettingsuis/Gs/EABI/GSFrameworkU.DEF
gssettingsuis/Gs/EABI/GSListBoxU.DEF
gssettingsuis/Gs/EABI/GSServerEngineU.DEF
gssettingsuis/Gs/GSAdminPlugin/GSAdminPlugin.mmp
gssettingsuis/Gs/GSAdminPlugin/bld.inf
gssettingsuis/Gs/GSAdminPlugin/clean.cmd
gssettingsuis/Gs/GSAdminPlugin/data/10283340.rss
gssettingsuis/Gs/GSAdminPlugin/data/GSAdminPluginRsc.rss
gssettingsuis/Gs/GSAdminPlugin/inc/GSAdminPlugin.h
gssettingsuis/Gs/GSAdminPlugin/loc/GSAdminPlugin.loc
gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPlugin.cpp
gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPluginImplementationTable.cpp
gssettingsuis/Gs/GSApplication/Data/GSApp.rss
gssettingsuis/Gs/GSApplication/Data/GSApp_reg.rss
gssettingsuis/Gs/GSApplication/GSApplication.mmp
gssettingsuis/Gs/GSApplication/Inc/GSApp.h
gssettingsuis/Gs/GSApplication/Inc/GSDocument.h
gssettingsuis/Gs/GSApplication/Inc/GSEngineInterface.h
gssettingsuis/Gs/GSApplication/Inc/GSMainContainer.h
gssettingsuis/Gs/GSApplication/Inc/GSUi.h
gssettingsuis/Gs/GSApplication/Src/GSApp.cpp
gssettingsuis/Gs/GSApplication/Src/GSDocument.cpp
gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp
gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp
gssettingsuis/Gs/GSApplication/Src/GSUi.cpp
gssettingsuis/Gs/GSApplication/bld.inf
gssettingsuis/Gs/GSApplication/clean.cmd
gssettingsuis/Gs/GSApplication/loc/GSApp.loc
gssettingsuis/Gs/GSAppsPlugin/GSAppsPlugin.mmp
gssettingsuis/Gs/GSAppsPlugin/bld.inf
gssettingsuis/Gs/GSAppsPlugin/clean.cmd
gssettingsuis/Gs/GSAppsPlugin/data/1020723A.rss
gssettingsuis/Gs/GSAppsPlugin/data/GSAppsPluginRsc.rss
gssettingsuis/Gs/GSAppsPlugin/inc/GSAppsPlugin.h
gssettingsuis/Gs/GSAppsPlugin/loc/GSAppsPlugin.loc
gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPlugin.cpp
gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPluginImplementationTable.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/200110f0.rss
gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/GSAutoKeyguardPluginRsc.rss
gssettingsuis/Gs/GSAutoKeyguardPlugin/GSAutoKeyguardPlugin.mmp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.h
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.hrh
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardSettingPage.h
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardTimeQuery.h
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginContainer.h
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginModel.h
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSPubSubsListener.h
gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/MGSSettingPSObserver.h
gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPlugin.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginContainer.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginImplementationTable.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginModel.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSPubSubsListener.cpp
gssettingsuis/Gs/GSAutoKeyguardPlugin/bld.inf
gssettingsuis/Gs/GSAutoKeyguardPlugin/loc/gsautokeyguardplugin.loc
gssettingsuis/Gs/GSBackgroundImage/GSBackgroundImage.mmp
gssettingsuis/Gs/GSBackgroundImage/Src/BackgroundImage.cpp
gssettingsuis/Gs/GSBackgroundImage/Src/GsAsyncImageHandling.cpp
gssettingsuis/Gs/GSBackgroundImage/bld.inf
gssettingsuis/Gs/GSBackgroundImage/clean.cmd
gssettingsuis/Gs/GSCallBarringPlugin/Data/102824A5.rss
gssettingsuis/Gs/GSCallBarringPlugin/Data/GSCallBarringPluginRsc.rss
gssettingsuis/Gs/GSCallBarringPlugin/GSCallBarringPlugin.mmp
gssettingsuis/Gs/GSCallBarringPlugin/Inc/CallBarringPlugin.hrh
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPlugin.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPluginContainer.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringContainer.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringView.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringContainer.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringView.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSLocalBaseView.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringContainer.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringView.h
gssettingsuis/Gs/GSCallBarringPlugin/Inc/LocalViewIds.h
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPlugin.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginContainer.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginImplementationTable.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringContainer.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringView.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringContainer.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringView.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSLocalBaseView.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringContainer.cpp
gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringView.cpp
gssettingsuis/Gs/GSCallBarringPlugin/bld.inf
gssettingsuis/Gs/GSCallBarringPlugin/clean.cmd
gssettingsuis/Gs/GSCallBarringPlugin/loc/CallBarringPlugin.loc
gssettingsuis/Gs/GSCallDivertPlugin/Data/102824A3.rss
gssettingsuis/Gs/GSCallDivertPlugin/Data/GSCallDivertPluginRsc.rss
gssettingsuis/Gs/GSCallDivertPlugin/GSCallDivertPlugin.mmp
gssettingsuis/Gs/GSCallDivertPlugin/Inc/CallDivertPlugin.hrh
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertContainer.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertModel.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPlugin.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPluginContainer.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertQuery.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertView.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSLocalBaseView.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSRestrictedDivertContainer.h
gssettingsuis/Gs/GSCallDivertPlugin/Inc/LocalViewId.h
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertContainer.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertModel.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPlugin.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginImplementationTable.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertQuery.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertView.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSLocalBaseView.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSRestrictedDivertContainer.cpp
gssettingsuis/Gs/GSCallDivertPlugin/bld.inf
gssettingsuis/Gs/GSCallDivertPlugin/clean.cmd
gssettingsuis/Gs/GSCallDivertPlugin/loc/cf.loc
gssettingsuis/Gs/GSCallPlugin/GSCallPlugin.mmp
gssettingsuis/Gs/GSCallPlugin/bld.inf
gssettingsuis/Gs/GSCallPlugin/clean.cmd
gssettingsuis/Gs/GSCallPlugin/data/102824A1.rss
gssettingsuis/Gs/GSCallPlugin/data/GSCallPluginRsc.rss
gssettingsuis/Gs/GSCallPlugin/data/SoftReject.rss
gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.h
gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.hrh
gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginContainer.h
gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginModel.h
gssettingsuis/Gs/GSCallPlugin/inc/MGsFWMSKLabelObserver.h
gssettingsuis/Gs/GSCallPlugin/loc/GSCallPlugin.loc
gssettingsuis/Gs/GSCallPlugin/loc/SoftReject.loc
gssettingsuis/Gs/GSCallPlugin/src/GSCallPlugin.cpp
gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginContainer.cpp
gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginImplementationTable.cpp
gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginModel.cpp
gssettingsuis/Gs/GSConPlugin/GSConPlugin.mmp
gssettingsuis/Gs/GSConPlugin/bld.inf
gssettingsuis/Gs/GSConPlugin/clean.cmd
gssettingsuis/Gs/GSConPlugin/data/10207251.rss
gssettingsuis/Gs/GSConPlugin/data/GSConPluginRsc.rss
gssettingsuis/Gs/GSConPlugin/inc/GSConPlugin.h
gssettingsuis/Gs/GSConPlugin/loc/GSConPlugin.loc
gssettingsuis/Gs/GSConPlugin/src/GSConPlugin.cpp
gssettingsuis/Gs/GSConPlugin/src/GSConPluginImplementationTable.cpp
gssettingsuis/Gs/GSDataCallPlugin/Data/10207437.rss
gssettingsuis/Gs/GSDataCallPlugin/Data/GsDataCallPluginRsc.rss
gssettingsuis/Gs/GSDataCallPlugin/GSDataCallPlugin.mmp
gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPlugin.h
gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginContainer.h
gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginModel.h
gssettingsuis/Gs/GSDataCallPlugin/Inc/GsDataCallPlugin.hrh
gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPlugin.cpp
gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginContainer.cpp
gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginImplementationTable.cpp
gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginModel.cpp
gssettingsuis/Gs/GSDataCallPlugin/bld.inf
gssettingsuis/Gs/GSDataCallPlugin/clean.cmd
gssettingsuis/Gs/GSDataCallPlugin/loc/GSDataCallPlugin.loc
gssettingsuis/Gs/GSDeviceManagementPlugin/GSDeviceManagementPlugin.mmp
gssettingsuis/Gs/GSDeviceManagementPlugin/bld.inf
gssettingsuis/Gs/GSDeviceManagementPlugin/clean.cmd
gssettingsuis/Gs/GSDeviceManagementPlugin/data/10283316.rss
gssettingsuis/Gs/GSDeviceManagementPlugin/data/GSDeviceManagementPluginRsc.rss
gssettingsuis/Gs/GSDeviceManagementPlugin/inc/GSDeviceManagementPlugin.h
gssettingsuis/Gs/GSDeviceManagementPlugin/loc/GSDeviceManagementPlugin.loc
gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPlugin.cpp
gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPluginImplementationTable.cpp
gssettingsuis/Gs/GSDiagnosticsPlugin/GSDiagnosticsPlugin.mmp
gssettingsuis/Gs/GSDiagnosticsPlugin/bld.inf
gssettingsuis/Gs/GSDiagnosticsPlugin/clean.cmd
gssettingsuis/Gs/GSDiagnosticsPlugin/data/102750D3.rss
gssettingsuis/Gs/GSDiagnosticsPlugin/data/GSDiagnosticsPluginRsc.rss
gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.h
gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.loc
gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPlugin.cpp
gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPluginImplementationTable.cpp
gssettingsuis/Gs/GSDisplayPlugin/Data/10207440.rss
gssettingsuis/Gs/GSDisplayPlugin/Data/2000B591.xml
gssettingsuis/Gs/GSDisplayPlugin/Data/GsDisplayPluginRsc.rss
gssettingsuis/Gs/GSDisplayPlugin/GSDisplayPlugin.mmp
gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPlugin.h
gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginAO.h
gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginContainer.h
gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginModel.h
gssettingsuis/Gs/GSDisplayPlugin/Inc/GsDisplayPlugin.hrh
gssettingsuis/Gs/GSDisplayPlugin/Inc/PSMDisplayPlugin.h
gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp
gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginAO.cpp
gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginContainer.cpp
gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginImplementationTable.cpp
gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginModel.cpp
gssettingsuis/Gs/GSDisplayPlugin/Src/PSMDisplayPlugin.cpp
gssettingsuis/Gs/GSDisplayPlugin/bld.inf
gssettingsuis/Gs/GSDisplayPlugin/clean.cmd
gssettingsuis/Gs/GSDisplayPlugin/loc/GsDisplPlugin.loc
gssettingsuis/Gs/GSFramework/GSEcomPlugin.mmp
gssettingsuis/Gs/GSFramework/GSFramework.mmp
gssettingsuis/Gs/GSFramework/bld.inf
gssettingsuis/Gs/GSFramework/clean.cmd
gssettingsuis/Gs/GSFramework/data/GSFrameworkRsc.rss
gssettingsuis/Gs/GSFramework/data/GSParentPluginRsc.rss
gssettingsuis/Gs/GSFramework/inc/GSBaseDocument.h
gssettingsuis/Gs/GSFramework/inc/GSEComNotifier.h
gssettingsuis/Gs/GSFramework/inc/GSPlaceholderView.h
gssettingsuis/Gs/GSFramework/inc/GSPluginAndViewIdCache.h
gssettingsuis/Gs/GSFramework/inc/GSPluginWrapper.h
gssettingsuis/Gs/GSFramework/inc/GSShimmedView.h
gssettingsuis/Gs/GSFramework/inc/GSWatchDog.h
gssettingsuis/Gs/GSFramework/inc/conset.hlp.hrh
gssettingsuis/Gs/GSFramework/inc/div.hlp.hrh
gssettingsuis/Gs/GSFramework/inc/set.hlp.hrh
gssettingsuis/Gs/GSFramework/src/GSBaseContainer.cpp
gssettingsuis/Gs/GSFramework/src/GSBaseDocument.cpp
gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp
gssettingsuis/Gs/GSFramework/src/GSEComNotifier.cpp
gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp
gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp
gssettingsuis/Gs/GSFramework/src/GSPlaceholderView.cpp
gssettingsuis/Gs/GSFramework/src/GSPluginAndViewIdCache.cpp
gssettingsuis/Gs/GSFramework/src/GSPluginInterface.cpp
gssettingsuis/Gs/GSFramework/src/GSPluginLoader.cpp
gssettingsuis/Gs/GSFramework/src/GSPluginWrapper.cpp
gssettingsuis/Gs/GSFramework/src/GSPubSubsListener.cpp
gssettingsuis/Gs/GSFramework/src/GSShimmedView.cpp
gssettingsuis/Gs/GSFramework/src/GSTabHelper.cpp
gssettingsuis/Gs/GSFramework/src/GSWatchDog.cpp
gssettingsuis/Gs/GSGenPlugin/GSGenPlugin.mmp
gssettingsuis/Gs/GSGenPlugin/bld.inf
gssettingsuis/Gs/GSGenPlugin/clean.cmd
gssettingsuis/Gs/GSGenPlugin/data/10207238.rss
gssettingsuis/Gs/GSGenPlugin/data/GSGenPluginRsc.rss
gssettingsuis/Gs/GSGenPlugin/inc/GSGenPlugin.h
gssettingsuis/Gs/GSGenPlugin/loc/GSGenPlugin.loc
gssettingsuis/Gs/GSGenPlugin/src/GSGenPlugin.cpp
gssettingsuis/Gs/GSGenPlugin/src/GSGenPluginImplementationTable.cpp
gssettingsuis/Gs/GSIndicatorPlugin/data/200100DD.rss
gssettingsuis/Gs/GSIndicatorPlugin/group/GSindicatorplugin.mmp
gssettingsuis/Gs/GSIndicatorPlugin/group/bld.inf
gssettingsuis/Gs/GSIndicatorPlugin/inc/GSindicatorpluginimplementation.h
gssettingsuis/Gs/GSIndicatorPlugin/rom/gsindicatorplugin.iby
gssettingsuis/Gs/GSIndicatorPlugin/src/GSindicatorpluginimplementation.cpp
gssettingsuis/Gs/GSIndicatorPlugin/src/dllmain.cpp
gssettingsuis/Gs/GSInstallationsPlugin/GSInstallationsPlugin.mmp
gssettingsuis/Gs/GSInstallationsPlugin/bld.inf
gssettingsuis/Gs/GSInstallationsPlugin/clean.cmd
gssettingsuis/Gs/GSInstallationsPlugin/data/10283320.rss
gssettingsuis/Gs/GSInstallationsPlugin/data/GSInstallationsPluginRsc.rss
gssettingsuis/Gs/GSInstallationsPlugin/inc/GSInstallationsPlugin.h
gssettingsuis/Gs/GSInstallationsPlugin/loc/GSInstallationsPlugin.loc
gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPlugin.cpp
gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPluginImplementationTable.cpp
gssettingsuis/Gs/GSListBox/GSListBox.mmp
gssettingsuis/Gs/GSListBox/Src/GSListBox.cpp
gssettingsuis/Gs/GSListBox/bld.inf
gssettingsuis/Gs/GSNetworkPlugin/Data/102824A7.rss
gssettingsuis/Gs/GSNetworkPlugin/Data/2000B593.xml
gssettingsuis/Gs/GSNetworkPlugin/Data/GsNetworkPluginRsc.rss
gssettingsuis/Gs/GSNetworkPlugin/GSNetworkPlugin.mmp
gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkDebugHelper.h
gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPlugin.h
gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginAO.h
gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginContainer.h
gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginModel.h
gssettingsuis/Gs/GSNetworkPlugin/Inc/GsNetworkPlugin.hrh
gssettingsuis/Gs/GSNetworkPlugin/Inc/MGsFWMSKLabelObserver.h
gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h
gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkDebugHelper.cpp
gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp
gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginAO.cpp
gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginContainer.cpp
gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginImplementationTable.cpp
gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginModel.cpp
gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp
gssettingsuis/Gs/GSNetworkPlugin/bld.inf
gssettingsuis/Gs/GSNetworkPlugin/clean.cmd
gssettingsuis/Gs/GSNetworkPlugin/loc/GsNetworkPlugin.loc
gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/1028331A.rss
gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/GSOpticalJoystickPluginRsc.rss
gssettingsuis/Gs/GSOpticalJoystickPlugin/GSOpticalJoystickPlugin.mmp
gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.h
gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.hrh
gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPluginContainer.h
gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPlugin.cpp
gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginContainer.cpp
gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginImplementationTable.cpp
gssettingsuis/Gs/GSOpticalJoystickPlugin/bld.inf
gssettingsuis/Gs/GSOpticalJoystickPlugin/clean.cmd
gssettingsuis/Gs/GSOpticalJoystickPlugin/loc/GSOpticalJoystickPlugin.loc
gssettingsuis/Gs/GSPDataAccessPointPlugin/GSPDataAccessPointPlugin.mmp
gssettingsuis/Gs/GSPDataAccessPointPlugin/bld.inf
gssettingsuis/Gs/GSPDataAccessPointPlugin/clean.cmd
gssettingsuis/Gs/GSPDataAccessPointPlugin/data/10282DC5.rss
gssettingsuis/Gs/GSPDataAccessPointPlugin/data/GSPDataAccessPointPluginRsc.rss
gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointModel.h
gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointPlugin.h
gssettingsuis/Gs/GSPDataAccessPointPlugin/loc/GSPDataAccessPointPlugin.loc
gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointModel.cpp
gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPlugin.cpp
gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPluginImplementationTable.cpp
gssettingsuis/Gs/GSPDataConnectionPlugin/GSPDataConnectionPlugin.mmp
gssettingsuis/Gs/GSPDataConnectionPlugin/bld.inf
gssettingsuis/Gs/GSPDataConnectionPlugin/clean.cmd
gssettingsuis/Gs/GSPDataConnectionPlugin/data/10282DC3.rss
gssettingsuis/Gs/GSPDataConnectionPlugin/data/GSPDataConnectionPluginRsc.rss
gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionModel.h
gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionPlugin.h
gssettingsuis/Gs/GSPDataConnectionPlugin/loc/GSPDataConnectionPlugin.loc
gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionModel.cpp
gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPlugin.cpp
gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPluginImplementationTable.cpp
gssettingsuis/Gs/GSPDataHSDPAPlugin/GSPDataHSDPAPlugin.mmp
gssettingsuis/Gs/GSPDataHSDPAPlugin/bld.inf
gssettingsuis/Gs/GSPDataHSDPAPlugin/clean.cmd
gssettingsuis/Gs/GSPDataHSDPAPlugin/data/10282DC7.rss
gssettingsuis/Gs/GSPDataHSDPAPlugin/data/GSPDataHSDPAPluginRsc.rss
gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAModel.h
gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAPlugin.h
gssettingsuis/Gs/GSPDataHSDPAPlugin/loc/GSPDataHSDPAPlugin.loc
gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAModel.cpp
gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp
gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPluginImplementationTable.cpp
gssettingsuis/Gs/GSPDataPlugin/Data/1020724F.rss
gssettingsuis/Gs/GSPDataPlugin/Data/GSPDataPluginRsc.rss
gssettingsuis/Gs/GSPDataPlugin/GSPDataPlugin.mmp
gssettingsuis/Gs/GSPDataPlugin/Inc/GSPDataPlugin.h
gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPlugin.cpp
gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPluginImplementationTable.cpp
gssettingsuis/Gs/GSPDataPlugin/bld.inf
gssettingsuis/Gs/GSPDataPlugin/clean.cmd
gssettingsuis/Gs/GSPDataPlugin/loc/GSPDataPlugin.loc
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/2002120C.rss
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/GSPowerSavingQueryPluginRsc.rss
gssettingsuis/Gs/GSPowerSavingQueryPlugin/GSPowerSavingQueryPlugin.mmp
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.h
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.hrh
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginContainer.h
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginModel.h
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPlugin.cpp
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginContainer.cpp
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginImplementationTable.cpp
gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginModel.cpp
gssettingsuis/Gs/GSPowerSavingQueryPlugin/bld.inf
gssettingsuis/Gs/GSPowerSavingQueryPlugin/loc/GSPowerSavingQueryPlugin.loc
gssettingsuis/Gs/GSPrslnPlugin/GSPrslnPlugin.mmp
gssettingsuis/Gs/GSPrslnPlugin/bld.inf
gssettingsuis/Gs/GSPrslnPlugin/clean.cmd
gssettingsuis/Gs/GSPrslnPlugin/data/10207253.rss
gssettingsuis/Gs/GSPrslnPlugin/data/GSPrslnPluginRsc.rss
gssettingsuis/Gs/GSPrslnPlugin/inc/GSPrslnPlugin.h
gssettingsuis/Gs/GSPrslnPlugin/loc/GSPrslnPlugin.loc
gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPlugin.cpp
gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPluginImplementationTable.cpp
gssettingsuis/Gs/GSSecurityPlugin/Data/1020743A.rss
gssettingsuis/Gs/GSSecurityPlugin/Data/GSSecurityPluginRsc.rss
gssettingsuis/Gs/GSSecurityPlugin/GSSecurityPlugin.mmp
gssettingsuis/Gs/GSSecurityPlugin/Inc/GSSecurityPlugin.h
gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPlugin.cpp
gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPluginImplementationTable.cpp
gssettingsuis/Gs/GSSecurityPlugin/bld.inf
gssettingsuis/Gs/GSSecurityPlugin/clean.cmd
gssettingsuis/Gs/GSSecurityPlugin/loc/GSSecurityPlugin.loc
gssettingsuis/Gs/GSSynchronisationPlugin/GSSynchronisationPlugin.mmp
gssettingsuis/Gs/GSSynchronisationPlugin/bld.inf
gssettingsuis/Gs/GSSynchronisationPlugin/clean.cmd
gssettingsuis/Gs/GSSynchronisationPlugin/data/10283318.rss
gssettingsuis/Gs/GSSynchronisationPlugin/data/GSSynchronisationPluginRsc.rss
gssettingsuis/Gs/GSSynchronisationPlugin/inc/GSSynchronisationPlugin.h
gssettingsuis/Gs/GSSynchronisationPlugin/loc/GSSyncPlugin.loc
gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPlugin.cpp
gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPluginImplementationTable.cpp
gssettingsuis/Gs/GSTelPlugin/Data/1020723E.rss
gssettingsuis/Gs/GSTelPlugin/Data/GSTelPluginRsc.rss
gssettingsuis/Gs/GSTelPlugin/GSTelPlugin.mmp
gssettingsuis/Gs/GSTelPlugin/Inc/GSPhoneSettingConstants.h
gssettingsuis/Gs/GSTelPlugin/Inc/GSTelPlugin.h
gssettingsuis/Gs/GSTelPlugin/Src/GSTelPlugin.cpp
gssettingsuis/Gs/GSTelPlugin/Src/GSTelPluginImplementationTable.cpp
gssettingsuis/Gs/GSTelPlugin/bld.inf
gssettingsuis/Gs/GSTelPlugin/loc/GSTelPlugin.loc
gssettingsuis/Gs/Logger/GsLogger.h
gssettingsuis/Gs/Logger/GsLoggingConfiguration.h
gssettingsuis/Gs/conf/s60settingsuis.confml
gssettingsuis/Gs/conf/s60settingsuis_1000A82B.crml
gssettingsuis/Gs/conf/s60settingsuis_101F8751.crml
gssettingsuis/Gs/conf/s60settingsuis_101F877A.crml
gssettingsuis/Gs/conf/s60settingsuis_101F877B.crml
gssettingsuis/Gs/conf/s60settingsuis_101F877C.crml
gssettingsuis/Gs/conf/s60settingsuis_101F877E.crml
gssettingsuis/Gs/conf/s60settingsuis_101F877F.crml
gssettingsuis/Gs/conf/s60settingsuis_101F8780.crml
gssettingsuis/Gs/conf/s60settingsuis_101F8781.crml
gssettingsuis/Gs/conf/s60settingsuis_101F8782.crml
gssettingsuis/Gs/conf/s60settingsuis_101F8831.crml
gssettingsuis/Gs/conf/s60settingsuis_101F883B.crml
gssettingsuis/Gs/conf/s60settingsuis_1020720A.crml
gssettingsuis/Gs/conf/s60settingsuis_1028239D.crml
gssettingsuis/Gs/conf/s60settingsuis_2002120B.crml
gssettingsuis/Gs/group/bld.inf
gssettingsuis/Gs/gslauncher/bwins/gslauncheru.def
gssettingsuis/Gs/gslauncher/eabi/gslauncheru.def
gssettingsuis/Gs/gslauncher/group/GSLauncher.mmp
gssettingsuis/Gs/gslauncher/group/bld.inf
gssettingsuis/Gs/gslauncher/inc/GSLauncher.h
gssettingsuis/Gs/gslauncher/rom/gslauncher.iby
gssettingsuis/Gs/gslauncher/src/GSLauncher.cpp
gssettingsuis/Gs/help/data/xhtml.zip
gssettingsuis/Gs/help/group/bld.inf
gssettingsuis/Gs/help/inc/cp.hlp.hrh
gssettingsuis/Gs/help/rom/gssettingsuishelps_variant.iby
gssettingsuis/Gs/readme.txt
gssettingsuis/Gs/rom/GSActiveIdlePlugin.iby
gssettingsuis/Gs/rom/GSActiveIdlePluginResources.iby
gssettingsuis/Gs/rom/GSAdminPlugin.iby
gssettingsuis/Gs/rom/GSAdminPluginResources.iby
gssettingsuis/Gs/rom/GSApp.iby
gssettingsuis/Gs/rom/GSAppResources.iby
gssettingsuis/Gs/rom/GSAppsPlugin.iby
gssettingsuis/Gs/rom/GSAppsPluginResources.iby
gssettingsuis/Gs/rom/GSAutoKeyguardPlugin.iby
gssettingsuis/Gs/rom/GSAutoKeyguardPluginResources.iby
gssettingsuis/Gs/rom/GSBackgroundImage.iby
gssettingsuis/Gs/rom/GSCallBarringPlugin.iby
gssettingsuis/Gs/rom/GSCallBarringPluginResources.iby
gssettingsuis/Gs/rom/GSCallDivertPlugin.iby
gssettingsuis/Gs/rom/GSCallDivertPluginResources.iby
gssettingsuis/Gs/rom/GSCallPlugin.iby
gssettingsuis/Gs/rom/GSCallPluginResources.iby
gssettingsuis/Gs/rom/GSConPlugin.iby
gssettingsuis/Gs/rom/GSConPluginResources.iby
gssettingsuis/Gs/rom/GSDataCallPlugin.iby
gssettingsuis/Gs/rom/GSDataCallPluginResources.iby
gssettingsuis/Gs/rom/GSDeviceManagementPlugin.iby
gssettingsuis/Gs/rom/GSDeviceManagementPluginResources.iby
gssettingsuis/Gs/rom/GSDisplayPlugin.iby
gssettingsuis/Gs/rom/GSDisplayPluginResources.iby
gssettingsuis/Gs/rom/GSGenPlugin.iby
gssettingsuis/Gs/rom/GSGenPluginResources.iby
gssettingsuis/Gs/rom/GSInstallationsPlugin.iby
gssettingsuis/Gs/rom/GSInstallationsPluginResources.iby
gssettingsuis/Gs/rom/GSInteractionPlugin.iby
gssettingsuis/Gs/rom/GSInteractionPluginResources.iby
gssettingsuis/Gs/rom/GSListBox.iby
gssettingsuis/Gs/rom/GSNetworkPlugin.iby
gssettingsuis/Gs/rom/GSNetworkPluginResources.iby
gssettingsuis/Gs/rom/GSOpticalJoystickPlugin.iby
gssettingsuis/Gs/rom/GSOpticalJoystickPluginResources.iby
gssettingsuis/Gs/rom/GSPDataAccessPointPlugin.iby
gssettingsuis/Gs/rom/GSPDataAccessPointPluginResources.iby
gssettingsuis/Gs/rom/GSPDataConnectionPlugin.iby
gssettingsuis/Gs/rom/GSPDataConnectionPluginResources.iby
gssettingsuis/Gs/rom/GSPDataHSDPAPlugin.iby
gssettingsuis/Gs/rom/GSPDataHSDPAPluginResources.iby
gssettingsuis/Gs/rom/GSPDataPlugin.iby
gssettingsuis/Gs/rom/GSPDataPluginResources.iby
gssettingsuis/Gs/rom/GSPowerSavingQueryPlugin.iby
gssettingsuis/Gs/rom/GSPowerSavingQueryPluginResources.iby
gssettingsuis/Gs/rom/GSPrslnPlugin.iby
gssettingsuis/Gs/rom/GSPrslnPluginResources.iby
gssettingsuis/Gs/rom/GSSecurityPlugin.iby
gssettingsuis/Gs/rom/GSSecurityPluginResources.iby
gssettingsuis/Gs/rom/GSSynchronisationPlugin.iby
gssettingsuis/Gs/rom/GSSynchronisationPluginResources.iby
gssettingsuis/Gs/rom/GSTelPlugin.iby
gssettingsuis/Gs/rom/GSTelPluginResources.iby
gssettingsuis/Gs/rom/GsResources.iby
gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.cpp
gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.h
gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface_DllMain.cpp
gssettingsuis/Gs/tsrc/private/T_CGSPluginInterface.mmp
gssettingsuis/Gs/tsrc/private/bld.inf
gssettingsuis/Gs/tsrc/private/move_T_GSPluginInterface.bat
gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_CGSLauncherU.DEF
gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_GSFrameworku.def
gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSBackgroundImageU.DEF
gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSListBoxu.def
gssettingsuis/Gs/tsrc/public/basic/EABI/MT_CGSLauncherU.DEF
gssettingsuis/Gs/tsrc/public/basic/EABI/MT_GSFrameworku.def
gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSBackgroundImageU.DEF
gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSListBoxu.def
gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.cpp
gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.h
gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage_DllMain.cpp
gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.cpp
gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.h
gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework_DllMain.cpp
gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.cpp
gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.h
gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.cpp
gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.h
gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.cpp
gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.h
gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox_DllMain.cpp
gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.cpp
gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.h
gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher_DllMain.cpp
gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp
gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp
gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp
gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp
gssettingsuis/Gs/tsrc/public/basic/group/bld.inf
gssettingsuis/Gs/tsrc/public/basic/group/copy_binaries_to_sys_dir.mk
gssettingsuis/Gs/tsrc/public/basic/group/move.cmd
gssettingsuis/Gs/tsrc/public/basic/test.xml
gssettingsuis/group/bld.inf
layers.sysdef.xml
profilesservices/FileList/BWINS/FileListU.DEF
profilesservices/FileList/EABI/FileListU.DEF
profilesservices/FileList/Inc/CFLDFileListModel.h
profilesservices/FileList/Src/CFLDBrowserLauncher.cpp
profilesservices/FileList/Src/CFLDBrowserLauncher.h
profilesservices/FileList/Src/CFLDChangedItemObserver.cpp
profilesservices/FileList/Src/CFLDChangedItemObserver.h
profilesservices/FileList/Src/CFLDCommandAbsorbingControl.cpp
profilesservices/FileList/Src/CFLDCommandAbsorbingControl.h
profilesservices/FileList/Src/CFLDController.cpp
profilesservices/FileList/Src/CFLDDRMImplementation.cpp
profilesservices/FileList/Src/CFLDDRMImplementation.h
profilesservices/FileList/Src/CFLDDRMImplementationCommon.cpp
profilesservices/FileList/Src/CFLDDRMImplementationEmpty.cpp
profilesservices/FileList/Src/CFLDEntryReference.cpp
profilesservices/FileList/Src/CFLDEntryReference.h
profilesservices/FileList/Src/CFLDFileListContainer.cpp
profilesservices/FileList/Src/CFLDFileListModel.cpp
profilesservices/FileList/Src/CFLDOperationObserver.cpp
profilesservices/FileList/Src/CFLDOperationObserver.h
profilesservices/FileList/Src/CFLDPlayerBase.cpp
profilesservices/FileList/Src/CFLDPlayerBase.h
profilesservices/FileList/Src/CFLDPopupList.cpp
profilesservices/FileList/Src/CFLDPopupList.h
profilesservices/FileList/Src/CFLDRingingTonePlayer.cpp
profilesservices/FileList/Src/CFLDRingingTonePlayer.h
profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.cpp
profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.h
profilesservices/FileList/Src/CFLDSoftKeyChanger.cpp
profilesservices/FileList/Src/CFLDSoftKeyChanger.h
profilesservices/FileList/Src/CFLDVideoPlayer.cpp
profilesservices/FileList/Src/CFLDVideoPlayer.h
profilesservices/FileList/Src/CFLDWaitNote.cpp
profilesservices/FileList/Src/CFLDWaitNote.h
profilesservices/FileList/Src/FLDListBoxTemplate.h
profilesservices/FileList/Src/MFLDEntryFormatter.h
profilesservices/FileList/Src/MFLDFileObserver.h
profilesservices/FileList/Src/MFLDFileProcessor.h
profilesservices/FileList/group/FileList.mmp
profilesservices/FileList/group/FileList.rss
profilesservices/FileList/group/bld.inf
profilesservices/FileList/group/filelist_icons_aif_scalable_dc.mk
profilesservices/FileList/loc/FileList.loc
profilesservices/FileList/rom/filelist.iby
profilesservices/FileList/rom/filelistResources.iby
profilesservices/FileList/tsrc/public/basic/bwins/T_CFLDFileListu.def
profilesservices/FileList/tsrc/public/basic/eabi/T_CFLDFileListu.def
profilesservices/FileList/tsrc/public/basic/group/FLDTest.rss
profilesservices/FileList/tsrc/public/basic/group/T_CFLDFileList.mmp
profilesservices/FileList/tsrc/public/basic/group/bld.inf
profilesservices/FileList/tsrc/public/basic/inc/FLDTestConst.h
profilesservices/FileList/tsrc/public/basic/inc/T_CFLDController.h
profilesservices/FileList/tsrc/public/basic/inc/T_CFLDFileListContainer.h
profilesservices/FileList/tsrc/public/basic/rom/FileList_ats3.iby
profilesservices/FileList/tsrc/public/basic/src/T_CFLDController.cpp
profilesservices/FileList/tsrc/public/basic/src/T_CFLDDllMain.cpp
profilesservices/FileList/tsrc/public/basic/src/T_CFLDFileListContainer.cpp
profilesservices/MediaFileList/Inc/mediafiledialog.h
profilesservices/MediaFileList/Inc/mediafiledialogstate.h
profilesservices/MediaFileList/Inc/mediafiledialogutils.h
profilesservices/MediaFileList/Inc/mediafilehandler.h
profilesservices/MediaFileList/Inc/mediafilelist.h
profilesservices/MediaFileList/Inc/mediafilelistdebug.h
profilesservices/MediaFileList/Inc/mediafilepreview.h
profilesservices/MediaFileList/Inc/mediafileprotection.h
profilesservices/MediaFileList/Inc/mediafiletest.h
profilesservices/MediaFileList/Inc/mediafilevariation.h
profilesservices/MediaFileList/Inc/mediafilevideopreviewdialog.h
profilesservices/MediaFileList/Inc/mediafilewaitnote.h
profilesservices/MediaFileList/Src/mediafiledialog.cpp
profilesservices/MediaFileList/Src/mediafiledialogstate.cpp
profilesservices/MediaFileList/Src/mediafiledialogutils.cpp
profilesservices/MediaFileList/Src/mediafilehandler.cpp
profilesservices/MediaFileList/Src/mediafilelist.cpp
profilesservices/MediaFileList/Src/mediafilelist.rss
profilesservices/MediaFileList/Src/mediafilepreview.cpp
profilesservices/MediaFileList/Src/mediafileprotection.cpp
profilesservices/MediaFileList/Src/mediafiletest.cpp
profilesservices/MediaFileList/Src/mediafilevariation.cpp
profilesservices/MediaFileList/Src/mediafilevideopreviewdialog.cpp
profilesservices/MediaFileList/Src/mediafilewaitnote.cpp
profilesservices/MediaFileList/bwins/MediaFileListu.def
profilesservices/MediaFileList/eabi/MediaFileListu.def
profilesservices/MediaFileList/group/MediaFileList.mmp
profilesservices/MediaFileList/group/bld.inf
profilesservices/MediaFileList/group/mediafilelist_icons_aif_scalable_dc.mk
profilesservices/MediaFileList/loc/MediaFileList.loc
profilesservices/MediaFileList/rom/mediafilelist.iby
profilesservices/MediaFileList/rom/mediafilelistResources.iby
profilesservices/ProfileEngine/BMARM/PROFILEENGU.DEF
profilesservices/ProfileEngine/BWINS/PROFILEENGINEU.DEF
profilesservices/ProfileEngine/BWINS/PROFILEENGU.DEF
profilesservices/ProfileEngine/Data/No_Sound.wav
profilesservices/ProfileEngine/EABI/ProfileEngU.DEF
profilesservices/ProfileEngine/EABI/ProfileEngineU.DEF
profilesservices/ProfileEngine/EngInc/MProfileEngineExtended.h
profilesservices/ProfileEngine/EngInc/MProfileExtended.h
profilesservices/ProfileEngine/EngInc/MProfilePresence.h
profilesservices/ProfileEngine/EngInc/MProfileSet3DToneSettings.h
profilesservices/ProfileEngine/EngInc/MProfileSetExtraSettings.h
profilesservices/ProfileEngine/EngInc/MProfileSetExtraTones.h
profilesservices/ProfileEngine/EngInc/MProfileSetFeedbackSettings.h
profilesservices/ProfileEngine/EngInc/MProfileSetName.h
profilesservices/ProfileEngine/EngInc/MProfileSetPresence.h
profilesservices/ProfileEngine/EngInc/MProfileSetPttSettings.h
profilesservices/ProfileEngine/EngInc/MProfileSetTones.h
profilesservices/ProfileEngine/EngInc/MProfileUtilitySingleton.h
profilesservices/ProfileEngine/EngInc/MProfilesLocalFeatures.h
profilesservices/ProfileEngine/EngInc/ProfileEng.hrh
profilesservices/ProfileEngine/EngInc/ProfileEng.rh
profilesservices/ProfileEngine/EngInc/ProfileEngineConstants.h
profilesservices/ProfileEngine/EngInc/ProfileEngineInternalCRKeys.h
profilesservices/ProfileEngine/EngInc/ProfileEngineInternalPSKeys.h
profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h
profilesservices/ProfileEngine/EngInc/ProfileEnginePrivatePSKeys.h
profilesservices/ProfileEngine/EngSrc/CProfile3DToneSettingsImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfile3DToneSettingsImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp
profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp
profilesservices/ProfileEngine/EngSrc/CProfileEngineImplStaticProfiles.cpp
profilesservices/ProfileEngine/EngSrc/CProfileExtraSettingsImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileExtraSettingsImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.h
profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.h
profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp
profilesservices/ProfileEngine/EngSrc/CProfileTiming.h
profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.h
profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.h
profilesservices/ProfileEngine/EngSrc/CProfilesLocalFeatures.cpp
profilesservices/ProfileEngine/EngSrc/CProfilesLocalFeatures.h
profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp
profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.h
profilesservices/ProfileEngine/EngSrc/ProfileEngPanic.cpp
profilesservices/ProfileEngine/EngSrc/ProfileEngPanic.h
profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp
profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.h
profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp
profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h
profilesservices/ProfileEngine/ProfileScheduleEventSrc/Main.cpp
profilesservices/ProfileEngine/ProfileScheduleEventSrc/ProfileScheduleEvent.rss
profilesservices/ProfileEngine/WrapperSrc/CProEngActiveProfileDelegate.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngActiveProfileDelegate.h
profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.h
profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.h
profilesservices/ProfileEngine/WrapperSrc/CProEngDrmCommonWrapper.h
profilesservices/ProfileEngine/WrapperSrc/CProEngDrmCommonWrapperEmpty.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngDrmCommonWrapperFull.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.h
profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.h
profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.h
profilesservices/ProfileEngine/WrapperSrc/CProEngObserverBase.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngObserverBase.h
profilesservices/ProfileEngine/WrapperSrc/CProEngPostFilter.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngPostFilter.h
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.h
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileEventDelegate.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileEventDelegate.h
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.h
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayEventDelegate.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayEventDelegate.h
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayImpl.h
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameImpl.h
profilesservices/ProfileEngine/WrapperSrc/CProEngPubSubObserverBase.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngPubSubObserverBase.h
profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.h
profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandlerDrmEmpty.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandlerDrmFull.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.h
profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.h
profilesservices/ProfileEngine/WrapperSrc/ProEngFactory.cpp
profilesservices/ProfileEngine/WrapperSrc/ProEngMmfInfoUtility.cpp
profilesservices/ProfileEngine/WrapperSrc/ProEngMmfInfoUtility.h
profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss
profilesservices/ProfileEngine/cenrep/keys_profilesengine.xls
profilesservices/ProfileEngine/conf/profilesengine.confml
profilesservices/ProfileEngine/conf/profilesengine_101F8798.crml
profilesservices/ProfileEngine/conf/profilesengine_101F8799.crml
profilesservices/ProfileEngine/group/ProfileEng.mmp
profilesservices/ProfileEngine/group/ProfileEng.rss
profilesservices/ProfileEngine/group/ProfileEngine.lnt
profilesservices/ProfileEngine/group/ProfileEngine.mmp
profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp
profilesservices/ProfileEngine/group/ProfilesDebug.h
profilesservices/ProfileEngine/group/ProfilesEngineExports.Inc
profilesservices/ProfileEngine/group/ProfilesWrapperExports.Inc
profilesservices/ProfileEngine/group/backup_registration.xml
profilesservices/ProfileEngine/group/bld.inf
profilesservices/ProfileEngine/loc/Profile.loc
profilesservices/ProfileEngine/rom/ProfileEngineResources.iby
profilesservices/ProfileEngine/rom/Profileengine.iby
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/bwins/T_ProfileEngineu.def
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/eabi/T_ProfileEngineu.def
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/group/T_ProfileEngine.mmp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/group/bld.inf
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_CProfileChangeNotifyHandler.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfile.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfile3DToneSettings.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileEngine.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileExtraSettings.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileExtraTones.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileFeedbackSettings.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileName.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfilePttSettings.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileTones.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfilesNamesArray.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_ProfileTestTools.h
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/DllMain.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_CProfileChangeNotifyHandler.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfile.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfile3DToneSettings.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileEngine.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileExtraSettings.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileExtraTones.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileFeedbackSettings.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileName.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfilePttSettings.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileTones.cpp
profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfilesNamesArray.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/bwins/T_ProfileEngineWrapperu.def
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/eabi/T_ProfileEngineWrapperu.def
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/group/T_ProfileEngineWrapper.mmp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/group/bld.inf
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_CSchedulerUtility.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngAlertToneSeeker.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngEngine.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngNotifyHandler.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngProfile.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngProfileName.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngProfileNameArray.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngToneSettings.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngTones.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_ProEngFactory.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_ProfileEngine.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/T_ProfileTestTools.h
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_CSchedulerUtility.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngAlertToneSeeker.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngEngine.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngNotifyHandler.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfile.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileName.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileNameArray.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngToneSettings.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngTones.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_ProEngFactory.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_ProfileEngineDllMain.cpp
profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/T_ProfileTestTools.cpp
profilesservices/ProfileEngine/tsrc/public/basic/group/bld.inf
profilesservices/ProfileEngine/tsrc/public/basic/rom/ProfileEngine_ats3.iby
profilesservices/RingingTone3DPlugin/data/cenrep/10208ADF.txt
profilesservices/RingingTone3DPlugin/data/patterns/1circular.xml
profilesservices/RingingTone3DPlugin/data/patterns/2flyby.xml
profilesservices/RingingTone3DPlugin/data/patterns/3zigzag.xml
profilesservices/RingingTone3DPlugin/data/patterns/4meander.xml
profilesservices/RingingTone3DPlugin/data/patterns/5random.xml
profilesservices/RingingTone3DPlugin/data/tone/3d_effect_01.aac
profilesservices/RingingTone3DPlugin/data/tone/3d_effect_02.aac
profilesservices/RingingTone3DPlugin/data/tone/3d_effect_03.aac
profilesservices/RingingTone3DPlugin/data/tone/3d_effect_04.aac
profilesservices/RingingTone3DPlugin/data/tone/3d_effect_05.aac
profilesservices/RingingTone3DPlugin/data/tone/3d_motorway.aac
profilesservices/RingingTone3DPlugin/group/RingingTone3DPluginExports.inc
profilesservices/RingingTone3DPlugin/group/bld.inf
profilesservices/RingingTone3DPlugin/group/ringingtone3dplugin.mmp
profilesservices/RingingTone3DPlugin/inc/C3DAudioPattern.h
profilesservices/RingingTone3DPlugin/inc/C3DAudioTimeOutTimer.h
profilesservices/RingingTone3DPlugin/inc/C3DAudioXMLParser.h
profilesservices/RingingTone3DPlugin/inc/CRingingTone3DPlugin.h
profilesservices/RingingTone3DPlugin/inc/RingingTone3DPluginDebug.h
profilesservices/RingingTone3DPlugin/inc/tdaudioconstants.h
profilesservices/RingingTone3DPlugin/src/10208adf.rss
profilesservices/RingingTone3DPlugin/src/C3DAudioPattern.cpp
profilesservices/RingingTone3DPlugin/src/C3DAudioTimeOutTimer.cpp
profilesservices/RingingTone3DPlugin/src/C3DAudioXMLParser.cpp
profilesservices/RingingTone3DPlugin/src/CRingingTone3DPlugin.cpp
profilesservices/RingingTone3DPlugin/src/CRingingTone3DPluginImplementationTable.cpp
profilesservices/group/bld.inf
profilesservices/tsrc/public/basic/group/bld.inf
profilesservices/tsrc/public/basic/rom/ProfilesServices_ats3.iby
profilesservices/tsrc/public/basic/test.xml
sysdef_1_4_0.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,34 @@
+
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+#include "../gsprofilesrv_plat/group/bld.inf"
+#include "../gsprofilesrv_pub/group/bld.inf"
+#include "../gssettingsuis/group/bld.inf"
+#include "../profilesservices/group/bld.inf"
+
+PRJ_TESTMMPFILES
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/filelist_api/filelist_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="b02e425577721633e78d51b8246239e1" dataversion="2.0">
+  <name>FileList API</name>
+  <description>An UI for the file selection lists.</description>
+  <type>c++</type>
+  <collection>profilesservices</collection>
+  <libs>
+    <lib name="FileList.lib" />
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/filelist_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                FileList API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/FileListModel.hrh     MW_LAYER_PLATFORM_EXPORT_PATH(FileListModel.hrh)
+../inc/CFLDController.h     MW_LAYER_PLATFORM_EXPORT_PATH(CFLDController.h)
+../inc/MFLDFileListBoxObserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(MFLDFileListBoxObserver.h)
+../inc/CFLDFileListContainer.h     MW_LAYER_PLATFORM_EXPORT_PATH(CFLDFileListContainer.h)
+../inc/FileListModel.rh     MW_LAYER_PLATFORM_EXPORT_PATH(FileListModel.rh)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/filelist_api/inc/CFLDController.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CFLDController observes the list box and invokes a MFLDFileProcessor
+*     if the timer expires.
+*
+*
+*/
+
+
+
+#ifndef __CFLDCONTROLLER_H__
+#define __CFLDCONTROLLER_H__
+
+//	INTERNAL INCLUDES
+#include "MFLDFileListBoxObserver.h"
+
+//	EXTERNAL INCLUDES
+#include <e32base.h>
+#include <ConeResLoader.h>	// For RConeResourceLoader
+
+// FORWARD DECLARATIONS
+class MFLDFileObserver;
+class MFLDFileProcessor;
+class RWindow;
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	class CFLDSoftKeyChanger;
+#endif
+
+//  CLASS DECLARATION
+
+/**
+* CFLDController observes the list box and invokes a MFLDFileProcessor
+* if the timer expires.
+*
+* @lib filelist.lib
+* @since 2.1
+*/
+class   CFLDController
+    : public CBase, public MFLDFileListBoxObserver
+    {
+
+ 	private:  // Enumerations
+
+           // These match with the ones in Profile Engine
+        enum TRingingTypes
+            {
+            ERingingTypeRinging = 0,
+            ERingingTypeAscending,
+            ERingingTypeRingOnce,
+            ERingingTypeBeepOnce,
+            ERingingTypeSilent
+            };
+    public:     // Constructors and destructors
+
+		/**
+        * Completes the construction of CFLDController.
+        * @param aWindow A reference to window handle
+        */
+		IMPORT_C void CompleteConstructionL( RWindow& aWindow );
+
+		/**
+        * Destructor
+        */
+        IMPORT_C virtual ~CFLDController();
+
+        /**
+        * Two-phased static constructor.
+        * @param aShowErrorMsgs Show an error note if the file format is not supported
+        * @param aDelay The delay in microseconds until the timer expires
+        * @return A pointer to a fully constructed CController instance
+        */
+        IMPORT_C static CFLDController* NewL( TBool aShowErrorMsgs,
+          TTimeIntervalMicroSeconds32 aDelay );
+
+        /**
+        * Two-phased static constructor, leaves a pointer to cleanup stack
+        * @param aShowErrorMsgs Show an error note if the file format is not supported
+        * @param aDelay The delay in microseconds until the timer expires
+        * @return A pointer to a fully constructed CController instance
+        */
+        IMPORT_C static CFLDController* NewLC( TBool aShowErrorMsgs,
+         TTimeIntervalMicroSeconds32 aDelay );
+
+    private:  // Constructors and destructors
+
+        /**
+        * Constructor
+        * @param aShowErrorMsgs Show an error note if the file format is not supported
+        * @param aDelay The delay in microseconds until the timer expires
+        */
+        CFLDController( TBool aShowErrorMsgs,
+         TTimeIntervalMicroSeconds32 aDelay );
+
+        /**
+        * Second phase constructor
+        */
+        void ConstructL( );
+
+    public:     // New methods
+
+        /**
+        * Set the delay until the timer expires.
+        * @param aDelay The delay in microseconds
+        */
+        IMPORT_C void SetDelay( TTimeIntervalMicroSeconds32 aDelay );
+
+		/**
+        * Set the volume level on which the sound is played
+        * If this method is not called, audio and video players
+        * uses the setting in active profile.
+        * @param aVolume The volume level
+        */
+        IMPORT_C void SetVolume( TInt aVolume );
+
+        /**
+        * Sets the ringing type
+         * If this method is not called, audio and video players
+        * uses the setting in active profile.
+        * @param aRingingType The ringing type (see enum TRingingTypes)
+        */
+        IMPORT_C void SetRingingType( TInt aRingingType );
+
+        /**
+        * Sets vibrating alert on or off.
+         * If this method is not called, audio and video players
+        * uses the setting in active profile.
+        * @param aVibra True: Vibra is on. False: Vibra is off.
+        */
+        IMPORT_C void SetVibra( TBool aVibra );
+
+		/**
+		* Sets the file observer for the class.
+		* The file observer is asked if the file is ok to be processed.
+		* @since 2.5
+		* @param aFileObserver Pointer to the file observer.
+		*/
+		IMPORT_C void SetFileObserver( MFLDFileObserver* aFileObserver );
+		
+	 	/**
+        * Sets 3d-effects on or off.
+        * If this method is called using parameter EFalse 3d-effects are 
+        * always disabled even though those are set in active profile.
+        * Otherwise toneplayer uses the setting in active profile.
+        * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off.
+        */
+        IMPORT_C void Set3dEffects( TBool a3dEffects );
+        
+        /**
+         * Release allocated resources
+         */
+        void Release();
+
+    private:  // New methods
+
+        /**
+        * This callback method is called when the timer expires. Calls
+        * MFLDFileProcessor::ProcessFileL().
+		* @param aPtr pointer to CFLDController
+		* @return Returns always zero
+        */
+        static TInt HandleTimerTickL( TAny* aPtr );
+
+    public:     // Methods derived from MFLDFileListBoxObserver
+
+        /**
+        * Receives the event notification from the file list box
+        */
+        IMPORT_C void HandleFileListBoxEventL( TFileListBoxEvent aEvent,
+                                                   const TDesC& aFileName );
+		/**
+        * Passes softkey notifications to the file list box
+        */
+		void HandleSoftKeyState( TFileListSoftKeyState& aSoftKeyState );
+
+    private:    // Data
+
+          /// Own: Pointer to the file handler
+        MFLDFileProcessor* iAudioProcessor;
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+        /// Own: Pointer to the file handler
+        MFLDFileProcessor* iVideoProcessor;
+#endif
+		/// Own: Pointer to timer
+        CPeriodic* iTimer;
+
+		/// Ref: Pointer to window
+		RWindow* iWindow;
+
+        /// Currently focused file in the list
+        TFileName iCurrentFile;
+
+        /// The delay in microseconds until timer expires
+        TTimeIntervalMicroSeconds32 iDelay;
+
+		/// Ref: Pointer to file observer
+		MFLDFileObserver* iFileObserver;
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+		/// Own: Pointer to the sofkey changer
+		CFLDSoftKeyChanger* iSoftKeyChanger;
+#endif
+		/// Ringingvolume
+        TInt iRingingVolume;
+
+		/// Ringingtype
+        TInt iRingingType;
+
+		/// Vibrasetting (on/off)
+        TBool iVibra;
+
+        /// Show errors
+        TBool iShowErrorMsgs;
+
+		/// Resourceloader which loads used resources
+       	RConeResourceLoader iResourceLoader;        
+       	
+       	/// 3DSettings (on/off)
+       	TBool i3dEffects;
+
+    };
+
+#endif      //  __CFLDCONTROLLER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/filelist_api/inc/CFLDFileListContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,276 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     FileListContainer owns the list box, the model, and the controller,
+*     and it is used to launch the popup list.
+*
+*
+*/
+
+
+
+#ifndef __CFLDFILELISTCONTAINER_H__
+#define __CFLDFILELISTCONTAINER_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <DRMHelper.h>
+#include <bamdesca.h>
+#include <CLFContentListing.hrh>
+
+// FORWARD DECLARATIONS
+class CFLDDRMImplementation;
+class CFLDFileListModel;
+class CFLDController;
+
+//  CLASS DECLARATION
+/**
+* FileListContainer owns the list box, the model, and the controller,
+* and it is used to launch the popup list.
+*
+* @lib filelist.lib
+* @since 2.1
+*/
+class   CFLDFileListContainer
+    : public CBase
+    {
+    public:     // Constructors and destructors
+
+	    /**
+        * Two-phase static constructor
+        * @return A pointer to a fully constructed CFLDFileListContainer instance
+        */
+        IMPORT_C static CFLDFileListContainer* NewL();
+
+		/**
+		* Two-phase static constructor
+		* @return A pointer to a fully constructed CFLDFileListContainer instance.
+		*/
+        IMPORT_C static CFLDFileListContainer* NewLC();
+    
+        /**
+        * Two-phase static constructor
+        * @param aResourceId A CLF model resource, see CLFContentListing.rh
+        * @return A pointer to a fully constructed CFLDFileListContainer instance
+        */
+        IMPORT_C static CFLDFileListContainer* NewL(
+			const TInt aResourceId );
+
+        /**
+        * Two-phase static constructor
+        * @param aResourceId A CLF model resource, see CLFContentListing.rh
+        * @return A pointer to a fully constructed CFLDFileListContainer instance.
+        */
+        IMPORT_C static CFLDFileListContainer* NewLC(
+			const TInt aResourceId );
+			
+		/**
+        * Two-phase static constructor
+        * @param aResourceId A CLF model resource, see CLFContentListing.rh
+        * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
+        * structure, see FileListModel.rh for details
+        * @return A pointer to a fully constructed CFLDFileListContainer instance
+        */
+        IMPORT_C static CFLDFileListContainer* NewL(
+			const TInt aResourceId, const TInt aDirectoriesResourceId );
+
+       /**
+        * Two-phase static constructor
+        * @param aResourceId A CLF model resource, see CLFContentListing.rh
+        * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
+        * structure, see FileListModel.rh for details
+        * @return A pointer to a fully constructed CFLDFileListContainer instance
+        */
+        IMPORT_C static CFLDFileListContainer* NewLC(
+			const TInt aResourceId, const TInt aDirectoriesResourceId );			
+
+        /**
+        * Destructor
+        */
+        IMPORT_C virtual ~CFLDFileListContainer();
+
+    private:  // Constructors and destructors
+
+        /**
+        * Constructor
+        */
+        CFLDFileListContainer();
+
+        /**
+        * Second phase constructor
+        * @param aResourceId A CLF model resource, see CLFContentListing.rh
+        * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
+        * structure, see FileListModel.rh for details
+        */
+        void ConstructL(
+         const TInt aResourceId, const TInt aDirectoriesResourceId );
+
+    public:     // New methods
+
+		/**
+        * Set the automated content type
+        * @param  aAutomatedType: type of automated content
+        */
+        IMPORT_C void SetAutomatedType(
+         CDRMHelper::TDRMHelperAutomatedType aAutomatedType );
+         
+        /**
+        * Launches a popup list for browsing files
+        * @param aFileName The selected file name will be stored here. If the selected
+        *        item was not a file but a null text item, aFileName will contain KNullDesC.
+        *        If aFileName contains something already, CFLDFileListContainer tries to find
+        *        the name on the list and focus on it.
+        *        NOTE: Size of aFileName must be KMaxFileName, otherwise KErrNotFound is
+        *		 returned (aFileName is compared against TFileName entities).
+        * @param aPopupTitle If this parameter is given, sets the title text of the popup
+        * @return True: User selected a file, and its name is stored in aFileName.
+        *         False: No file selected because user pressed cancel.
+        */
+        IMPORT_C TBool LaunchL( TDes& aFileName, const TDesC& aPopupTitle = KNullDesC );
+
+        /**
+        * Adds a text (e.g. "None") as the first item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        */
+        IMPORT_C void InsertNullItemL( const TDesC& aItemText );
+
+        /**
+        * Adds a text (e.g. "None") as the first item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        * @param aFileName A descriptor containing the ringing tone file name for null item
+        */
+        IMPORT_C void InsertNullItemL( const TDesC& aItemText, const TDesC& aFileName );
+
+        /**
+        * Adds a text (e.g. "None") as the last item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        */
+        IMPORT_C void InsertEndNullItemL( const TDesC& aItemText );
+
+        /**
+        * Adds a text (e.g. "None") as the last item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        * @param aFileName A descriptor containing the ringing tone file name for null item
+        */
+        IMPORT_C void InsertEndNullItemL( const TDesC& aItemText, const TDesC& aFileName );
+
+        /**
+        * Set the delay until the timer expires.
+        * @param aDelay The delay in microseconds
+        */
+        IMPORT_C void SetDelay( TTimeIntervalMicroSeconds32 aDelay );
+
+        /**
+         * Set the volume level on which the sound is played.
+         * If this method is not called, toneplayer uses the setting in active profile.
+         * @param aVolume The volume level
+         */
+        IMPORT_C void SetVolume( TInt aVolume );
+
+        /**
+         * Sets the ringing type
+         * If this method is not called, toneplayer uses the setting in active profile.
+         * @param aRingingType The ringing type (see CFLDRingingTonePlayer::TRingingTypes)
+         */
+        IMPORT_C void SetRingingType( TInt aRingingType );
+
+        /**
+        * Sets vibrating alert on or off.
+        * If this method is not called, toneplayer uses the setting in active profile.
+        * @param aVibra True: Vibra is on. False: Vibra is off.
+        */
+        IMPORT_C void SetVibra( TBool aVibra );
+
+        /**
+        * Adds a new MIME type into blocking list.
+        * @param aMimeType The blocked MIME type
+        */
+    	IMPORT_C void AddExclusiveMimeTypeL( const TDesC& aMimeType );
+
+    	/**
+        * Adds a new media type into blocking list.
+        * @param aMediaType The blocked media type (see TCLFMediaType enumeration
+        * inside CFLContentListing.hrh)
+        */
+    	IMPORT_C void AddExclusiveMediaTypeL( const TInt32 aMediaType );
+
+    	/**
+        * Sets wanted mime types. Overrides all settings defined inside
+        * resource, defined with AddExclusive -methods or with
+        * SetWanted -methods.
+        * @param aMimeTypes The array containing wanted MIME types
+        */
+    	IMPORT_C void SetWantedMimeTypesL( const MDesCArray& aMimeTypes );
+
+     	/**
+        * Sets wanted media types. Overrides all settings defined inside
+        * resource, defined with AddExclusive -methods or with
+        * SetWanted -methods.
+        * @param aMediaTypes The array containing wanted media types
+        */
+    	IMPORT_C void SetWantedMediaTypesL( const TArray<TCLFMediaType>& aMediaTypes );
+
+    	/**
+        * Removes all the defined exlusive MIME types
+        */
+    	IMPORT_C void ResetExclusiveMimeTypes();
+
+    	/**
+        * Removes all the defined exlusive media types
+        */
+    	IMPORT_C void ResetExclusiveMediaTypes();
+    	
+    	/**
+        * Sets the maximum file size for the list.
+        * @param aMaxFileSize The maximum file size in bytes. If you want to
+        *        allow all file sizes, set this to KFLDNoSizeFiltering
+        *        (defined in FileListModel.hrh).
+        * @since 3.1
+        */
+        IMPORT_C void SetMaxFileSize( const TInt aMaxFileSize );
+        
+         /**
+        * Sets 3d-effects on or off.
+        * If this method is called using parameter EFalse 3d-effects are 
+        * always disabled even though those are set in active profile.
+        * Otherwise toneplayer uses the setting in active profile.
+        * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off.
+        */
+        IMPORT_C void Set3dEffects( TBool a3dEffects );
+
+    private:    // Data
+
+        /// Own: The file list model
+        CFLDFileListModel* iModel;
+
+        /// Own: The controller
+        CFLDController* iController;
+
+		/// Own: DRM implementation
+		CFLDDRMImplementation* iDRMImplementation;
+		
+		/// Resourceloader which loads used resources
+       	RConeResourceLoader iResourceLoader;
+
+    };
+
+#endif      //  __CFLDFILELISTCONTAINER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/filelist_api/inc/FileListModel.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains declarations for resources of File List.
+*     The file can be included in C++ or resource file.
+*
+*
+*/
+
+
+#ifndef __FILELISTMODEL_HRH__
+#define __FILELISTMODEL_HRH__
+
+//  CONSTANTS
+
+enum TSortCriteria { EAlphaAscending, EAlphaDescending, EDateAscending, EDateDescending };
+
+#define KFLDNoSizeFiltering 0x7fffffff
+
+enum        // CBA constants
+    {
+    EFldSoftkeyVideoPreview = 0x6000,
+    EFldSoftkeyVideoPreviewSelect
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/filelist_api/inc/FileListModel.rh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains declarations for resources of File List.
+*     The file can be included only in resource file.
+*     
+*
+*/
+
+
+#include <FileListModel.hrh>
+
+//  STRUCTURE DEFINITIONS
+    
+// ---------------------------------------------------------
+//    FILELISTDIRECTORIES
+// ---------------------------------------------------------
+//
+/**
+
+  Content Listing Framework won't scan the ROM so we must
+  define which ROM directories are wanted into FileList model.
+  These definitions are put into RomDirectories -section.
+  
+  If user wants to define specific locations where tones are
+  searched in phone ( C: and E: ), these definitions are put into
+  PhoneDirectories -section. NOTE: these locations must be
+  inside C:\\data and E: folders ( including subdirectories ).
+  If this definition is left empty, use all the locations
+  scanned by CLF.
+    
+  Here is an example of the usage:
+  
+  RESOURCE FILELISTDIRECTORIES r_fld_directories
+    {
+    // Scan these ROM directories
+    RomDirectories =
+        {
+        LBUF { txt = text_rom_root_path text_sounds_path; },
+        LBUF { txt = text_rom_root_path text_digital_sounds_path; },
+        LBUF { txt = text_rom_root_path text_simple_sounds_path; }
+        };
+    
+    // Show only these these phone directories.
+  	PhoneDirectories =
+        {
+        LBUF { txt = "c:\\data\\sounds\\simple\\"; }
+        };   
+*/
+    
+STRUCT FILELISTDIRECTORIES
+	{    
+	// LTEXT array of ROM directories to be scanned
+    STRUCT RomDirectories[];
+    
+    // LTEXT array of directories on phone and memorycard
+    STRUCT PhoneDirectories[];
+	}
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/filelist_api/inc/MFLDFileListBoxObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     MFLDFileListBoxObserver defines an abstract interface to observe
+*     file list box events.
+*
+*/
+
+
+
+#ifndef __MFLDFILELISTBOXOBSERVER_H__
+#define __MFLDFILELISTBOXOBSERVER_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+
+//  FORWARD DECLARATIONS
+class RWindow;
+
+// CLASS DEFINITION
+
+/**
+* MFLDFileListBoxObserver defines an abstract interface to observe
+* file list box events.
+*/
+class MFLDFileListBoxObserver
+    {
+    public:     // Enumerations
+        enum TFileListBoxEvent
+            {
+            EFocusChanged = 1,
+            EListBoxClosed,
+            EOtherKeyEvent,
+            EVideoPreview,
+            EVideoPreviewSelected,
+            EVideoPreviewCanceled
+            };
+
+		enum TFileListSoftKeyState
+		    {
+   		    EToneSelectionSoftKeyState = 1,
+		    EPreviewSoftKeyState,
+		    EPreviewSelectSoftKeyState
+    		};
+
+    protected:  // Constructors and destructors
+
+        /**
+        * Destructor.
+        */
+        virtual ~MFLDFileListBoxObserver() {}
+
+    public:     // New methods
+
+        /**
+        * Receives information about a file list box event
+        * @param aEvent The event type that happened
+        * @param aFileName The file name that is currently focused, or KNullDesC
+        * construct different components using existing window.
+		*/
+        virtual void HandleFileListBoxEventL( TFileListBoxEvent aEvent,
+            const TDesC& aFileName = KNullDesC ) = 0;
+
+        /**
+        * Method for listbox to receive current state of the softkeys.
+        * @param aSoftKeyState This parameter will return the softkey state
+        * TFileListSoftKeyState as a return parameter
+		*/
+        virtual void HandleSoftKeyState( TFileListSoftKeyState& aSoftKeyState ) = 0;
+
+    };
+
+#endif      //  __MFLDFILELISTBOXOBSERVER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+#include "../profiles_engine_api/group/bld.inf"
+#include "../profiles_mediafilelist_api/group/bld.inf"
+#include "../filelist_api/group/bld.inf"
+
+#include "../settings_backgroundimage_api/group/bld.inf"
+#include "../settings_framework_api/group/bld.inf"
+#include "../settings_launch_api/group/bld.inf"
+#include "../settings_listbox_api/group/bld.inf"
+#include "../settings_plugin_api/group/bld.inf"
+#include "../settings_uis_cenrep_collection_api/group/bld.inf"
+
+PRJ_TESTMMPFILES
+
+//  End of File 
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Profiles Engine API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/ProfileEngineDomainConstants.h   MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEngineDomainConstants.h)
+../inc/CProfileChangeNotifyHandler.h    MW_LAYER_PLATFORM_EXPORT_PATH(CProfileChangeNotifyHandler.h)
+../inc/ProfileInternal.hrh              MW_LAYER_PLATFORM_EXPORT_PATH(ProfileInternal.hrh)
+../inc/MProfileEngine.h                 MW_LAYER_PLATFORM_EXPORT_PATH(MProfileEngine.h)
+../inc/MProfilePttSettings.h            MW_LAYER_PLATFORM_EXPORT_PATH(MProfilePttSettings.h)
+../inc/MProfileFeedbackSettings.h       MW_LAYER_PLATFORM_EXPORT_PATH(MProfileFeedbackSettings.h)
+../inc/MProfile3DToneSettings.h         MW_LAYER_PLATFORM_EXPORT_PATH(MProfile3DToneSettings.h)
+../inc/MProfileExtraSettings.h          MW_LAYER_PLATFORM_EXPORT_PATH(MProfileExtraSettings.h)
+../inc/ProfileEngineDomainCRKeys.h      MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEngineDomainCRKeys.h)
+../inc/ProfilesVariant.hrh              MW_LAYER_PLATFORM_EXPORT_PATH(ProfilesVariant.hrh)
+../inc/TProfileToneSettings.h           MW_LAYER_PLATFORM_EXPORT_PATH(TProfileToneSettings.h)
+../inc/MProfileChangeObserver.h         MW_LAYER_PLATFORM_EXPORT_PATH(MProfileChangeObserver.h)
+../inc/MProfilesNamesArray.h            MW_LAYER_PLATFORM_EXPORT_PATH(MProfilesNamesArray.h)
+../inc/MProfileExtraTones.h             MW_LAYER_PLATFORM_EXPORT_PATH(MProfileExtraTones.h)
+../inc/MProfileTones.h                  MW_LAYER_PLATFORM_EXPORT_PATH(MProfileTones.h)
+../inc/MProfileName.h                   MW_LAYER_PLATFORM_EXPORT_PATH(MProfileName.h)
+../inc/MProfile.h                       MW_LAYER_PLATFORM_EXPORT_PATH(MProfile.h)
+
+../inc/MProfileEngineExtended.h         MW_LAYER_PLATFORM_EXPORT_PATH(MProfileEngineExtended.h)
+../inc/MProfileExtended.h               MW_LAYER_PLATFORM_EXPORT_PATH(MProfileExtended.h)
+../inc/MProfilePresence.h               MW_LAYER_PLATFORM_EXPORT_PATH(MProfilePresence.h)
+../inc/MProfileSetPresence.h            MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetPresence.h)
+../inc/ProfileEng.hrh                   MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEng.hrh)
+../inc/ProfileEngineConstants.h         MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEngineConstants.h)
+../inc/MProfileSetExtraTones.h          MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetExtraTones.h)
+../inc/MProfileSetName.h                MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetName.h)
+../inc/ProfileEng.rh                    MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEng.rh)
+../inc/MProfilesLocalFeatures.h         MW_LAYER_PLATFORM_EXPORT_PATH(MProfilesLocalFeatures.h)
+../inc/MProfileUtilitySingleton.h       MW_LAYER_PLATFORM_EXPORT_PATH(MProfileUtilitySingleton.h)
+../inc/ProfileEngineInternalCRKeys.h    MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEngineInternalCRKeys.h)
+../inc/ProfileEngineInternalPSKeys.h    MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEngineInternalPSKeys.h)
+
+../inc/MProfileSet3DToneSettings.h      MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSet3DToneSettings.h)
+../inc/MProfileSetExtraSettings.h       MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetExtraSettings.h)
+../inc/MProfileSetFeedbackSettings.h    MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetFeedbackSettings.h)
+../inc/MProfileSetPttSettings.h         MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetPttSettings.h)
+../inc/MProfileSetTones.h               MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetTones.h)
+
+../inc/SecondaryDisplayProfilesAPI.h    MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/SecondaryDisplayProfilesAPI.h)
+
+../inc/ProfileEnginePrivatePSKeys.h	MW_LAYER_PLATFORM_EXPORT_PATH(ProfileEnginePrivatePSKeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/CProfileChangeNotifyHandler.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile change notify handler.
+*
+*/
+
+
+
+#ifndef __CPROFILECHANGENOTIFYHANDLER_H__
+#define __CPROFILECHANGENOTIFYHANDLER_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+class MProfileChangeObserver;
+
+// CLASS DECLARATION
+
+/**
+*  Profile change notify handler.
+*  How to use:
+*  class CMyClass : public CBase, public MProfileChangeObserver
+*      {
+*      ...
+*      virtual void HandleActiveProfileEventL(
+*              TProfileEvent aProfileEvent, TInt aProfileId );
+*      ...
+*      private:    // data
+*          CProfileChangeNotifyHandler* iHandler;
+*
+*      }
+*  void CMyClass::ConstructL()
+*      {
+*      iHandler = CProfileChangeNotifyHandler::NewL( this );
+*      }
+*
+*  void CMyClass::HandleActiveProfileEventL(
+*              TProfileEvent aProfileEvent,
+*              TInt aProfileId )
+*      {
+*      // handle event
+*      }
+*
+*  @lib ProfileEng.lib
+*  @since 2.0
+*/
+
+NONSHARABLE_CLASS(CProfileChangeNotifyHandler) : public CBase
+    {
+    private: // class definitions
+
+        NONSHARABLE_CLASS(CProfilePSObserver) : public CActive
+            {
+            public:  // constructor and destructor
+                CProfilePSObserver( TUint32 aPSKey );
+                ~CProfilePSObserver(); 
+
+            public: // New functions:
+
+                /**
+                 * Requests notifications from P&S of KProEngActiveProfile-
+                 * Modified value changes.
+                 */
+                void RequestNotificationL();
+
+            private: // Functions from base classes
+
+                /**
+                 * From CActive.
+                 */
+                void RunL();
+                void DoCancel();
+
+            public: // Data:
+
+                // The P&S key to observe
+                TUint32 iPSKey;
+
+                // Ref:
+                CRepository* iCenRep;
+
+                // Own:
+                RProperty iProperty;
+
+                // Ref: Active profile change observer
+                MProfileChangeObserver* iProfileChangeObserver;
+
+                TBool iAttached;
+
+            };
+
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aProfileChangeObserver Profile change observer.
+        */
+        IMPORT_C static CProfileChangeNotifyHandler* NewL(
+            MProfileChangeObserver* aProfileChangeObserver );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileChangeNotifyHandler();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        * @param aProfileChangeObserver Profile change observer.
+        */
+        CProfileChangeNotifyHandler(
+            MProfileChangeObserver* aProfileChangeObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Ref: Active profile change observer
+        MProfileChangeObserver* iProfileChangeObserver;
+
+        // Own:
+        CProfilePSObserver* iActiveProfileObserver;
+
+        // Own:
+        CProfilePSObserver* iPSObserver;
+
+        // Own:
+        CRepository* iRepository;
+    };
+
+#endif      //  __CPROFILECHANGENOTIFYHANDLER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfile.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile settings interface.
+*
+*/
+
+
+
+#ifndef __MPROFILE_H__
+#define __MPROFILE_H__
+
+//  INCLUDES
+#include <cntdef.h> // TContactItemId
+
+// FORWARD DECLARATIONS
+class MProfileName;
+class MProfileTones;
+class MProfileExtraTones;
+class MProfileExtraSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Profile settigns interface.
+*  MProfile offers methods to get the alert for items, profile name interface,
+*  profile tones interface and profile extra tones interface.
+*  How to use:
+*  Get active profile with MProfileEngine::ActiveProfileL().
+*     MProfile* profile = iProfileEngine->ActiveProfileL();
+*  Free resources with MProfile::Release()
+*     profile->Release();
+*  If you release resources in destructor then:
+*     if( iProfile )
+*         {
+*         iProfile->Release();
+*         }
+*
+*  If you put this class to CleanupStack then use void CleanupReleasePushL()
+*     CleanupReleasePushL( *profile );
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfile
+    {
+    protected:  // Destructor
+
+        virtual ~MProfile() {};
+
+    public: // New functions
+
+        /**
+        * Free resources of the profile.
+        * @since 2.0
+        */
+        virtual void Release() = 0;
+
+        /**
+        * Return the alert for item array.
+        * @since 2.0
+        * @return Alert for array
+        */
+        virtual const TArray<TContactItemId> AlertForL() = 0;
+
+        /**
+        * Is silent profile.
+        * @since 2.0
+        * @return ETrue if profile is silent
+        */
+        virtual TBool IsSilent() const = 0;
+
+        /**
+        * Return profile name.
+        * @since 2.0
+        * @return Instance of the profile name
+        */
+        virtual const MProfileName& ProfileName() const = 0;
+
+        /**
+        * Return tone settings.
+        * @since 2.0
+        * @return Instance of the MProfileTones
+        */
+        virtual const MProfileTones& ProfileTones() const = 0;
+
+        /**
+        * Return extra tone settings.
+        * @since 2.0
+        * @return Instance of the MProfileExtraTones
+        */
+        virtual const MProfileExtraTones& ProfileExtraTones() const = 0;
+
+        /**
+        * Return Profiles extra settings.
+        * @since 3.0
+        * @return Instance of the MProfileExtraSettings
+        */
+        virtual const MProfileExtraSettings& ProfileExtraSettings() const = 0;
+
+    };
+
+#endif      //  __MPROFILE_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfile3DToneSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile 3D tone settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILE3DTONESETTINGS_H
+#define MPROFILE3DTONESETTINGS_H
+
+//  INCLUDES
+#include <ProfileInternal.hrh>
+
+// CLASS DECLARATION
+
+/**
+*  Profile 3D tone settings interface.
+*  @since 3.1
+*/
+class MProfile3DToneSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfile3DToneSettings() {};
+
+    public: // New functions
+
+        /**
+        * Returns PTT ringing tone file name.
+        * @since 3.1
+        * @return Returns PTT ringing tone file name.
+        */
+        virtual TProfile3DToneEffect Effect() const = 0;
+
+        /**
+         * Returns PTT status of the profile.
+         * @since 3.1
+         * @return Returns PTT status of the profile.
+         */
+        virtual TProfile3DToneEcho Echo() const = 0;
+
+    };
+
+#endif      //  MPROFILE3DTONESETTINGS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileChangeObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract interface for handling the active profile events.
+*
+*/
+
+
+
+#ifndef __MPROFILECHANGEOBSERVER_H
+#define __MPROFILECHANGEOBSERVER_H
+
+// INCLUDES
+#include <e32std.h>
+
+// DATA TYPES
+enum TProfileEvent
+    {
+    EProfileNewActiveProfile = 0,
+    EProfileActiveProfileModified,
+    EProfileUnknownEvent = 0xFFFFFFFF
+    };
+
+// CLASS DECLARATION
+
+/**
+*  Abstract interface for handling the active profile events.
+*  User derives his class from this and implements HandleActiveProfileEventL().
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileChangeObserver
+    {
+    public: // New functions
+
+        /**
+        * This is a callback function which is called when a active profile event
+        * completes. User must derive his class from MProfileChangeObserver
+        * and implement this method if he is to use notify services.
+        * @since 2.0
+        * @param aProfileEvent Profile event
+        * @param aProfileId Active profile id
+        */
+        virtual void HandleActiveProfileEventL(
+            TProfileEvent aProfileEvent, TInt aProfileId ) = 0;
+
+
+    };
+
+#endif      // __MPROFILECHANGEOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileEngine.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile Engine interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEENGINE_H__
+#define __MPROFILEENGINE_H__
+
+// INCLUDES
+#include <e32std.h>
+#include <Profile.hrh>          // TProfileRingingVolume 
+
+// DATA TYPES
+enum TProfileFeatureId
+    {
+    EProfileFeatureVTRingingTone,
+    EProfileFeatureWmaDemoPlay  // if this is true, demo-play is DISABLED
+    };
+
+// FUNCTION PROTOTYPES
+class MProfileEngine;
+class RFs;
+
+/**
+* Create profile engine, ownership transfered.
+*
+*  @lib ProfileEng.lib
+*  @since 2.0
+*/
+IMPORT_C MProfileEngine* CreateProfileEngineL();
+
+/**
+* Create profile engine, ownership transfered.
+*
+*  @param aFs An open file server session, ownership is NOT transferred.
+*  aFs must remain connected for the lifetime of the returned object.
+*  @lib ProfileEng.lib
+*  @since 3.0
+*/
+IMPORT_C MProfileEngine* CreateProfileEngineL( RFs* aFs );
+
+// FORWARD DECLARATIONS
+class MProfile;
+class MProfilesNamesArray;
+
+// CLASS DECLARATION
+
+/**
+*  Profile engine interface.
+*  This class offers methods to get active profile, active profile ID,
+*  profile names array and set active profile.
+*  How to use:
+*  Create profile engine with CreateProfileEngineL();
+*      MProfileEngine* profileEngine = CreateProfileEngineL();
+*  Free resources with MProfileEngine::Release();
+*      profileEngine->Release();
+*  or if you release resources in destructor:
+*      ( iProfileEngine )
+*          {
+*          iProfileEngine->Release();
+*          }
+*
+*  If you put this class to CleanupStack then use void CleanupReleasePushL()
+*     CleanupReleasePushL( *profileEngine );
+*
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileEngine
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileEngine() {};
+
+    public:
+
+        /**
+        * Frees resources.
+        * @since 2.0
+        */
+        virtual void Release() = 0;
+
+        /**
+        * Return active profile, ownership transfered.
+        * @since 2.0
+        * @return Instance of the MProfile
+        */
+        virtual MProfile* ActiveProfileLC() = 0;
+
+        /**
+        * Return active profile, ownership transfered.
+        * @since 2.0
+        * @return Instance of the MProfile
+        */
+        virtual MProfile* ActiveProfileL() = 0;
+
+        /**
+        * Return active profile ID or system error code.
+        * @since 2.0
+        * @return Active profile ID or system error code.
+        */
+        virtual TInt ActiveProfileId() = 0;
+
+        /**
+        * Return profiles names array, ownership transfered.
+        * @since 2.0
+        * @return Instance of the profiles names array
+        */
+        virtual MProfilesNamesArray* ProfilesNamesArrayLC() = 0;
+
+        /**
+        * Set active profile if ID is incorrect then leave with KErrNotFound.
+        * @since 2.0
+        * @param aId Profile ID
+        */
+        virtual void SetActiveProfileL( TInt aId ) = 0;
+
+        /**
+         * Sets the temporary ringing volume of the current active profile to
+         * the given value. Temporary means that if another profile is
+         * activated and after that the original is reactivated the temporary
+         * value will be lost. Leaves with KErrAccessDenied if the ringing
+         * volume setting of the current profile is read-only.
+         * @since 2.6
+         * @param aVolume the new value for the temporary ringing volume level.
+         */
+        virtual void SetTempRingingVolumeL( TProfileRingingVolume aVolume ) = 0;
+
+        /**
+         * Gets the temporary ringing volume of the current active profile.
+         * Temporary means that if another profile is activated and after
+         * that the original is reactivated the temporary value will be lost.
+         * @since 2.6
+         * @return the temporary ringing volume level of the active profile.
+         */
+        virtual TProfileRingingVolume TempRingingVolumeL() const = 0;
+
+        /**
+         * Sets the temporary media volume of the current active profile to
+         * the given value. Temporary means that if another profile is
+         * activated and after that the original is reactivated the temporary
+         * value will be lost. Leaves with KErrAccessDenied if the media
+         * volume setting of the current profile is read-only.
+         * @since 2.6
+         * @param aVolume the new value for the temporary media volume level.
+         */
+        virtual void SetTempMediaVolumeL( TProfileRingingVolume aVolume ) = 0;
+
+        /**
+         * Gets the temporary media volume of the current active profile.
+         * Temporary means that if another profile is activated and after
+         * that the original is reactivated the temporary value will be lost.
+         * @since 2.6
+         * @return the temporary media volume level of the active profile.
+         */
+        virtual TProfileRingingVolume TempMediaVolumeL() const = 0;
+
+        /**
+         * Checks whether the given feature is supported by Profiles Engine.
+         * @since 2.8
+         * @param aFeatureId the feature to be checked.
+         * @return ETrue if the given feature is supported, EFalse otherwise.
+         */
+        virtual TBool IsFeatureSupported(
+            TProfileFeatureId aFeatureId ) const = 0;
+
+        /**
+        * Checks if the current active profile is timed or not.
+        * @since 3.2
+        * @return ETrue if the current active profile is timed, EFalse
+        * otherwise.
+        */
+        virtual TBool IsActiveProfileTimedL() = 0;
+
+    };
+
+#endif      //  __MPROFILEENGINE_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileEngineExtended.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extended profile engine interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEENGINEEXTENDED_H__
+#define __MPROFILEENGINEEXTENDED_H__
+
+//  INCLUDES
+#include <MProfileEngine.h>
+
+// DATA TYPES
+enum TProfileUtilityObjectType
+    {
+    EProfileUtilityObjectPresenceTool      = 0
+    };
+
+// FUNCTION PROTOTYPES
+class MProfileEngineExtended;
+class MProfilesLocalFeatures;
+
+/**
+* Create extended profile engine, ownership transfered.
+*
+*  @lib ProfileEng.lib
+*  @since 2.0
+*/
+IMPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL();
+
+/**
+* Create extended profile engine, ownership transfered.
+*
+*  @param aFs An open file server session, ownership is NOT transferred.
+*  aFs must remain connected for the lifetime of the returned object.
+*  @lib ProfileEng.lib
+*  @since 3.0
+*/
+IMPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL( RFs* aFs );
+
+// FORWARD DECLARATIONS
+class MProfileExtended;
+class MProfilePresence;
+
+// CLASS DECLARATION
+
+/**
+*  Extended profile engine interface.
+*  This interface extend MProfileEngine interface and
+*  offers methods to get profile settings and store profile settings.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileEngineExtended : public MProfileEngine
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileEngineExtended() {};
+
+    public: // New functions
+
+        /**
+        * Create extended profile, ownership transfered.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Instance of the MProfileExtended
+        */
+        virtual MProfileExtended* ProfileLC( TInt aId ) = 0;
+
+        /**
+        * Create extended profile, ownership transfered.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Instance of the MProfileExtended
+        */
+        virtual MProfileExtended* ProfileL( TInt aId ) = 0;
+
+        /**
+        * Store profile settings. Leaves with KErrAccessDenied if one or more
+        * of the settings of the target profile is/are read-only.
+        * @since 2.0
+        * @param aProfile Profile
+        */
+        virtual void CommitChangeL( MProfileExtended& aProfile ) = 0;
+
+        /**
+        * Send presence settings.
+        * @since 2.1
+        * @param aProfile Profile
+        */
+        virtual void SendPresenceSettingsL(
+            const MProfilePresence& aPresence ) = 0;
+
+        /**
+        * Delete profile.
+        * @since 2.1
+        * @param aId Profile ID
+        * @return Error code
+        */
+        virtual TInt DeleteProfileL( TInt aId ) = 0;
+
+        /**
+        * Create new profile, ownership transfered.
+        * @since 2.1
+        * @return Instance of the MProfileExtended
+        */
+        virtual MProfileExtended* CreateProfileL() = 0;
+
+        /**
+        * Returns is profile default profile.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Is profile default profile
+        */
+        virtual TBool IsDefaultProfile( TInt aId ) = 0;
+
+        /**
+        * Returns locally variated features of Profiles.
+        * @since 2.6
+        */
+        virtual MProfilesLocalFeatures& LocalFeatures() = 0;
+
+        /**
+         * Returns an utility object needed for a specific task. The returned
+         * object can be generally of any class and the caller must know what
+         * it wants and cast the returned object to the correct class.
+         * The ownership is not transferred.
+         * @param aType the type of the utility object to be returned.
+         * @param aImpl the utility object needed by the client on return, NULL
+         * if there isn't any of the given type
+         */
+        virtual void GetProfileUtilityObject(
+                TProfileUtilityObjectType aType, TAny*& aImpl ) = 0;
+
+        /**
+        * Set timed active profile. When the time expires the profile which was
+        * active before calling this method will be reactivated.
+        * If ID is incorrect then leave with KErrNotFound.
+        * @since 3.2
+        * @param aId Profile ID
+        * @param aTime time when the profile activation expires
+        */
+        virtual void SetActiveProfileTimedL( TInt aId, TTime aTime ) = 0;
+
+    };
+
+#endif      // __MPROFILEENGINEEXTENDED_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtended.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extended profile interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEEXTENDED_H__
+#define __MPROFILEEXTENDED_H__
+
+//  INCLUDES
+#include <MProfile.h>
+
+// DATA TYPES
+enum TProfileFlags
+    {
+    EProfileFlagRingingTone =               0x0001,
+    EProfileFlagRingingType =               0x0002,
+    EProfileFlagRingingVolume =             0x0004,
+    EProfileFlagMessageAlertTone =          0x0008,
+    EProfileFlagInstantMessageAlertTone =   0x0010,
+    EProfileFlagVibratingAlert =            0x0020,
+    EProfileFlagKeypadVolume =              0x0040,
+    EProfileFlagWarningTones =              0x0080,
+    EProfileFlagAlertFor =                  0x0100,
+    EProfileFlagAvailabilityAttribute =     0x0200,
+    EProfileFlagStatusMessage =             0x0400,
+    EProfileFlagProfileName =               0x0800,
+    EProfileFlagEmailAlertTone =            0x1000,
+    EProfileFlagVideoCallRingingTone =      0x2000,
+    EProfileFlagMediaVolume =               0x4000,
+    EProfileFlagTextToSpeechTone =          0x8000,
+//  Free slot              =               0x10000,
+    EProfileFlagPttTone =                  0x20000,
+    EProfileFlagPttStatus =                0x40000,
+    EProfileFlag3DEffect =                 0x80000,
+    EProfileFlag3DEcho =                  0x100000,
+    EProfileFlagTactileFeedback =         0x200000,
+    EProfileFlagAudioFeedback =           0x400000,
+    EProfileFlagAll =                       0xFFFF
+    };
+
+// FORWARD DECLARATIONS
+class MProfileSetName;
+class MProfileSetTones;
+class MProfilePresence;
+class MProfileSetPresence;
+class MProfileSetExtraTones;
+class MProfileSetExtraSettings;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Extended profile interface.
+*  This interface extend MProfile interface.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileExtended : public MProfile
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileExtended() {};
+
+    public: // New functions
+
+        /**
+        * This method set alert for items to the profile.
+        * @since 2.0
+        * @param aAlertFor Alert for item array.
+        */
+        virtual void SetAlertForL(
+            const TArray<TContactItemId>& aAlertFor ) = 0;
+
+        /**
+        * Returns set profile name interface.
+        * @since 2.0
+        * @return Returns set profile name interface.
+        */
+        virtual MProfileSetName& ProfileSetName() const = 0;
+
+        /**
+        * Returns set profile tones interface.
+        * @since 2.0
+        * @return Returns set profile tones interface.
+        */
+        virtual MProfileSetTones& ProfileSetTones() const = 0;
+
+        /**
+        * Returns profile presence interface.
+        * @since 2.0
+        * @return Returns profile presence interface.
+        */
+        virtual const MProfilePresence& ProfilePresence() const = 0;
+
+        /**
+        * Returns set profile presence interface.
+        * @since 2.0
+        * @return Returns set profile presence interface.
+        */
+        virtual MProfileSetPresence& ProfileSetPresence() const = 0;
+
+        /**
+        * Returns set profile extra tones interface.
+        * @since 2.0
+        * @return Returns set profile extra tones interface.
+        */
+        virtual MProfileSetExtraTones& ProfileSetExtraTones() const = 0;
+
+        /**
+        * Returns profile modifiable flags. See TProfileFlags.
+        * @since 2.0
+        * @return Returns profile modifiable flags.
+        */
+        virtual TUint32 ModifiableFlags() const = 0;
+
+        /**
+        * Returns profile visible flags. See TProfileFlags.
+        * @since 2.0
+        * @return Returns profile visible flags.
+        */
+        virtual TUint32 VisibleFlags() const = 0;
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to write the settings
+        */
+        virtual void ExternalizeL( CRepository& aCenRep ) = 0;
+
+        /**
+        * Returns set profile extra settings interface.
+        * @since 3.0
+        * @return set profile extra settings interface.
+        */
+        virtual MProfileSetExtraSettings& ProfileSetExtraSettings() const = 0;
+
+    };
+
+#endif      // __MPROFILEEXTENDED_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtraSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILEEXTRASETTINGS_H
+#define MPROFILEEXTRASETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProfilePttSettings;
+class MProfileFeedbackSettings;
+class MProfile3DToneSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Profile extra settings interface.
+*  @since 3.1
+*/
+class MProfileExtraSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileExtraSettings() {};
+
+    public: // New functions
+
+        /**
+         * Returns MProfilePttSettings set for this profile.
+         * @return MProfilePttSettings set for this profile.
+         * @since 3.1
+         */
+        virtual const MProfilePttSettings& ProfilePttSettings() const = 0;
+
+       /**
+         * Returns MProfileFeedbackSettings set for this profile.
+         * @return MProfileFeeedbackSettings set for this profile.
+         * @since 5.0
+         */
+        virtual const MProfileFeedbackSettings& ProfileFeedbackSettings() const = 0;
+
+       /**
+         * Returns MProfile3DToneSettings set for this profile.
+         * @return MProfile3DToneSettings set for this profile.
+         * @since 3.1
+         */
+        virtual const MProfile3DToneSettings& Profile3DToneSettings() const = 0;
+    };
+
+#endif      //  MPROFILEEXTRASETTINGS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtraTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile extra tones interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEEXTRATONES_H
+#define __MPROFILEEXTRATONES_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Profile extra tones interface.
+*  This interface offers method to get IM message alert tone file name.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileExtraTones
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileExtraTones() {};
+
+    public:
+
+        /**
+        * Returns IM message alert tone file name.
+        * @since 2.0
+        * @return Returns IM message alert tone file name.
+        */
+        virtual const TDesC& IMMessageAlertTone() const = 0;
+
+        /**
+        * Returns Email alert tone file name.
+        * @since 2.0
+        * @return Returns Email alert tone file name.
+        */
+        virtual const TDesC& EmailAlertTone() const = 0;
+
+        /**
+        * Returns Video call ringing tone file name.
+        * @since 2.6
+        * @return Returns Video call ringing tone file name.
+        */
+        virtual const TDesC& VideoCallRingingTone() const = 0;
+
+    };
+
+
+#endif      // __MPROFILEEXTRATONES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileFeedbackSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile tactile/audio feedback settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILEFEEDBACKSETTINGS_H
+#define MPROFILEFEEDBACKSETTINGS_H
+
+//  INCLUDES
+#include <ProfileInternal.hrh>
+
+// CLASS DECLARATION
+
+/**
+*  Profile feedback settings interface.
+*  @since 3.1
+*/
+class MProfileFeedbackSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileFeedbackSettings() {};
+
+    public: // New functions
+
+        /**
+        * Returns Tactile feedback status of the profile.
+        * @since 5.0
+        * @return Tactile feedback status of the profile.
+        */
+        virtual TProfileTactileFeedback TactileFeedback() const = 0;
+
+        /**
+         * Returns Audio feedback status of the profile.
+         * @since 5.0
+         * @return Audio feedback status of the profile.
+         */
+        virtual TProfileAudioFeedback AudioFeedback() const = 0;
+
+    };
+
+#endif      //  MPROFILEFEEDBACKSETTINGS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileName.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile name interface.
+*
+*/
+
+
+
+#ifndef __MPROFILENAME_H
+#define __MPROFILENAME_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Profile name interface.
+*  This interface offers methods to get profile ID and profile name.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileName
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileName() {};
+
+    public:
+        /**
+        * Returns ID of the profile.
+        * @since 2.0
+        * @return Returns ID of the profile.
+        */
+        virtual TInt Id() const = 0;
+
+        /**
+        * Returns name of the profile.
+        * @since 2.0
+        * @return Returns name of the profile.
+        */
+        virtual const TDesC& Name() const = 0;
+
+        /**
+        * Returns the default short name of the profile. The localised string
+        * returned by the method has the correct layout for navi pane with 5
+        * tabs. If user has changed the name, this method returns the same as
+        * Name().
+        * @since 3.1
+        * @return Returns short name of the profile.
+        */
+        virtual const TDesC& ShortName() const = 0;
+
+        /**
+        * Returns the name of the profile to be used in navi pane (that is,
+        * the localised string has correct layout for navi pane). If user has
+        * changed the name, this method returns the same as Name().
+        * @since 3.2
+        * @return Returns navi name of the profile.
+        */
+        virtual const TDesC& NaviName() const = 0;
+
+        /**
+        * Returns the name of the profile to be used in title pane (that is,
+        * the localised string has correct layout for title pane). If user has
+        * changed the name, this method returns the same as Name().
+        * @since 3.2
+        * @return Returns title name of the profile.
+        */
+        virtual const TDesC& TitleName() const = 0;
+    };
+
+#endif      // __MPROFILENAME_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfilePresence.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile presence interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEPRESENCE_H
+#define __MPROFILEPRESENCE_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Profile presence interface.
+*  This interface offers methods to get status message and
+*  availability attribute.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfilePresence
+    {
+    protected:  // Destructor
+
+        virtual ~MProfilePresence() {};
+
+    public: // New functions
+
+        /**
+        * Return status message of the profile.
+        * @since 2.1
+        * @return Status message of the profile.
+        */
+        virtual const TDesC& StatusMessage() const = 0;
+
+        /**
+        * Return availability attribute of the profile.
+        * @since 2.1
+        * @return Return availability attribute of the profile.
+        */
+        virtual TUint32 AvailabilityAttribute() const = 0;
+
+    };
+
+#endif      // __MPROFILEPRESENCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfilePttSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile PTT settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILEPTTSETTINGS_H
+#define MPROFILEPTTSETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+#include <ProfileInternal.hrh>
+
+// CLASS DECLARATION
+
+/**
+*  Profile PTT settings interface.
+*  @since 3.1
+*/
+class MProfilePttSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfilePttSettings() {};
+
+    public: // New functions
+
+        /**
+        * Returns PTT ringing tone file name.
+        * @since 3.1
+        * @return Returns PTT ringing tone file name.
+        */
+        virtual const TDesC& PttRingingTone() const = 0;
+
+        /**
+         * Returns PTT status of the profile.
+         * @since 3.1
+         * @return Returns PTT status of the profile.
+         */
+        virtual TProfilePttStatus PttStatus() const = 0;
+
+    };
+
+#endif      //  MPROFILEPTTSETTINGS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSet3DToneSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile set 3D tone settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESET3DTONESETTINGS_H
+#define MPROFILESET3DTONESETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Profile set 3D tone settings interface.
+*  @since 3.1
+*/
+class MProfileSet3DToneSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSet3DToneSettings() {};
+
+    public: // New functions
+
+        /**
+        * Set 3D tone effect of the profile.
+        * @since 3.1
+        */
+        virtual void SetEffect( TProfile3DToneEffect aEffect ) = 0;
+
+        /**
+         * Set 3D tone echo of the profile.
+         * @since 3.1
+         */
+        virtual void SetEcho( TProfile3DToneEcho aEcho ) = 0;
+
+    };
+
+#endif      //  MPROFILESET3DTONESETTINGS_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetExtraSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESETEXTRASETTINGS_H
+#define MPROFILESETEXTRASETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProfileSetPttSettings;
+class MProfileSetFeedbackSettings;
+class MProfileSet3DToneSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Interface for modifying Profiles extra settings.
+*  @since 3.1
+*/
+class MProfileSetExtraSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetExtraSettings() {};
+
+    public: // New functions
+
+        /**
+         * Returns set profile ptt settings interface.
+         * @return set profile ptt settings interface.
+         * @since 3.1
+         */
+        virtual MProfileSetPttSettings& ProfileSetPttSettings() const = 0;
+
+        /**
+         * Returns set profile feedback settings interface.
+         * @return set profile feedback settings interface.
+         * @since 5.0
+         */
+        virtual MProfileSetFeedbackSettings& ProfileSetFeedbackSettings() const = 0;
+
+        /**
+         * Returns set profile 3D tone settings interface.
+         * @return set profile 3D tone settings interface.
+         * @since 3.1
+         */
+        virtual MProfileSet3DToneSettings& ProfileSet3DToneSettings() const = 0;
+
+    };
+
+#endif      //  MPROFILESETEXTRASETTINGS_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetExtraTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set profile extra tones interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETEXTRATONES_H
+#define __MPROFILESETEXTRATONES_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Set profile extra tones interface.
+*  This interface offers methods to set IM message alert tone file name.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetExtraTones
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetExtraTones() {};
+
+    public: // New functions
+
+        /**
+        * Set IM message alert tone file name.
+        * @since 2.0
+        * @param aIMMessageAlertTone IM message alert tone.
+        */
+        virtual void SetIMMessageAlertToneL(
+            const TDesC& aIMMessageAlertTone ) = 0;
+
+        /**
+        * Set Email alert tone file name.
+        * @since 2.0
+        * @param aEmailAlertTone Email alert tone.
+        */
+        virtual void SetEmailAlertToneL(
+            const TDesC& aEmailAlertTone ) = 0;
+
+        /**
+        * Set Video call ringing tone file name.
+        * @since 2.6
+        * @param aRingingTone Video call ringing tone file name.
+        */
+        virtual void SetVideoCallRingingToneL(
+            const TDesC& aRingingTone ) = 0;
+
+    };
+
+
+#endif      // __MPROFILESETEXTRATONES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetFeedbackSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile set feedback settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESETFEEDBACKSETTINGS_H
+#define MPROFILESETFEEDBACKSETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Profile set feedback settings interface.
+*  @since 5.0
+*/
+class MProfileSetFeedbackSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetFeedbackSettings() {};
+
+    public: // New functions
+
+        /**
+        * Set tactile feedback of the profile.
+        * @since 5.0
+        */
+        virtual void SetTactileFeedback( TProfileTactileFeedback aTactileFeedback ) = 0;
+
+        /**
+         * Set audio feedback of the profile.
+         * @since 5.0
+         */
+        virtual void SetAudioFeedback( TProfileAudioFeedback aAudioFeedback ) = 0;
+
+    };
+
+#endif      //  MPROFILESETFEEDBACKSETTINGS_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetName.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set profile name interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETNAME_H
+#define __MPROFILESETNAME_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Set profile name interface.
+*  This interface offers method to set profile name.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetName
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetName() {};
+
+    public: // New functions
+
+        /**
+        * Set name of the profile.
+        * @since 2.0
+        * @param aName Name of the profile.
+        */
+        virtual void SetNameL( const TDesC& aName ) = 0;
+
+    };
+
+#endif      // __MPROFILESETNAME_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetPresence.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set profile presence settings interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETPRESENCE_H
+#define __MPROFILESETPRESENCE_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Set profile presence settings interface.
+*  This interface offers methods to set profile status message and
+*  availability attribute.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetPresence
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetPresence() {};
+
+    public: // New functions
+
+        /**
+        * Set status message of the profile.
+        * @since 2.0
+        * @param aStatusMessage status message of the profile.
+        */
+        virtual void SetStatusMessageL( const TDesC& aStatusMessage ) = 0;
+
+        /**
+        * Set availability attribute of the profile.
+        * @since 2.0
+        * @param aAvailabilityAttribute Availability attribute of the profile.
+        */
+        virtual void SetAvailabilityAttribute(
+            const TUint32 aAvailabilityAttribute ) = 0;
+    };
+
+#endif      // __MPROFILESETPRESENCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetPttSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile set PTT settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESETPTTSETTINGS_H
+#define MPROFILESETPTTSETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Profile set PTT settings interface.
+*  @since 3.1
+*/
+class MProfileSetPttSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetPttSettings() {};
+
+    public: // New functions
+
+        /**
+        * Set PTT ringing tone file name.
+        * @since 3.1
+        */
+        virtual void SetPttRingingToneL( const TDesC& aPttRingingTone ) = 0;
+
+        /**
+         * Set PTT status of the profile.
+         * @since 3.1
+         */
+        virtual void SetPttStatus( TProfilePttStatus aPttStatus ) = 0;
+
+    };
+
+#endif      //  MPROFILESETPTTSETTINGS_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set tone settings interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETTONES_H
+#define __MPROFILESETTONES_H
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+struct TProfileToneSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Set tone settings interface.
+*  This interface offers methods to set line 1 and 2 ringing tone,
+*  message alert tone and tone settings.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetTones
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetTones() {};
+
+    public: // New functions
+
+        /**
+        * Set line 1 ringing tone.
+        * @since 2.0
+        * @param aRingingTone File name of the ringing tone.
+        */
+        virtual void SetRingingTone1L( const TDesC& aRingingTone ) = 0;
+
+        /**
+        * Set line 2 ringing tone.
+        * @since 2.0
+        * @param aRingingTone File name of the ringing tone.
+        */
+        virtual void SetRingingTone2L( const TDesC& aRingingTone ) = 0;
+
+        /**
+        * Set message alert tone.
+        * @since 2.0
+        * @param aMessageAlertTone File name of the message alert tone.
+        */
+        virtual void SetMessageAlertToneL(
+            const TDesC& aMessageAlertTone ) = 0;
+
+        /**
+        * Set tone settings of the profile.
+        * @since 2.0
+        * @return Tone settings structure.
+        */
+        virtual TProfileToneSettings& SetToneSettings() = 0;
+
+    };
+
+#endif      // __MPROFILESETTONES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile tones interface.
+*
+*/
+
+
+
+#ifndef __MPROFILETONES_H
+#define __MPROFILETONES_H
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+struct TProfileToneSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Profile tones interface.
+*  This interface offers methods to get line 1 and 2 ringing tone,
+*  message alert tone and tone settings.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileTones
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileTones() {};
+
+    public:
+
+        /**
+        * Returns line 1 ringing tone file name.
+        * @since 2.0
+        * @return Returns line 1 ringing tone file name.
+        */
+        virtual const TDesC& RingingTone1() const = 0;
+
+        /**
+        * Returns line 2 ringing tone file name.
+        * @since 2.0
+        * @return Returns line 2 ringing tone file name.
+        */
+        virtual const TDesC& RingingTone2() const = 0;
+
+        /**
+        * Returns message alert tone file name.
+        * @since 2.0
+        * @return Returns message alert tone file name.
+        */
+        virtual const TDesC& MessageAlertTone() const = 0;
+
+        /**
+        * Returns tone settings structure.
+        * @since 2.0
+        * @return Returns tone settings structure.
+        */
+        virtual const TProfileToneSettings& ToneSettings() const = 0;
+    };
+
+#endif      // __MPROFILETONES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfileUtilitySingleton.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile Utility interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEUTILITYSINGLETON_H__
+#define __MPROFILEUTILITYSINGLETON_H__
+
+//  INCLUDES
+
+// FORWARD DECLARATIONS
+class MProfileUtilitySingleton;
+class MProfilesLocalFeatures;
+
+// FUNCTION PROTOTYPES
+/**
+* Return reference to MProfileUtilitySingleton instance. Create it if
+* necessary. For each succesful InstanceL() call there must be a corres-
+* ponding Release() call, so that the internal reference counting works.
+* @since 3.2
+* @return Reference to the only MProfileUtilitySingleton instance.
+*/
+IMPORT_C MProfileUtilitySingleton& ProfileUtilityInstanceL();
+
+/**
+* Release the resources of MProfileUtilitySingleton (when there are no
+* references to it anymore). For each succesful InstanceL() call there
+* must be a corresponding Release() call, so that the internal
+* reference counting works.
+* @since 3.2
+*/
+IMPORT_C void ReleaseProfileUtility();
+
+
+// CLASS DECLARATION
+/**
+*  Profile utility class.
+*
+*  @lib profileeng.lib
+*  @since 3.2
+*/
+class MProfileUtilitySingleton
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileUtilitySingleton() {};
+
+    public: // New functions
+
+        /**
+        * Returns a reference to MProfilesLocalFeatures instance owned by
+        * this MProfileUtility instance.
+        * @since 3.2
+        */
+        virtual MProfilesLocalFeatures& ProfilesLocalFeatures() = 0;
+
+    };
+
+#endif      // __MPROFILEUTILITYSINGLETON_H__
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfilesLocalFeatures.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for locally variated features of Profiles.
+*
+*/
+
+
+
+#ifndef __MPROFILESLOCALFEATURES_H__
+#define __MPROFILESLOCALFEATURES_H__
+
+// CLASS DECLARATION
+
+/**
+*  Profiles local feature variation interface.
+*  MProfilesLocalFeatures offers simple interface to get locally variated
+*  features of Profiles.
+*  How to use:
+*  Get local features object with MProfileEngineExtended::LocalFeaturesL().
+*     MProfilesLocalFeatures& features = iProfileEngine->LocalFeatures();
+*  Check whether a feature is supported (use the ID:s defined in
+*  ProfilesVariant.hrh):
+*     if( features.IsFeatureSupported( KFeatureIdSomeFeature ) )
+*         {
+*         // do stuff
+*         }
+*
+*  @lib N/A
+*  @since 2.6
+*/
+class MProfilesLocalFeatures
+    {
+    protected:  // Destructor
+
+        virtual ~MProfilesLocalFeatures() {};
+
+    public: // New functions
+
+        /**
+        * Checks if the given feature is supported or not.
+        * @since 2.6
+        * @return ETrue if the feature is supported, EFalse otherwise.
+        */
+        virtual TBool IsFeatureSupported( TInt aFeatureId ) const = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from using as
+         * an alert tone.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked, EFalse otherwise.
+         */
+        virtual TBool IsBlockedType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from using as
+         * an alert tone if the alert tone file of the type is unprotected.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked if the alert tone file is
+         *         unprotected, EFalse otherwise.
+         */
+        virtual TBool IsBlockedUnprotectedType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from using as
+         * an alert tone if the alert tone file of the type is protected.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked if the alert tone file is
+         *         protected, EFalse otherwise.
+         */
+        virtual TBool IsBlockedProtectedType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from demo
+         * playing.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked from demo-playing,
+         *         EFalse otherwise.
+         */
+        virtual TBool IsBlockedDemoPlayType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly excluded from the tone
+         * selection list. Also when tried to be set as alert tones through
+         * other means, should behave as the tone would be in blocked type list.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is excluded from the tone selection
+         *         list, EFalse otherwise.
+         */
+        virtual TBool IsExcludedType( const TDesC& aMimeType ) = 0;
+    };
+
+#endif      //  __MPROFILESLOCALFEATURES_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/MProfilesNamesArray.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile names array interface.
+*
+*/
+
+
+
+#ifndef MPROFILESNAMESARRAY_H
+#define MPROFILESNAMESARRAY_H
+
+//  INCLUDES
+#include <bamdesca.h> // MDesCArray
+
+// FORWARD DECLARATIONS
+class MProfileName;
+
+// CLASS DECLARATION
+
+/**
+*  Profile names array interface.
+*
+*  How to use:
+*  Get profile names array with MProfileEngine::ProfilesNamesArrayLC().
+*      MProfilesNamesArray* nameArray = iProfileEngine->ProfilesNamesArrayLC();
+*
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfilesNamesArray : public MDesCArray
+    {
+    public: // New functions
+
+        /**
+        * Return pointer of the profile name interface.
+        * @since 2.0
+        * @param aIndex index of the profile.
+        * @return Return pointer of the profile name interface.
+        *         Pointer is NULL if profile doesn't found.
+        */
+        virtual const MProfileName* ProfileName( TInt aIndex ) const = 0;
+
+        /**
+        * Find profile index by ID of the profile.
+        * @since 2.0
+        * @param aId ID of the profile.
+        * @return Return index of the profile. KErrNotFound if
+        *         profile doesn't found.
+        */
+        virtual TInt FindById( TInt aId ) const = 0;
+
+        /**
+        * Find profile index by name of the profile.
+        * @since 2.0
+        * @param aProfileName name of the profile.
+        * @return Return index of the profile. KErrNotFound if
+        *         profile doesn't found.
+        */
+        virtual TInt FindByName( const TDesC& aProfileName ) const = 0;
+
+    };
+
+#endif      // MPROFILESNAMESARRAY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEng.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine enumeration TProfileSettingKeyType
+*		and TProfileSettingId.
+*
+*/
+
+
+#ifndef __PROFILEENG_HRH__
+#define __PROFILEENG_HRH__
+
+#define PROFILES_ENGINE_RESOURCE_SIGNATURE 75
+#define PROFILES_MAX_NAME_LENGTH           64
+#define PROFILES_MAX_STATUS_MSG_LENGTH     40
+#define PROFILES_MAX_CALL_OBJECT_TEXT_LENGTH 1000
+
+// DATA TYPES
+enum TProfileSettingKeyType
+    {
+    EProfileSettingKeyTypeInt = 0,
+    EProfileSettingKeyTypeString = 1,
+    EProfileSettingKeyTypeBin = 2,
+    EProfileSettingKeyTypeReal = 3
+    };
+
+enum TProfileSettingId
+    {
+    EProfileSettingIdModifiableFlags = 0x00000000,
+    EProfileSettingIdVisibleFlags = 0x00000001,
+    EProfileSettingIdProfileName = 0x00000002,
+    EProfileSettingIdAlertForGroups = 0x00000003,
+    EProfileSettingIdRingingTone = 0x00000004,
+    EProfileSettingIdRingingTone2 = 0x00000005,
+    EProfileSettingIdMsgTone = 0x00000006,
+    EProfileSettingIdRingingType = 0x00000007,
+    EProfileSettingIdKeypadVolume = 0x00000008,
+    EProfileSettingIdRingingVolume = 0x00000009,
+    EProfileSettingIdVibra = 0x0000000A,
+    EProfileSettingIdWarnAndGameTones = 0x0000000B,
+    EProfileSettingIdImTone = 0x0000000C,
+    EProfileSettingIdEmailTone = 0x0000000D,
+    EProfileSettingIdVideoCallTone = 0x0000000E,
+    EProfileSettingIdStatusMsg = 0x0000000F,
+    EProfileSettingIdAvailAttribute = 0x00000010,
+    EProfileSettingIdMediaVolume = 0x00000011,
+    EProfileSettingIdTextToSpeechTone = 0x00000012,
+    EProfileSettingIdNameChanged = 0x00000013,
+    EProfileSettingIdCallObjectContent = 0x00000014,
+    EProfileSettingIdPttTone = 0x00000015,
+    EProfileSettingIdPttStatus = 0x00000016,
+    EProfileSettingId3DEffect = 0x00000017,
+    EProfileSettingId3DEcho = 0x00000018,
+    EProfileSettingIdTactileFeedback = 0x00000019,
+    EProfileSettingIdAudioFeedback = 0x0000001A
+    };
+
+#endif // __PROFILEENG_HRH__
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEng.rh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine resource structures.
+*
+*/
+
+
+//  STRUCTURE DEFINITIONS
+
+// -----------------------------------------------------------------------------
+// DEFAULT_PROFILES
+// Default profiles
+// -----------------------------------------------------------------------------
+//
+STRUCT DEFAULT_PROFILES
+    {
+    STRUCT items[];
+    }
+
+// -----------------------------------------------------------------------------
+// PROFILE
+// profile default name and ID
+// -----------------------------------------------------------------------------
+//
+STRUCT PROFILE
+    {
+    LONG id = 0;
+    LTEXT name = "";
+    LTEXT shortname = "";
+    LTEXT naviname = "";
+    LTEXT titlename = "";
+    }
+
+// -----------------------------------------------------------------------------
+// PROFILE_SETTINGS
+// Profile settings
+// -----------------------------------------------------------------------------
+//
+STRUCT PROFILE_SETTINGS
+    {
+    STRUCT items[];
+    }
+
+// -----------------------------------------------------------------------------
+// PROFILE SETTING
+// profile setting for dynamic profiles
+// -----------------------------------------------------------------------------
+//
+STRUCT PROFILE_SETTING
+    {
+    LONG id = 0;
+    LONG key_type = 0;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineConstants.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine constants
+*
+*/
+
+
+
+#ifndef PROFILEENGINECONSTANTS_H
+#define PROFILEENGINECONSTANTS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "ProfileEng.hrh"
+
+// CONSTANTS
+const TInt KProfileFileEstimationSize( 400 );
+const TInt KProfilesMaxNumberOfDynamicProfiles( 20 );
+const TInt KProfilesMaxTIntLength( 11 );
+const TInt KProfileMaxNameLength( PROFILES_MAX_NAME_LENGTH );
+const TInt KProfileMaxCallObjectTextLength( 1000 );
+const TInt KProfileBaseDynamicProfileId( 30 );    // first dynamic profile ID
+// Used for profile settings cenrep-keys - profile id is encoded in the MSB:
+const TInt KProfileIdShift( 24 );    
+
+_LIT( KProfileDriveC,           "c:" );
+_LIT( KProfileDriveZ,           "z:" );
+_LIT( KProfileFilePrefix,       "Profile" );
+_LIT( KProfileFileExtension,    ".dat" );
+_LIT( KProfileFilePath,         "\\System\\Data\\Profiles\\" );
+_LIT( KProfileEngineResourceDriveAndDir, "Z:ProfileEng.rsc" );
+_LIT( KProfileMutexName,        "ProfileFileAccessMutexName" );
+
+#endif      // PROFILEENGINECONSTANTS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineDomainCRKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine domain Central Repository keys.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEDOMAINCRKEYS_H
+#define PROFILEENGINEDOMAINCRKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+// CONSTANTS
+
+/**
+ * Default ringing tone for all profiles. String value. Read-only.
+ * This ringing tone is used if some error condition prevents using the user-set
+ * ringing tone for alerting of incoming call.
+ *
+ * Central Repository file of the key: KCRUidProfileEngine.
+ *
+ */
+const TUint32 KProEngDefaultRingingTone = 0x7F000004;
+
+/**
+ * Default message alert tone for all profiles. String value. Read-only.
+ * This alert tone is used if some error condition prevents using the user-set
+ * alert tone for alerting of incoming message.
+ *
+ * Central Repository file of the key: KCRUidProfileEngine.
+ *
+ */
+const TUint32 KProEngDefaultMessageTone = 0x7F000006;
+
+/**
+ * Default Instant Message alert tone for all profiles. String value. Read-only.
+ * @deprecated IM does not use Profiles-dependent alert tone anymore.
+ *
+ * Central Repository file of the key: KCRUidProfileEngine.
+ *
+ */
+const TUint32 KProEngDefaultImTone = 0x7F00000C;
+
+/**
+ * This integer indicates the maximum file size (kilo bytes) of ring tone
+ * files that can be selected as voice call ringing tone.
+ *
+ * Central Repository file of the key: KCRUidProfileEngine.
+ *
+ * Possible values:
+ *
+ * 0   switches off file size checking. I.e. then all files can be selected.
+ * >0  max size. For example 100 would set the maximum file size as 100 kB.
+ *
+ */
+const TUint32 KProEngRingingToneMaxSize = 0x80000103;
+
+
+
+/**
+ * Profiles local variation CR file.
+ */
+const TUid KCRUidProfilesLV = {0x101F8799};
+
+/**
+ * Standard bitmask type of key used for local variation of Profiles.
+ * One bit is used to control one feature. If the bit is on (= 1) the feature
+ * is enabled and if the bit is off the feature is off.
+ * The meaning of each bit are defined in ProfilesVariant.hrh.
+ *
+ * Central Repository file of the key: KCRUidProfilesLV.
+ *
+ * Integer value.
+ *
+ * @since 3.0
+ *
+ * Default values:
+ * S60 3.1: 1 (KProEngFeatureIdVTRingingTone enabled)
+ * S60 3.2: 1
+ * S60 4.0: 1
+ */
+const TUint32 KProfilesLVFlags             = 0x00000000;
+
+/**
+ * Standard bitmask type of key used for local variation of Profiles Tones View
+ * (in General Settings). One bit is used to control one feature. If the bit is
+ * on (= 1) the feature is enabled and if the bit is off the feature is off.
+ * The meanings for each bit used are defined in the end of this file.
+ *
+ * Central Repository file of the key: KCRUidProfilesLV.
+ *
+ * Integer value.
+ *
+ * @since 3.1
+ *
+ * Default values:
+ * S60 3.1: 0 (KTonesViewFeatureIdHac disabled)
+ * S60 3.2: 1 (KTonesViewFeatureIdHac enabled)
+ */
+const TUint32 KProEngTonesViewLVFlags = 0x00000001;
+
+/**
+ * This key defines the set of MIME-types that are not allowed as alert tones.
+ * When the user is trying to set an alert tone, this list must be checked
+ * first before the following 2 lists and act accordingly. Trying to set a tone
+ * of a type given in this list as alert tone should result in an error note: 
+ * "Not allowed" or similar.
+ *
+ * Central Repository file of the key: KCRUidProfilesLV.
+ *
+ * String value.
+ *
+ * Possible values: space separated list of MIME-types to be blocked.
+ *
+ * Default value:""
+ */
+const TUint32 KProEngBlockedTones = 0x00000002;
+
+/**
+ * This key defines the set of MIME-types that are not allowed as alert tones
+ * if the tone file in question is NOT DRM protected. Trying to set a tone of
+ * a type given in this list as alert tone should result in an error note:
+ * "Unprotected file. Cannot be selected as ringing tone." or similar.
+ * Note, if a MIME-type is already included in KProEngBlockedTones, it should
+ * not have to be included in this list.
+ *
+ * Central Repository file of the key: KCRUidProfilesLV.
+ *
+ * String value.
+ *
+ * Possible values: space separated list of MIME-types to be blocked.
+ *
+ * Default value:""
+ */
+const TUint32 KProEngBlockedUnprotectedTones = 0x00000003;
+
+/**
+ * This key defines the set of MIME-types that are not allowed as alert tones
+ * if the tone file in question IS DRM protected. Trying to set a tone of a
+ * type given in this list as alert tone should result in an error note:
+ * "Protected file. Cannot be selected as ringing tone." or similar.
+ * Note, if a MIME-type is already included in KProEngBlockedTones, it should
+ * not have to be included in this list.
+ *
+ * Central Repository file of the key: KCRUidProfilesLV.
+ *
+ * String value.
+ *
+ * Possible values: space separated list of MIME-types to be blocked.
+ *
+ * Default value:""
+ */
+const TUint32 KProEngBlockedProtectedTones = 0x00000004;
+
+/**
+ * This key defines the set of MIME-types that are not allowed to be demo-played
+ * in Tone Selection dialog.
+ *
+ * Central Repository file of the key: KCRUidProfilesLV.
+ *
+ * String value.
+ *
+ * Possible values: space separated list of MIME-types to be blocked. If the
+ * list is empty, the demo-play of tones are not blocked at all (if the MIME
+ * type is otherwise supported by MMF).
+ */
+const TUint32 KProEngBlockedDemoPlayTones = 0x00000005;
+
+/**
+ * This key defines the set of MIME-types that are to be excluded from the list
+ * of tones in Tone Selection dialog. If the attempt to set the tone is carried
+ * out by other means than using Tone Selection dialog, the behaviour will be
+ * the same as with the tones in KProEngBlockedTones list.
+ *
+ * Central Repository file of the key: KCRUidProfilesLV.
+ *
+ * String value.
+ *
+ * Possible values: space separated list of MIME-types to be excluded/blocked.
+ * If the list is empty, the demo-play of tones are not excluded at all (if the
+ * MIME type is otherwise supported by MMF).
+ */
+const TUint32 KProEngExcludedTones = 0x00000006;
+
+
+//
+// Bit definitions for KProEngTonesViewLVFlags
+//
+
+/**
+ * This bit indicates whether HAC hearing aid compatibility support for 
+ * size architecture feature is enabled.
+ * @since 3.1
+ */
+const TUint32 KTonesViewFeatureIdHac = 0x00000001;
+
+#endif      // PROFILEENGINEDOMAINCRKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineDomainConstants.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine constants for S60 applications to use.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEDOMAINCONSTANTS_H
+#define PROFILEENGINEDOMAINCONSTANTS_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+/**
+ * The tone to be used when an "Off" tone is needed for an alert tone. With
+ * this tone the vibra can be played even if no sound is heard. This file is
+ * exported by Profiles Engine and it will always be located in ROM, so this
+ * value must be appended to the ROM-drive letter, for example like this:
+ * @code
+ * TFileName* tf = new ( ELeave ) TFileName(
+ *         TParsePtrC( PathInfo::RomRootPath() ).Drive() );
+ * CleanupStack::PushL( tf );
+ * tf->Append( KProfileNoSoundPath );
+ * @endcode
+ */
+_LIT( KProfileNoSoundPath, "\\resource\\No_Sound.wav" );
+
+#endif      // PROFILEENGINEDOMAINCONSTANTS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineInternalCRKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine internal Central Repository keys.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEINTERNALCRKEYS_H
+#define PROFILEENGINEINTERNALCRKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <ProfileEngineDomainCRKeys.h>
+
+// CONSTANTS
+
+/**
+ * Information about whether self recorded tones can be used as ringing tones
+ * or not. Integer value.
+ *
+ * Possible values:
+ *
+ * 0 (disabled)
+ * 1 (enabled)
+ */
+const TUint32 KProEngRecordedRingingTones = 0x80000100;
+
+/**
+ * If this is true, DRM protected MP4 tones are not allowed as ringing tones.
+ *
+ * Possible values:
+ *
+ * 0 (allowed, default)
+ * 1 (not allowed)
+ */
+const TUint32 KProEngNoDrmMP4RingingTones = 0x80000101;
+
+/**
+ * If this is true, WMA tones are not allowed as ringing tones.
+ *
+ * Possible values:
+ *
+ * 0 (allowed, default)
+ * 1 (not allowed)
+ */
+const TUint32 KProEngNoWmaRingingTones = 0x80000102;
+
+/**
+ * Tactile feedback setting for the currently active profile.
+ * THIS COULD BE MOVED TO THE SDK HEADER LATER?
+ *
+ * Possible values:
+ *
+ * 0 (Off)
+ * 1 (Level 1)
+ * 2 (Level 2)
+ * 3 (Level 3)
+ */
+const TUint32 KProEngActiveTactileFeedback = 0x7E000019;
+
+/**
+ * Audio feedback setting for the currently active profile.
+ * THIS COULD BE MOVED TO THE SDK HEADER LATER?
+ *
+ * Possible values:
+ *
+ * 0 (Off)
+ * 1 (Level 1)
+ * 2 (Level 2)
+ * 3 (Level 3)
+ */
+const TUint32 KProEngActiveAudioFeedback = 0x7E00001A;
+
+
+#endif      // PROFILEENGINEINTERNALCRKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineInternalPSKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine internal Publish & Subscribe keys.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEINTERNALPSKEYS_H
+#define PROFILEENGINEINTERNALPSKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+const TUid KPSUidProfileEngine = {0x101F879F};
+
+#endif      // PROFILEENGINEINTERNALPSKEYS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEnginePrivatePSKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine internal Publish & Subscribe keys.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEPRIVATEPSKEYS_H
+#define PROFILEENGINEPRIVATEPSKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "ProfileEngineInternalPSKeys.h"
+
+// CONSTANTS
+
+/**
+ * A setting in the current active profile was modified. This is used
+ * internally by Profiles Engine notification mechanism.
+ * Default value: 0.
+ */
+const TUint32 KProEngActiveProfileModified = 0x7D000001;
+
+/**
+ * The current active profile has changed (or the active profile has been
+ * reactivated). This is used internally by Profiles Engine notification
+ * mechanism.
+ * Default value: 0.
+ */
+const TUint32 KProEngActiveProfileChanged = 0x7D000002;
+
+/**
+ * Power save mode has changed.
+ * This is used internally by Profiles Engine.
+ * Default value: 0.
+ */
+const TUint32 KProEngPsmChanged = 0x7D000003;
+
+#endif      // PROFILEENGINEPRIVATEPSKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileInternal.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine enumeration TProfilePttStatus
+*
+*/
+
+
+#ifndef PROFILEINTERNAL_HRH
+#define PROFILEINTERNAL_HRH
+
+// DATA TYPES
+enum TProfilePttStatus
+    {
+    EProfilePttActive = 0,
+    EProfilePttSilent = 1,
+    EProfilePttDoNotDisturb = 2
+    };
+
+enum TProfileTactileFeedback
+    {
+    EProfileTactileFeedbackOff		= 0,
+    EProfileTactileFeedbackLevel1	= 1,
+    EProfileTactileFeedbackLevel2	= 2,
+    EProfileTactileFeedbackLevel3	= 3
+    };
+
+enum TProfileAudioFeedback
+    {
+    EProfileAudioFeedbackOff		= 0,
+    EProfileAudioFeedbackLevel1		= 1,
+    EProfileAudioFeedbackLevel2		= 2,
+    EProfileAudioFeedbackLevel3		= 3
+    };
+
+enum TProfile3DToneEffect
+    {
+    EProfile3DEffectOff                 = 0,
+    EProfile3DEffectCircle              = 1,
+    EProfile3DEffectFlyby               = 2,
+    EProfile3DEffectZigZag              = 3,
+    EProfile3DEffectRandomWalk          = 4,
+    EProfile3DEffectChaos               = 5,
+    EProfile3DEffectStereoWidening      = 6
+    };
+
+// The magic numbers come from CEnvironmentalReverbUtility, although they are
+// not documented anywhere:
+enum TProfile3DToneEcho
+    {
+    EProfile3DEchoOff           = 0,
+    EProfile3DEchoLivingRoom    = 14,
+    EProfile3DEchoCave          = 5,
+    EProfile3DEchoStoneCorridor = 26,
+    EProfile3DEchoForest        = 8,
+    EProfile3DEchoSewerPipe     = 24,
+    EProfile3DEchoUnderwater    = 28
+    };
+
+#endif // PROFILEINTERNAL_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfilesVariant.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles subsystem local variation
+*
+*  The file contains values for Central Repository keys specifying
+*  Profiles specific software settings. 
+*
+*
+*/
+
+
+
+#ifndef PROFILESVARIANT_HRH
+#define PROFILESVARIANT_HRH
+
+
+/**
+* User's guide to Profiles variation:
+* Central Repository file: KCRUidProfilesLV (101F8799.txt)
+* How to use: 
+*     CRepository* cenrep = CRepository::NewLC( KCRUidProfilesLV );
+*     // if value fetch fails, assume all variated features are off:
+*     TInt featureBitmask( 0 );
+*     cenrep->Get( KProfilesLVFlags, featureBitmask );
+* 
+*     //
+*     // Get the value once and save it for later use.
+*     // No need to access Central Repository every time when a value is needed
+* 
+*     if  ( featureBitmask & KProEngFeatureXxx )
+*         {
+*         // This feature is ON, so act accordingly
+*         }
+*/
+
+
+
+/**
+* If KProEngFeatureIdVTRingingTone is on, Profiles supports setting of a
+* dedicated ringing tone for a video call.
+*/
+#define KProEngFeatureIdVTRingingTone 0x01
+
+/**
+ * If KProEngFeatureIdForceSilentMode is enabled, no other sounds than the
+ * camera shutter and video recorder start tones can be heard in silent
+ * profile. Also the tone settings of the silent profile will be hidden.
+ */
+#define KProEngFeatureIdForceSilentMode 0x02
+
+/**
+ * If KProEngFeatureIdTimedProfiles is enabled, Profiles supports timed
+ * profiles.
+ */
+#define KProEngFeatureIdTimedProfiles 0x04
+
+/**
+ * If KProEngFeatureIdTTSRingingTone is enabled, Profiles supports
+ * text-to-speech feature (aka "Say caller's name").
+ * Feature dependency to __SIND (Speaker Independent Name Dialing).
+ * Must be disabled when SIND is disabled.
+ */
+#define KProEngFeatureIdTTSRingingTone 0x08
+
+#endif // PROFILESVARIANT_HRH
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/SecondaryDisplayProfilesAPI.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The set of messages provided to Secondary Display software by
+*              : Profiles subsystem.
+*
+*/
+
+#ifndef __SECONDARYDISPLAYPROFILESAPI_H
+#define __SECONDARYDISPLAYPROFILESAPI_H
+
+// INCLUDES
+#include <e32base.h>
+
+/*
+* ==============================================================================
+* This file contains the following sections:
+*   - Dialog definitions
+*   - Command definitions
+*   - Event definitions
+*   - Parameter definitions
+* ==============================================================================
+*/
+
+// The category UID for the messages in this header file.
+//
+const TUid KCatProfiles = {0x2000B471}; 
+
+/*
+* ==============================================================================
+* Dialogs shown by Profiles subsystem. These messages are handled using the
+* Secondary Display support in Avkon.
+* ==============================================================================
+*/
+enum TSecondaryDisplayProfilesDialogs
+    {
+    /**
+    * No note. Error condition if this comes to CoverUI
+    */
+    ECmdNoNoteProfiles = 0,
+    
+    /**
+    * A command for showing the "Timed profile expired" note on secondary display.
+    */
+    ECmdShowTimedProfileExpiryNote,
+ 
+    };
+#endif      // __SECONDARYDISPLAYPROFILESAPI_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile tone settings structure.
+*
+*/
+
+
+
+#ifndef __TPROFILETONESETTINGS_H
+#define __TPROFILETONESETTINGS_H
+
+// INCLUDES
+#include <Profile.hrh>
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Profile tone settings structure.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+struct TProfileToneSettings
+    {
+    TProfileRingingType  iRingingType;
+    TProfileKeypadVolume iKeypadVolume;
+    TInt                 iRingingVolume;         // 1 - 10
+    TBool                iVibratingAlert;        // ETrue = On
+    TBool                iEmailVibratingAlert;
+    TBool                iWarningAndGameTones;   // ETrue = On
+    TInt                 iMediaVolume;           // 1 - 10
+    TBool                iTextToSpeech;          // ETrue = On
+    };
+
+#endif      // __TPROFILETONESETTINGS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/profiles_engine_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,20 @@
+<?xml version="1.0" ?>
+<api id="7cd90304c0aac4ddc7309afb22964708" dataversion="2.0">
+  <name>Profiles Engine API</name>
+  <description>For creating Profiles Engine, getting the active profile,
+getting the profile names and setting the active profile.</description>
+  <type>c++</type>
+  <collection>profilesservices</collection>
+  <libs>
+    <lib name="ProfileEng.lib" />
+    <lib name="ProfileEngine.lib" />
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file provides the information required for building
+*     Profiles Engine API test cases.
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+// Part of EUnit library test
+
+#include "../../../../profilesapplication/Profiles/ProfileEngine/tsrc/public/basic/EngineMdlTest/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_mediafilelist_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                MediaFileList API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/mediafilelist.h     MW_LAYER_PLATFORM_EXPORT_PATH(mediafilelist.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_mediafilelist_api/inc/mediafilelist.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Interface of MediaFileList. Provide some API for 
+*                the user to use mediafilelist
+*
+*/
+
+
+
+
+#ifndef MEDIALFILELIST_H
+#define MEDIALFILELIST_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32file.h>
+
+
+// FORWARD DECLARATIONS
+class CMediaFileDialog;
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Public API for displaying media file list. List is used for 
+*  selecting/previewing audio and video files. 
+* 
+*  @lib mediafilelist.lib
+*  @since Series60_5.1
+*  
+*/
+class CMediaFileList : public CBase
+    {
+    public:
+    enum TMediaFileListAttribute
+        {
+        // max media file size
+        EAttrFileSize = 0,
+        // ringing volume (TProfileRingingVolume from Profile.hrh)
+        EAttrVolume,
+        // ringing type,  (TProfileRingingType from Profile.hrh)
+        EAttrRingingType,
+        // vibra on/off   (Boolean) 
+        EAttrVibra,
+        // 3D effect      (TProfile3DToneEffect from ProfileInternal.hrh)
+        EAttr3DEffect,
+        // 3D echo        (TProfile3DToneEcho from ProfileInternal.hrh)
+        EAttr3DEcho,
+        // excluded mime type text
+        EAttrExcludeMimeType,
+        // for file protection checking
+        EAttrAutomatedType,
+        // media file dialog title
+        EAttrTitle,
+        // excluded folder (see enum TFolderType)
+        EAttrExcludeFolder
+        };
+
+    enum TMediaFileType
+        {
+        EMediaFileTypeAudio = 0,
+        EMediaFileTypeVideo
+        };
+
+    enum TNullItemIcon
+        {
+        ENullItemIconNone = 0,
+        ENullItemIconDefaultTone,
+        ENullItemIconOff
+        };
+
+    enum TFolderType
+        {
+        EFolderDownload = 0,
+        EFolderVideos
+        };
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CMediaFileList* NewL();
+
+        /**
+        * Destructor.
+        */
+	    IMPORT_C virtual ~CMediaFileList();
+
+    private:
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+        CMediaFileList();
+
+    public:
+
+       /**
+        * Shows Media file list.
+        * @since Series60_5.1
+        * @param aFileName Selected media file name full path.
+        * @param aNullItem Selected null item index. Possible values:
+        *        KErrNotFound - item is not null item or Download item
+        *        0 - Download item
+        *        1 - first null item
+        *        2 - second null item
+        *  
+        * @param aInfo Extra information, set to NULL if not used.
+        * @param aDesInfo Extra information, set to KNullDesC if not used.
+        * @return ETrue if user selected media file, EFalse otherwise.
+        */
+	    IMPORT_C TBool ShowMediaFileListL( TDes* aFileName, TInt* aNullItem,
+	                                       TInt* aInfo, TDes* aDesInfo );
+
+        /**
+        * Set Media file list attribute. See enum TMediaFileListAttribute for
+        * list of supported attributes.
+        * @since Series60_5.1
+        * @param aAttr Attribute id. 
+        * @param aValue Attribute value. 
+        * @return None.
+        */
+       	IMPORT_C void SetAttrL( TInt aAttr, TInt aValue );
+
+        /**
+        * Set Media file list attribute. See enum TMediaFileListAttribute for
+        * list of supported attributes.
+        * @since Series60_5.1
+        * @param aAttr Attribute id. 
+        * @param aValue Attribute value. 
+        * @return None.
+        */
+	    IMPORT_C void SetAttrL( TInt aAttr, const TDesC& aValue );
+
+        /**
+        * Set Media file list attribute. Currently not in use.
+        * @since Series60_5.1
+        * @param aAttr Attribute id. 
+        * @param aValue Attribute value. 
+        * @return None.
+        */
+	    IMPORT_C void SetAttrL( TInt aAttr, TAny* aValue );
+
+        /**
+        * Set Media file list null item. Null items are custom list items
+        * that appear at the end of the media file list main view.
+        * @since Series60_5.1
+        * @param aText Null item text.
+        * @param aMediaFile File that is played when null items gets focused.
+        *        Use KNullDesC if not used.
+        * @param aMediaFileType Media file type. See enum TMediaFileType for
+                 supported media types.
+        * @param aIconId Null item icon id. See enum TNullItemIcon for
+                 supported icons.
+        * @return None.
+        */
+	    IMPORT_C void SetNullItemL( const TDesC& aText, const TDesC& aMediaFile,
+	                                TInt aMediaFileType, TInt aIconId );
+
+	
+
+    private:
+		CMediaFileDialog* iDialog;
+    };
+
+
+
+#endif      // MEDIALFILELIST_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/profiles_mediafilelist_api/profiles_mediafilelist_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0" ?>
+<api id="ba251abc91f15265624a4f3f6b9e7838" dataversion="2.0">
+<name>MediaFileList API</name>
+<description>An UI for the media file selection lists.</description>
+<type>c++</type>
+<collection>profilesservices</collection>
+<libs><lib name="MediaFileList.lib"/>
+</libs>
+<release category="platform" sinceversion=""/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_backgroundimage_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   File that exports the files belonging to 
+:                Settings Backgroundimage API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/GsAsyncImageHandling.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsasyncimagehandling.h)
+../inc/BackgroundImage.h     MW_LAYER_PLATFORM_EXPORT_PATH(backgroundimage.h)
+../inc/MGsAsyncImageHandlingObserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(mgsasyncimagehandlingobserver.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_backgroundimage_api/inc/BackgroundImage.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class definition for the background image API
+*
+*/
+
+
+
+
+#ifndef BACKGROUNDIMAGE_H
+#define BACKGROUNDIMAGE_H
+
+//  INCLUDES
+#include    <centralrepository.h>
+#include    <fbs.h>
+
+#include    <RPhCltServer.h>
+#include    "gsasyncimagehandling.h"
+
+
+// CONSTANTS
+const    TInt    KGSBackgroundImageValue = 0;
+
+// DATA TYPES
+enum TGSWallpaperType
+    {
+    EGSWallpaperIdle,
+    EGSWallpaperPinboard,
+    EGSWallpaperWelcome,
+    EGSVTStillImage
+    };
+
+// FORWARD DECLARATIONS
+class RSharedDataClient;
+
+// CLASS DECLARATION
+
+/**
+*  CGSBackgroundImage is the background image API class of GS app.
+*  It provides functions to get and set background image values.
+*/
+class CGSBackgroundImage : public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CGSBackgroundImage* NewL();
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CGSBackgroundImage();
+
+    public: // New functions
+        
+        /**
+        * Returns background image mode.
+        * @return 0: no image
+        *         1: image
+        */
+        IMPORT_C TInt BackgroundImageL();
+
+        /**
+        * Stores background image mode to shared data.
+        * @param aImage Background image mode.
+        */
+        IMPORT_C void SetBackgroundImageL(const TInt aImage);
+
+        /**
+        * Converts an idle background image to bitmap and scales it to fit the
+        * screen if necessary.
+        *
+        * After successful conversion, the background image path is stored
+        * into shared data.
+        *
+        * @param aImagePath Descriptor which contains the background image 
+        *   path. Max length is KGSMaxImagePath.
+        */
+        IMPORT_C void SetBackgroundImagePathL(const TDesC& aImagePath);
+
+				/**
+        * Converts an idle background image to bitmap, scales it to fit the
+        * screen if necessary, and stores it to the given file.
+        *
+        * Background image path is not stored into shared data, but must be
+        * set separately.
+        *
+        * @param aImagePath Descriptor which contains the background image 
+        *   path. Max length is KGSMaxImagePath.
+		    * @param aBmpFileName Descriptor which contains the bitmap file name.
+        *   Converted image is again stored back in this variable.
+        */
+        IMPORT_C void SetBackgroundImagePathL(const TDesC& aImagePath, 
+			                                  TDes& aBmpFileName);
+			                                  
+		/**
+        * Converts the welcome note image to bitmap, scales it to fit the screen if 
+        * necessary. 
+        * Stores the bitmap to mbm file. Stores welcome note image path to shared data. 
+        *
+        * @param aImagePath Descriptor which contains the welcome note image path.
+        *                   Max length is KGSMaxImagePath.
+        */
+        IMPORT_C void SetWelcomeNoteImageL(const TDesC& aImagePath,
+                          CGSAsyncImageHandling& aImgHandler );
+
+
+		    /**
+        * Converts the background image to bitmap, scales it to fit the
+        * screen if necessary, and stores it to the given file.
+        *
+        * Background image path is not stored into shared data, but must be
+        * set separately.
+        *
+        * @since 2.6
+        *
+        * @param aImagePath Descriptor which contains the background image 
+        *   path. Max length is KGSMaxImagePath.
+		    * @param aBmpFileName Descriptor which contains the bitmap file name.
+        *   Converted image is again stored back in this variable.
+        * @param aWallpaperType Type of the wallpaper.
+        */
+        IMPORT_C void SetBackgroundImagePathL(
+            const TDesC& aImagePath, 
+			      TDes& aBmpFileName,
+                  TGSWallpaperType aWallpaperType );
+        
+        /**
+        * Set the current image path for Still Image
+        * 
+        */
+        IMPORT_C void SetVTStillImagePathL( const TDesC& aImagePath,
+                                          CGSAsyncImageHandling& aImgHandler );
+                  
+        /*
+        * Returns if Personalisation application exists in device
+        * @return 1: Personalisation application exists in device
+        *  otherwise: Personalisation application does not exist in device
+        */
+        IMPORT_C TInt GetPlnsStatus();
+        
+        /*
+        * Checking presence of the personalisation application on the
+        * device
+        */
+        IMPORT_C void IsPersonalisationApplicationL();
+
+        /*
+        * Removing image
+        *
+        */
+        IMPORT_C void DeleteImageL( const TDesC& aImagePath );
+        
+       
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CGSBackgroundImage();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+    private:
+      
+        void LoadImageL( const TDesC& aImagePath, 
+                         TInt aWidth, TInt aHeight,
+                         TBool aBgImage, 
+                         TGSWallpaperType aWallpaperType );
+                      
+        void SaveBitmapsL( TDes& aBmpFileName, 
+                           const TDesC& aOriginalFullname );
+    public:     // Data
+        TInt iPlnsInDevice;         //for personalisation app check
+    
+    private:    // Data
+        RSharedDataClient* iClient;  //handle to shared data client
+        CFbsBitmap* iBitmap;        //for scaling/dithering of bitmap
+        
+        CRepository* iPersonalizationRepository;
+        CRepository* iStartupConfRepository;
+        CRepository* iTelephonyRepository;
+        TDisplayMode iDisplayMode;  //4k/64k display support
+        
+        RPhCltServer iPhoneClient;
+        RLibrary iLibrary;
+        
+        CGSAsyncImageHandling* iImgHandler;
+        
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    };
+
+#endif      // CGSBACKGROUNDIMAGE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_backgroundimage_api/inc/GsAsyncImageHandling.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+#ifndef GS_ASYNC_IMAGE_HANDLE_H
+#define GS_ASYNC_IMAGE_HANDLE_H
+
+#include    <e32base.h>
+#include    <imageconversion.h>
+#include    <bitmaptransforms.h>
+#include    <RPhCltServer.h>
+#include    <centralrepository.h>
+#include    "mgsasyncimagehandlingobserver.h"
+
+// CONSTANTS
+const TInt KGSMimeStringLength = 50;
+
+// DATA TYPES
+enum TGSBgImageType
+    {
+    EGSWelcomeNoteImage,
+    EGSVtStillImage
+    };
+
+enum TGSImgState
+    {
+    EGSWelcomeConversion,
+    EGSWelcomeScaling,
+    EGSVTConversion,
+    EGSVTScaling
+    };
+    
+// FORWARD DECLARTION
+class CImageDecoder;
+class MGSAsyncImageHandlingObserver;
+
+
+// CLASS DECLARTION
+class CGSAsyncImageHandling : public CActive
+  {
+  public:
+        // Static constructor
+        IMPORT_C static CGSAsyncImageHandling* NewL(
+                                RFs& aFs,
+                                MGSAsyncImageHandlingObserver* aObserver,
+                                const TDesC& aDestinationPath );
+        
+        // Destructor
+        ~CGSAsyncImageHandling();
+  
+        /*
+         * Asynchronous loading/scaling/dithering of an image. 
+         * The image is converted to a bitmap.
+         */
+        void ProcessImageL( const TDesC& aFilename, 
+                               TInt aScreenWidth,
+                               TInt aScreenHeight,
+                               TGSBgImageType aBgImageType );
+                               
+        TDisplayMode GetDisplayMode( const TFrameInfo& aFrameInfo );
+        
+  private:
+        // C++ constructor
+        CGSAsyncImageHandling( RFs& aFs,
+                               MGSAsyncImageHandlingObserver* aObserver,
+                               const TDesC& aDestinationPath );
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        TSize CalculateLoadSize(TFrameInfo& aFrameInfo,
+                                    const TSize aScreenSize );
+                                    
+        void SaveVTStillImageL();
+  
+  private:
+        // From CActive
+        void RunL();
+        TInt RunError( TInt aError );
+        void DoCancel();
+        void Release();
+        
+  private:
+        MGSAsyncImageHandlingObserver* iObserver;
+        
+        // File session
+        RFs& iFs;
+        
+        // Image decoder
+        CImageDecoder* iDecoder;
+        
+        // Currently open file Mime-string
+        TBuf8<KGSMimeStringLength> iMimeString;
+        
+        CFbsBitmap* iBitmap;
+        
+        const TDesC& iDestinationPath;
+        TInt iBgImageType;
+        
+        RPhCltServer iPhoneClient;
+        RLibrary iLibrary;
+        CRepository* iStartupRepository;
+        CBitmapScaler* iBitmapScaler;
+        TSize iScaleSize;
+        TInt iState;
+        
+  };
+  
+#endif // GS_ASYNC_IMAGE_HANDLE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_backgroundimage_api/inc/MGsAsyncImageHandlingObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*   Observer class for asynchronous image handling.
+*
+*/
+
+
+
+#ifndef MGS_ASYNC_IMAGE_HANDLING_OBSERVER_H
+#define MGS_ASYNC_IMAGE_HANDLING_OBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+/**
+*  Pure virtual observer class to notify events from CGSAsyncImageHandling.
+*
+*  @lib GsEngine.lib
+*/
+class MGSAsyncImageHandlingObserver
+    {
+    public: // New functions
+
+        /**
+        * Notifies that image handling is complete.
+        * image handling involves loading, scaling and dithering
+        * @param aError Error value if something went wrong.
+        */
+		virtual void ImageHandlingCompleteL( TInt aError ) = 0;
+    };
+
+#endif	// MGS_ASYNC_IMAGE_HANDLING_OBSERVER_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_backgroundimage_api/settings_backgroundimage_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="e634fa58b60038f0594c2cdc76854051" dataversion="2.0">
+  <name>Settings Backgroundimage API</name>
+  <description>Sets &amp; gets background image, welcome bitmap</description>
+  <type>c++</type>
+  <collection>gssettingsuis</collection>
+  <libs>
+    <lib name="BackgroundImage.lib" />
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+../../../../gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp
+gnumakefile settings_backgroundimage_api.mk
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/settings_backgroundimage_api.mk	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSListBox.dll /f
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : do_nothing
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES : do_nothing
+
+FINAL :
+	echo COPYING
+	copy \epoc32\RELEASE\winscw\udeb\T_GSListBox.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   File that exports the files belonging to
+:                Settings Framework API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/GSCommon.rh     MW_LAYER_PLATFORM_EXPORT_PATH(gscommon.rh)
+../inc/GSSettingId.h     MW_LAYER_PLATFORM_EXPORT_PATH(gssettingid.h)
+../inc/GSChildViewManager.h     MW_LAYER_PLATFORM_EXPORT_PATH(gschildviewmanager.h)
+../inc/MGSSettingPSObserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(mgssettingpsobserver.h)
+../inc/GSBaseView.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsbaseview.h)
+../loc/gs.loc     MW_LAYER_LOC_EXPORT_PATH(gs.loc)
+../inc/GSPrivatePluginProviderIds.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsprivatepluginproviderids.h)
+../inc/GSTabbedViewOwner.h     MW_LAYER_PLATFORM_EXPORT_PATH(gstabbedviewowner.h)
+../inc/GeneralSettingsVariant.hrh     MW_LAYER_PLATFORM_EXPORT_PATH(generalsettingsvariant.hrh)
+../inc/GSBaseContainer.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsbasecontainer.h)
+../inc/GSParentPlugin.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsparentplugin.h)
+../inc/GSTabHelper.h     MW_LAYER_PLATFORM_EXPORT_PATH(gstabhelper.h)
+../inc/GSPluginLoader.h     MW_LAYER_PLATFORM_EXPORT_PATH(gspluginloader.h)
+../inc/GSMainView.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsmainview.h)
+../inc/GSCommon.hrh     MW_LAYER_PLATFORM_EXPORT_PATH(gscommon.hrh)
+../inc/GSTabbedView.h     MW_LAYER_PLATFORM_EXPORT_PATH(gstabbedview.h)
+../inc/GSParentContainer.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsparentcontainer.h)
+../inc/GSPubSubsListener.h     MW_LAYER_PLATFORM_EXPORT_PATH(gspubsubslistener.h)
+../inc/MGSWatchDog.h     MW_LAYER_PLATFORM_EXPORT_PATH(mgswatchdog.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSBaseContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Base class for GS plugin containers.
+*
+*/
+
+
+#ifndef GSBASECONTAINER_H
+#define GSBASECONTAINER_H
+
+// INCLUDES
+#include    <coeccntx.h>
+#include    <eikclb.h>
+
+// CLASS DECLARATION
+
+/**
+*  Base class for GS view containers. Use not necessary.
+*
+*  @lib GSFramework.lib
+*  @since Series60_3.1
+*/
+class CGSBaseContainer : public CCoeControl
+{
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        IMPORT_C virtual void ConstructL( const TRect& aRect ) = 0;
+
+        /**
+        * Constructs all common parts of the container.
+        *
+        * @param aRect Listbox control's rect.
+        * @param aResTitleId Resource id for title.
+        * @param aResLbxId Resource id for listbox.
+        */
+        IMPORT_C void BaseConstructL(   const TRect& aRect,
+                                        TInt aResTitleId,
+                                        TInt aResLbxId );
+
+        /**
+        * Constructor.
+        */
+        IMPORT_C CGSBaseContainer();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CGSBaseContainer();
+
+    public: // New
+
+        /**
+        * Sets selected item in the listbox.
+        * @param aIndex Index of the item.
+        */
+        IMPORT_C virtual void SetSelectedItem( TInt aIndex );
+
+        /**
+        * Returns selected item in the listbox.
+        * @return Seleced item index or 0 if no valid lbx.
+        */
+        IMPORT_C virtual TInt SelectedItem();
+
+        /**
+        * Set focus on the selected listbox. For animated skins feature.
+        */
+        IMPORT_C void FocusChanged( TDrawNow aDrawNow );
+
+    public: // From CCoeControl
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void HandleResourceChange( TInt aType );
+
+    protected: // New
+
+        /**
+        * Constructs listbox.
+        * @param aResLbxId Resource id for listbox.
+        */
+        virtual void ConstructListBoxL( TInt aResLbxId );
+
+    private: // From CCoeControl
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void SizeChanged();
+
+        /**
+        * See base class.
+        */
+        IMPORT_C TInt CountComponentControls() const;
+
+        /**
+        * See base class.
+        */
+        IMPORT_C CCoeControl* ComponentControl( TInt /*aIndex*/ ) const;
+
+        /**
+        * See base class.
+        */
+        IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                              TEventCode aType );
+
+    public: // Data
+
+        // Pointer to newly created list box.
+        CEikTextListBox* iListBox;
+
+    protected: // Data
+
+        // European look and feel.
+        TBool iElaf;
+};
+
+#endif // GSBASECONTAINER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSBaseView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     Base class for settings views.
+*
+*/
+
+
+#ifndef GSBASEVIEW_H
+#define GSBASEVIEW_H
+
+// INCLUDES
+#include    <gsplugininterface.h>
+
+#include    <aknnavi.h>
+#include    <aknview.h>
+#include    <bldvariant.hrh>
+#include    <ConeResLoader.h>
+#include    <eikclb.h>
+
+// FORWARD DECLARATIONS
+class CGSBaseContainer;
+class CAknNavigationDecorator;
+
+// CLASS DECLARATION
+
+/**
+*  CGSBaseView view class
+*  Base class for GS plugin views.
+*
+*  @lib GSFramework.lib
+*  @since Series60_3.1
+*/
+class CGSBaseView : public CGSPluginInterface , public MEikListBoxObserver
+    {
+    public:
+
+        // Panic code used in this class
+        enum KGSViewPanicCodes
+            {
+            EGSViewPanicNullPtr = 1
+            };
+
+    public: // Constructors and destructor
+
+        /**
+        * C++ default constructor
+        */
+        IMPORT_C CGSBaseView();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        IMPORT_C virtual void ConstructL()=0;
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CGSBaseView();
+
+    public: // New
+
+        /**
+        * This function is used to set the current item in the listbox.
+        * @param aIndex Current item. Default value is 0 i.e. the first item
+        *        of the list.
+        */
+        IMPORT_C virtual void SetCurrentItem( TInt aIndex = 0 );
+
+        /**
+        * Returns the container this view has.
+        * @return pointer to container, does not transfer ownership.
+        */
+        IMPORT_C CGSBaseContainer* Container();
+
+        /**
+        * Opens the nearest localized resourcefile using aResourceLoader.
+        * aResourceLoader should be opened only once before closing it.
+        * Otherwise it will raise a panic. Therefore it is better to have
+        * multiple resource loaders. Uses KDC_RESOURCE_FILES_DIR.
+        *
+        * @param aResourceFileName Drive and name of resource file in format
+        *                          <path>:<rsc_file_name>
+        * @param aResourceLoader Resource loader for the resource. The loader
+        *                        must not be opened allready or it will raise
+        *                        a panic. It is caller's responsibility to
+        *                        close the resource loader after using the
+        *                        resource.
+        */
+        IMPORT_C void OpenLocalizedResourceFileL(
+            const TDesC& aResourceFileName,
+            RConeResourceLoader& aResourceLoader );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        IMPORT_C virtual void ResetSelectedItemIndex();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void DoActivateL( const TVwsViewId& aPrevViewId,
+                                   TUid /*aCustomMessageId*/,
+                                   const TDesC8& /*aCustomMessage*/ );
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void DoDeactivate();
+
+    protected: // New
+
+        /**
+        * Sets the correct navi pane for the view (eg. tabs, string etc.).
+        */
+        IMPORT_C virtual void SetNaviPaneL();
+
+        /**
+        * Creates context for view's navi pane.
+        * @param aResourceId Resource id for navi pane context's resource.
+        */
+        IMPORT_C virtual void CreateNaviPaneContextL( TInt aResourceId );
+
+        /**
+        * Creates container,
+        */
+        IMPORT_C virtual void CreateContainerL();
+
+        /**
+        * Functionality for creating a container. Called by DoActivateL().
+        * Implemented by sub-class.
+        */
+        IMPORT_C virtual void NewContainerL() = 0;
+
+    protected: // From CAknView
+
+        /**
+        * See base class.
+        */
+        void HandleClientRectChange();
+
+    protected: // From MEikListBoxObserver
+
+        /**
+        * See base class.
+        */
+        void HandleListBoxEventL( CEikListBox* aListBox,
+            TListBoxEvent aEventType );
+
+    private: // New
+
+        /**
+        * Handles listbox selection. Called by HandleListBoxEventL.
+        * Implement by sub-class.
+        */
+        virtual void HandleListBoxSelectionL() = 0;
+        
+        /**
+        *  Creates navi control container when needed
+        */
+        CAknNavigationControlContainer* NaviControlContainerL();
+
+    public: // Data
+
+        TVwsViewId iPrevViewId; // Previous view UID
+
+    protected: // Data
+
+        // Pointer to application UI.
+        CAknViewAppUi* iAppUi;
+
+        // Pointer to the container
+        CGSBaseContainer* iContainer;
+
+        // Navi pane
+        CAknNavigationDecorator* iNaviPaneContext;
+
+        // Pointer to the navi control container
+        CAknNavigationControlContainer* iNaviControlContainer;
+
+        // Currently selected listbox item
+        TInt iCurrentItem;
+
+        // First item in the listbox
+        TInt iTopItemIndex;
+
+        // European look and feel
+        TBool iElaf;
+
+        // Resource loader
+        RConeResourceLoader iResourceLoader;
+
+    private: // Data
+
+    };
+
+#endif // GSBASEVIEW_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSChildViewManager.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+#ifndef GSChildViewManager_H
+#define GSChildViewManager_H
+
+// Classes referenced
+class CGSPluginInterface;
+
+class MGSChildViewManager
+    {
+public:
+    virtual void TransferDynamicPluginL( CGSPluginInterface* aPlugin ) = 0;
+    };
+
+
+#endif // GSChildViewManager_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSCommon.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Common GS menu commands and other common constants.
+*
+*/
+
+
+#ifndef GSCOMMON_HRH
+#define GSCOMMON_HRH
+
+// Common GS menu commands. Start from 500 so everything below 500 is free for
+// use for plugins. The values are based on the assumption that Avkon process
+// commands constants start from 4000 and CBA constants start from 3000 so 
+// these will not be overwritten.
+//
+enum TGSMenuCommands
+    {
+    EGSCmdAppChange = 500,
+    EGSCmdAppEdit,
+    EGSCmdAppHelp,
+    EGSCmdAppNew,
+    EGSCmdAppOpen,
+    EGSMSKCmdAppChange
+    };
+
+enum TGSListBoxItemVisibility
+    {
+    EGSListBoxItemTypeIsAlwaysVisible = 0,
+    EGSListBoxItemTypeIsDynamic
+    };
+
+#endif // GSCOMMON_HRH
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSCommon.rh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Contains common declarations for resources of GS.
+*                 The file can be included only in resource file.
+*
+*/
+
+
+#ifndef GSCOMMON_RH
+#define GSCOMMON_RH
+
+#include <gscommon.hrh>
+
+// Global definitions
+
+//  STRUCTURE DEFINITIONS
+
+// ---------------------------------------------------------
+//    gs_link_apps
+//    It defines structure to contain information about apps 
+//    to be able to included in the softkey list.
+// ---------------------------------------------------------
+//
+STRUCT GS_LINK_APPS
+    {
+    STRUCT apps[];
+    }
+
+// ---------------------------------------------------------
+//    gs_app
+//    It defines structure that contains information about 
+//    a single app.
+// ---------------------------------------------------------
+//
+STRUCT GS_APP
+    {
+    WORD id;    
+    LONG app = -1;
+    }
+
+// ---------------------------------------------------------
+//    gs_feature_array
+//    It defines structure to contain information about items 
+//    to be able to included in the listbox.
+// ---------------------------------------------------------
+//
+STRUCT GS_FEATURE_ARRAY
+    {
+    STRUCT items[];
+    }
+
+// ---------------------------------------------------------
+//    gs_feature
+//    It defines structure that contains information about 
+//    a single listbox item.
+// ---------------------------------------------------------
+//
+STRUCT GS_FEATURE
+    {
+    LTEXT txt = "";    
+    WORD item = -1;
+    BYTE type = EGSListBoxItemTypeIsAlwaysVisible;
+    }
+
+#endif // GSCOMMON_RH
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Main view.
+*
+*/
+
+
+
+#ifndef GSMAINVIEW_H
+#define GSMAINVIEW_H
+
+// INCLUDES
+#include    "gspluginloader.h"
+#include    "gschildviewmanager.h"
+#include    <data_caging_path_literals.hrh>
+#include    <ConeResLoader.h>
+#include    <gstabbedviewowner.h>
+#include    <aknview.h>
+#include    <eikmenup.h>
+
+// CONSTANTS
+_LIT( KGSMainViewResourceFileName, "z:GSApp.rsc" );
+
+// FORWARD DECLARATIONS
+class CGSMainContainer;
+class CGSPluginInterface;
+
+// CLASS DECLARATION
+
+/**
+* CGSMainView view class
+*
+* Main view of GS
+*
+* This view is responsible for visualizing the first level of settings
+* plugins.
+*
+*/
+class CGSMainView :
+    public CAknView,
+    public MGSPluginLoadObserver,
+    public MGSTabbedViewOwner,
+    public MGSChildViewManager
+    {
+    public: // Constructors and destructor
+
+        CGSMainView();
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS main view.
+        */
+        static CGSMainView* NewL();
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS main view.
+        */
+        static CGSMainView* NewLC();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor
+        */
+        ~CGSMainView();
+
+    public: // New
+
+        /**
+        * Returns pointer to the owned plugins.
+        */
+        CArrayPtrFlat<CGSPluginInterface>* Plugins();
+
+        /**
+        * Updates plugin's view. This can be used when child plugin's values
+        * are changed.
+        */
+        void UpdateView();
+
+    public: // From CAknView
+
+        /**
+        * See base view.
+        */
+        TUid Id() const;
+
+    public: // From MGSPluginLoadObserver
+
+        /**
+        * See base view.
+        */
+        void HandlePluginLoaded( KGSPluginLoaderStatus aStatus );
+
+    public: // From MGSChildViewManager
+
+        /**
+        * See base view.
+        */
+        void TransferDynamicPluginL( CGSPluginInterface* aPlugin );
+
+    public: // From MGSTabbedViewOwner
+
+        /**
+        * See base view.
+        */
+        CArrayPtrFlat<CGSPluginInterface>* TabbedViews();
+
+        /**
+        * See base class.
+        */
+        void TabChangedL( TUid selectedTabUid );
+
+    protected: // From CAknView
+
+        /**
+        * See base view.
+        */
+        void DoActivateL(
+            const TVwsViewId& aPrevViewId,
+            TUid aCustomMessageId,
+            const TDesC8& aCustomMessage );
+
+        /**
+        * See base view.
+        */
+        void DoDeactivate();
+
+        /**
+        * See base view.
+        */
+        void HandleCommandL( TInt aCommand );
+    
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    private:
+
+        /**
+        * Opens the nearest localized resourcefile.
+        */
+        void OpenLocalizedResourceFileL( const TDesC& aResourceFileName );
+
+        /**
+        * Creates new container.
+        */
+        void NewContainerL();
+
+    private: // Data
+
+        // Pointer to Application UI. Not owned.
+        CAknViewAppUi* iAppUi;
+
+        // Pointer to owned container.
+        CGSMainContainer* iContainer;
+
+        // GS plug-ins owned by this view. CGSPluginLoader defines the
+        // ordering of items.
+        CArrayPtrFlat<CGSPluginInterface>* iPluginArray;
+
+        // Asynchronous loader for the GS plug-ins.
+        CGSPluginLoader* iPluginLoader;
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+
+        // UID of the selected plugin in the container's lbx.
+        TUid iSelectedPluginUid;
+        
+        //keep the exact position of the listbox including current item index,
+        //iVerticalOffset and  TopItemindex
+        RArray<TInt> position;
+        
+        //record the screen mode, portrait/landscape
+        TBool iScreenMode;
+    };
+
+#endif  // GSMAINVIEW_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSParentContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Container for GSParentPlugin.
+*
+*/
+
+
+#ifndef GSPARENTCONTAINER_H
+#define GSPARENTCONTAINER_H
+
+#include    "gsparentplugin.h"
+#include    <bldvariant.hrh>
+#include    <AknIconArray.h>
+#include    <AknsUtils.h>     // For loading icons
+#include    <coecntrl.h>
+#include    <eiklbx.h>
+#include    <eiktxlbx.h>
+
+// CLASS DECLARATION
+class CAknViewAppUi;
+class CGSPluginInterface;
+class CAknSingleLargeStyleListBox;
+class MGSWatchDog;
+
+/**
+*  Container class for the GS Main view.
+*  @lib GSFramework.lib
+*  @since Series60_3.1
+*/
+class CGSParentContainer : public CCoeControl, public MEikListBoxObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS constructor.
+        * Required by the base class.
+        */
+        /*void ConstructL(
+            const TRect& aRect,
+            CAknViewAppUi* aAppUi,
+            CArrayPtrFlat<CGSPluginInterface>* aPluginArray,
+            TInt aTitleRscId );*/
+
+        /**
+        * Symbian OS constructor.
+        * Required by the base class.
+        */
+        void ConstructL(
+            const TRect& aRect,
+            CAknViewAppUi* aAppUi,
+            CArrayPtrFlat<CGSPluginInterface>* aPluginArray,
+            TInt aTitleRscId,
+            CGSParentPlugin* aParentPlugin,
+            TGSListboxTypes aListBoxType =
+                EGSListBoxTypeSingleLarge );
+
+	      /**
+        * Destructor.
+        */
+        ~CGSParentContainer();
+
+    public: // New
+
+        /**
+        * Updates iListBox. Listbox is updated depending on the type of the
+        * listbox. Plugins are inserted to listbox only if they are visible.
+        */
+        void UpdateListBoxL();
+
+        /**
+        * @return Pointer to owned listbox
+        */
+        CEikListBox* ListBox();
+
+        /**
+        * @return Plugin which is selected in the lbx or NULL if no plugins
+        *         exist.
+        */
+        CGSPluginInterface* SelectedPlugin();
+
+        /**
+        * Sets selected lbx item using the UID of the item. If the item is not
+        * existing or visible anymore, selected item is the first item in the
+        * lbx.
+        */
+        void SetSelectedItem( TUid aSelectedItemUid );
+        
+        /**
+        * @return Plugin which is top in the lbx or NULL if no plugins
+        *         exist.
+        */
+        CGSPluginInterface* TopPlugin();
+        
+        /**
+        * Sets top lbx item using the UID of the item.
+        */
+        void SetTopItem( TUid aTopItemUid );
+
+        /**
+         * Set the empty text of list box.
+         */
+        void SetListBoxEmptyTextL(const TDes& aEmpty );
+        
+        /**
+         * @return the exact position of the listbox containing current item index,
+         * iVerticalOffset and  TopItemindex
+         */
+        void GetPositionL(RArray<TInt>& posArray);
+
+        /**
+         * set listbox's exact position.
+         */
+        void SetPosition(const RArray<TInt>& pos, TBool aChangeMode);   
+        
+
+    public: // From CCoeControl
+
+        /**
+        * Set focus on the selected listbox. For animated skins feature.
+        */
+        IMPORT_C void FocusChanged( TDrawNow aDrawNow );
+
+        /**
+        * See base class.
+        */
+        void HandleResourceChange( TInt aType );
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    public: //New
+
+        void HandleSelectionKeyL();
+
+    protected: // From MEikListBoxObserver
+
+        /**
+        * Handles listbox events.
+        * @param aListBox Listbox where the event occurred.
+        * @param aEventType Event type.
+        */
+        void HandleListBoxEventL( CEikListBox* aListBox,
+            TListBoxEvent aEventType );
+
+    private: // New
+
+        /**
+        * Creates a listbox.
+        */
+        void CreateListBoxL( TGSListboxTypes aListBoxType );
+
+        /**
+        * Adds plugin data to listbox.
+        * @param aPlugin A plugin whose data is to be used.
+        * @param aItemTextArray Array for plugin texts and format strings used
+        *        by lbx.
+        * @param aIconArray Array for icons used in lbx.
+        * @param aIconCounter Counter for inserted icons, will be updated.
+        */
+        void AddPluginDataToLbxL( CGSPluginInterface* aPlugin,
+                                  CDesCArray* aItemTextArray,
+                                  CAknIconArray* aIconArray,
+                                  TInt& aIconCounter );
+
+    private: // From CCoeControl
+
+        /**
+        * See base class.
+        */
+        void SizeChanged();
+
+        /**
+        * See base class.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * See base class.
+        */
+        CCoeControl* ComponentControl(TInt /*aIndex*/) const;
+
+        /**
+        * See base class.
+        */
+        TKeyResponse OfferKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+    private: // Data
+
+        // Application UI. Not owned.
+        CAknViewAppUi* iAppUi;
+
+        // Owned listbox.
+        CEikListBox* iListBox;
+
+        // Type of iListBox.
+        TGSListboxTypes iListBoxType;
+
+        // Pointer to listbox model's item texts. Note that the indexes of
+        // listbox items are mapped directly to the indexes in plugin array.
+        // Plugin which maps to selected listbox item index in plugin array is
+        // activated when item is selected in listbox.
+        //
+        // Owned by iListBox.
+        //
+        CDesCArray* iItemTextArray;
+
+        // Array of the child plugins. Owned by CGSParentPlugin.
+        CArrayPtrFlat<CGSPluginInterface>* iPluginArray;
+
+        // Array of pointers to iPluginArray plugins which are visible.
+        // This is the actual array which is displayed by the listbox.
+        // It is needed because iPluginArray also contains non-visible plugins
+        // and therefore the indexes do not match to lbx items.
+        CArrayPtrFlat<CGSPluginInterface>* iVisiblePlugins;
+
+        // Pointer to parent plugin. Not owned.
+        CGSParentPlugin* iParentPlugin;
+
+        // Pointer to GSWatchDog owned by GS Application document. Not owned.
+        MGSWatchDog* iGSWatchDog;
+       
+    };
+
+
+#endif // GSPARENTCONTAINER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSParentPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,342 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Base class header for plugins containing other plugins.
+*
+*/
+
+
+#ifndef GSPARENTPLUGIN_H
+#define GSPARENTPLUGIN_H
+
+// INCLUDES
+#include    "gspluginloader.h"
+#include    "gsplugininterface.h"
+#include    "gschildviewmanager.h"
+
+#include    <data_caging_path_literals.hrh>
+#include    <ConeResLoader.h>
+#include    <babitflags.h>
+
+// CONSTANTS
+_LIT( KGSParentPluginResourceFileName, "z:GSParentPluginRsc.rsc" );
+
+/**
+* Used by CGSParentPlugin::ListBoxType(). These enumerations are used to define
+* the desired type of the listbox. Enumerations here are currently implemented
+* by CGSParentPlugin. Additional types can be defined later as long as the
+* values for previous types are not changed.
+*/
+enum TGSListboxTypes
+    {
+    // CAknSingleLargeStyleListBox for
+    // list_single_large_pane
+    EGSListBoxTypeSingleLarge = 1, // Default
+    // CAknSettingStyleListBox for
+    // list_setting_pane and
+    // list_big_single_setting_pane
+    EGSListBoxTypeSettings,
+    // CAknDouble2LargeStyleListBox for
+    // list_double2_large_graphic_pane
+    EGSListBoxTypeDouble2Large,
+    // CAknDoubleLargeStyleListBox for
+    // list_double_large_graphic_pane
+    // Note: Only different layout than EGSListBoxTypeDouble2Large
+    EGSListBoxTypeDoubleLarge
+    };
+
+/**
+* Indexes to flags that are used for different customisation options for parent
+* plugin. The flags define for example optimization options for loading child
+* plugins.
+*/
+enum TGSOptionFlagIndexes
+    {
+    // On:  Will load child plugins when parent plugin is activated.
+    // Off: Will load child plugins on initialization of the parent plugin.
+    EGSLoadChildrenOnActivation,
+    // On:  Will delete child plugins when parent plugin is deactivated.
+    // Off: Will delete child plugins when parent plugin is destroyed.
+    EGSDeleteChildrenOnDeactivation // CURRENTLY NOT IMPLEMENTED!
+    };
+
+// FORWARD DECLARATIONS
+class CGSParentContainer;
+
+// CLASS DECLARATION
+
+/**
+* CGSParentPlugin view class. Thus is a base class for plugins owning other
+* plugins as their sub-views.
+*
+* @lib GSFramework.lib
+* @since Series60_3.1
+*/
+class CGSParentPlugin : public CGSPluginInterface,
+                        public MGSPluginLoadObserver,
+                        public MGSChildViewManager
+{
+    public: // Constructors and destructor
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CGSParentPlugin();
+
+    public: // New
+
+        /**
+        * Opens the nearest localized resourcefile using aResourceLoader.
+        * aResourceLoader should be opened only once before closing it.
+        * Otherwise it will raise a panic. Therefore it is better to have
+        * multiple resource loaders. Uses KDC_RESOURCE_FILES_DIR.
+        *
+        * @param aResourceFileName Drive and name of resource file in format
+        *                          <path>:<rsc_file_name>
+        * @param aResourceLoader Resource loader for the resource. The loader
+        *                        must not be opened allready or it will raise
+        *                        a panic. It is caller's responsibility to
+        *                        close the resource loader after using the
+        *                        resource.
+        */
+        IMPORT_C void OpenLocalizedResourceFileL(
+            const TDesC& aResourceFileName,
+            RConeResourceLoader& aResourceLoader );
+
+        /**
+        * Symbian OS default constructor. Call this from sub classes.
+        *
+        * @param aViewTitleRscId    Id for the view's resource.
+        * @parem aTitleRscId        Id for the view's title resource.
+        */
+        IMPORT_C void BaseConstructL( TInt aViewRscId, TInt aTitleRscId );
+
+        /**
+        * @return UID of the upper level view which launched this view. Note
+        *         that it is not always the previous view because a view can
+        *         be activated also by returning from another view.
+        */
+        IMPORT_C virtual TUid UpperLevelViewUid();
+
+        /**
+        * Defines the type of the used listbox visualising the child plugins.
+        * Classes deriving from CGSParentContainer can override this function
+        * to define the used type of the listbox. Otherwise default value
+        * EGSListBoxTypeSingleLarge is used.
+        *
+        * @return Type of the listbox. See TGSListboxTypes for
+        *         types.
+        */
+        IMPORT_C virtual TGSListboxTypes ListBoxType();
+
+        /**
+        * Updates plugin's view. This can be used when child plugin's values
+        * are changed.
+        */
+        IMPORT_C virtual void UpdateView();
+
+        /**
+        * Defines custom options for parent plugin. Use TGSOptionFlagIndexes to
+        * enable a combination of bit flags.
+        *
+        * @param aOptionFlags Option combination created by combining binary
+        *        option flags.
+        */
+        IMPORT_C virtual void SetOptionFlags( TBitFlags& aOptionFlags );
+
+        /**
+        * Gets currently used option flags.
+        *
+        * @return Binary option flags used by this plugin.
+        */
+        IMPORT_C virtual const TBitFlags& OptionFlags() const;
+
+        /**
+        * Provides help context. This should be implemented by CGSParentPlugin
+        * sub class in case help is needed. Normally this is defined in
+        * CCoeControl derived class but since all parent plugin implementations
+        * have only CGSParentContainer class as the only CCoeControl derived
+        * class, and need still their own unique help contexts, this function
+        * is needed in view level class.
+        */
+        IMPORT_C virtual void GetHelpContext( TCoeHelpContext& aContext );
+
+        /**
+        * @return Plugin which is selected in the lbx or NULL if no plugins
+        *         or iContainer exist.
+        */
+        IMPORT_C CGSPluginInterface* SelectedPlugin();
+
+        /**
+        * Attempts to change child plugin load priority on next RunL cycle.
+        * Use this if parent needs to change plugin loader priority. Normally
+        * when parent plugin view is opened, it is advisable to increase loader
+        * priority to get child plugins loaded faster.
+        *
+        * @param aPriority Desired priority.
+        */
+        void RequestPriority( CActive::TPriority aPriority );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void ResetSelectedItemIndex();
+
+    public: // From MGSPluginLoadObserver
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void HandlePluginLoaded( KGSPluginLoaderStatus aStatus );
+
+    public: //New
+
+        /**
+        * Checks if the MSK label needs to be adjusted.
+        */
+        void CheckMiddleSoftkeyLabelL();
+
+        /**
+        * Adds given resource text as MSK to CBA. Use either this or
+        * SetMiddleSoftKeyLabelTextL in in case text is used deirectly instead
+        * of resource.
+        *
+        * @param aResourceId middle softkey label.
+        * @param aCommandId command that should be performed when MSK
+        *        is pressed.
+        * @since S60 v3.1
+        */
+        void SetMiddleSoftKeyLabelL( const TInt aResourceId, const TInt aCommandId );
+
+        /**
+        * Adds given text as MSK to CBA.
+        *
+        * @param aMskLabel middle softkey label.
+        * @param aCommandId command that should be performed when MSK
+        *        is pressed.
+        * @since S60 v3.1
+        */
+        void SetMiddleSoftKeyLabelTextL( const TPtr aMskLabel, const TInt aCommandId );
+
+    public: // From MGSChildViewManager
+
+        IMPORT_C void TransferDynamicPluginL( CGSPluginInterface* aPlugin );
+
+    protected: // From CAknView
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void DoActivateL( const TVwsViewId& aPrevViewId,
+                                   TUid aCustomMessageId,
+                                   const TDesC8& aCustomMessage );
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void DoDeactivate();
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void HandleCommandL( TInt aCommand );
+
+        /**
+        * See base class.
+        */
+        IMPORT_C CGSParentPlugin();
+
+    protected: // From MEikMenuObserver
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void DynInitMenuPaneL( TInt aResourceId,
+                                        CEikMenuPane* aMenuPane );
+
+    private: // New
+
+        /**
+        * Constructs container for this view.
+        */
+        void ConstructContainerL();
+
+        /**
+        * Remove command from MSK.
+        * @param aMskCommandId ID of the command to be removed.
+        */
+        void RemoveCommandFromMSK( TInt aMskCommandId );
+
+        /**
+         * Used in lazy loading. Starts loading the plugins.
+         */
+        void StartAsyncPluginLoadL();
+
+    protected: // Data
+
+        // Previous view UID.
+        TVwsViewId iPrevViewId;
+
+    private: // Data
+
+        // Application UI.
+        CAknViewAppUi* iAppUi;
+
+        // Owned container.
+        CGSParentContainer* iContainer;
+
+        // GS plug-ins owned by this view.
+        // CGSPluginLoader defines the ordering of plugins.
+        CArrayPtrFlat<CGSPluginInterface>* iPluginArray;
+
+        // Asynchronous loader for the GS plug-ins.
+        CGSPluginLoader* iPluginLoader;
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+
+        // Resource id for the title.
+        TInt iTitleRscId;
+
+        // UID of the selected plugin in the container's lbx. Uid is used
+        // instead of simple index because it is unambiguous whereas index
+        // could refer to wrong plugin in case plugin order or count is
+        // changed.
+        TUid iSelectedPluginUid;
+
+        // Combination of binary flags that can be set to alter parent plugin
+        // behaviour.
+        TBitFlags iOptionFlags;
+
+        // This stores the desired MSK command ID.
+        TInt iMskCommandId;
+        
+        // UID of the top plugin in the container's lbx. Uid is used
+        // instead of simple index because it is unambiguous whereas index
+        // could refer to wrong plugin in case plugin order or count is
+        // changed.
+        TUid iTopPluginUid;
+        
+        //keep the exact position of the listbox including current item index,
+        //iVerticalOffset and  TopItemindex
+        RArray<TInt> position;
+        
+        //record the screen mode, portrait/landscape
+        TBool iScreenMode;
+};
+
+
+#endif // GSPARENTPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSPluginLoader.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class definition for CGSPluginLoader
+*
+*/
+
+
+
+#ifndef  GSPLUGINLOADER_H
+#define  GSPLUGINLOADER_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    <ecom/implementationinformation.h>
+
+// CONSTANTS
+
+// Value for a to b comparison result when logically a == b.
+const TInt KGSComparisonEqual     = 0;
+
+// Value for a to b comparison result when logically a < b.
+const TInt KGSComparisonBefore    = -1;
+
+// Value for a to b comparison result when logically a > b.
+const TInt KGSComparisonAfter     = 1;
+
+// CLASS DEFINITIONS
+class CGSPluginInterface;
+class MGSPluginLoadObserver;
+class CAknViewAppUi;
+class REComSession;
+class CAknColumnListBox;
+class CAknInfoPopupNoteController;
+class CGSBaseDocument;
+class MGSWatchDog;
+
+/**
+* CGSPluginLoader. Mechanism used to load plugins asynchronously. Uses
+* MGSPluginLoadObserver as a callback.
+*
+* @lib GSFramework.lib
+* @since Series60_30.1
+*/
+class CGSPluginLoader : public CActive
+    {
+    public:  // Constructor and destructor
+
+        /**
+        * Two-phased constructor.
+        *
+        * @param aAppUi Pointer to application UI. Does not take ownership.
+        */
+        IMPORT_C static CGSPluginLoader* NewL( CAknViewAppUi* aAppUi );
+
+        /**
+        * Destructor
+        */
+        IMPORT_C ~CGSPluginLoader();
+
+    private: // Internal construction
+
+        /**
+        * Default C++ contructor
+        */
+        CGSPluginLoader();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL( CAknViewAppUi* aAppUi );
+
+    public: // API
+
+        /**
+        * Starts loading GS plug-ins asynchronously. Will call
+        * MGSPluginLoadObserver::HandlePluginLoaded() each time a plug-in is
+        * loaded and when all plugins are loaded.
+        *
+        * CGSPluginLoader transfers the ownership of each loaded plugin view to
+        * CAknViewAppUi. It is client's responsibility to remove the views from
+        * CAknViewAppUi and delete the plugins if necessary.
+        *
+        * @param aInterfaceUid Uid ofthe interfaces to be loaded.
+        * @param aParentUid Uid of the parent. Only children of this parent
+        *        will be loaded.
+        * @param aPluginArray An array for the loaded GS plug-ins.
+        *        CGSPluginLoader does not take the ownership of this array.
+        */
+        IMPORT_C void LoadAsyncL(
+            TUid aInterfaceUid,
+            TUid aParentUid,
+            CArrayPtrFlat<CGSPluginInterface>* aPluginArray );
+
+        /**
+        * Load a specific plugin instance synchronously.
+        *
+        * @param aInterfaceUid Uid ofthe interfaces to be loaded.
+        * @param aImplementationUid Uid of the implementation to load
+        */
+        CGSPluginInterface& LoadSyncL( TUid aInterfaceUid, TUid aImplementationUid );
+
+        /**
+        * Sets observer for this loader. Only one observer per loader in one
+        * time is possible.
+        */
+        IMPORT_C void SetObserver(MGSPluginLoadObserver* aObserver);
+
+        /**
+        * Aborts asynchronous loading of the GS plug-ins.
+        */
+        IMPORT_C void AbortAsyncLoad();
+
+        /**
+        * Sorts the plugin array.
+        *
+        * Sorting criterias:
+        *
+        * 1. Order number if provider category is Internal.
+        * 2. Provider category. Precedence as follows:
+        *       1. KGSPluginProviderInternal
+        *       2. EGSPluginProviderOEM
+        *       3. EGSPluginProviderOperator
+        *       4. EGSPluginProvider3rdParty
+        * 3. Alphabetical
+        *
+        * @param aPlugins The array which will be sorted.
+        */
+        IMPORT_C void SortPluginsL( CArrayPtrFlat<CGSPluginInterface>* aPlugins );
+
+
+        /**
+        * Attempts to change CActive priority on next RunL cycle. Use this if
+        * needed to change plugin loader priority. Normally when parent plugin
+        * view is opened, it is advisable to increase loader priority to get
+        * child plugins loaded faster.
+        *
+        * @param aPriority Desired priority.
+        */
+        IMPORT_C void RequestPriority( CActive::TPriority aPriority );
+
+    private: // Internal methods
+
+        /**
+        * Starts loading next plugin.
+        */
+        void LoadNextPluginL();
+
+        /**
+        * Creates a plugin instance from given UID. Ownership is transferred.
+        */
+        CGSPluginInterface& CreatePluginInstanceL(
+                const CImplementationInformation& aImpInfo );
+
+        /**
+        * Notifies MGSPluginLoadObserver.
+        */
+        void NotifyProgress();
+
+        /**
+        * Notifies MGSPluginLoadObserver.
+        */
+        void NotifyFinished();
+
+        /**
+        * Wait for the next round of CActive execution.
+        */
+        void CompleteOwnRequest();
+
+        // Insertion function used by sorting:
+
+        /**
+        * Inserts plugin in the correct position in the array using sorting
+        * criterias. Assumes aPlugins is ordered.
+        *
+        * @param aPlugin The plugin to be inserted.
+        * @param aPlugins Array in which the plugin is inserted into the
+        *        corresponding location.
+        */
+        void InsertPluginInOrderL(
+            CGSPluginInterface* aPlugin,
+            CArrayPtrFlat<CGSPluginInterface>* aPlugins );
+
+        // Comparison functions:
+
+        /**
+        * Compares plugins according to comparison criterias.
+        *
+        * Note: GS internal comparison constants such as KGSComparisonEqual are
+        * different from the ones outputted by this function. This is because
+        * this function is also usable by RArray sort -functionality but BC
+        * cannot be broken in GS.
+        *
+        * @return Negative value: If aFirst before aSecond.
+        *                      0: If equal.
+        *         Positive value: If aSecond before aFirst.
+        */
+        static TInt Compare( const CGSPluginInterface& aFirst,
+                             const CGSPluginInterface& aSecond );
+
+        /**
+        * Precedence is as follows:
+        * 1. KGSPluginProviderInternal
+        * 2. EGSPluginProviderOEM
+        * 3. EGSPluginProviderOperator
+        * 4. EGSPluginProvider3rdParty
+        *
+        * @return   KGSComparisonEqual  = equal categories
+        *           KGSComparisonBefore = aFirst is before aSecond
+        *           KGSComparisonAfter  = aFirst is after aSecond
+        */
+        static TInt CompareCategory(
+                const CGSPluginInterface& aFirst,
+                const CGSPluginInterface& aSecond );
+        /**
+        *
+        * @return   KGSComparisonEqual  = equal captions
+        *           KGSComparisonBefore = aFirst is before aSecond
+        *           KGSComparisonAfter  = aFirst is after aSecond
+        */
+        static TInt CompareCaption(
+                const CGSPluginInterface& aFirst,
+                const CGSPluginInterface& aSecond );
+        /**
+        *
+        * @return   KGSComparisonEqual  = equal indexes
+        *           KGSComparisonBefore = aFirst is before aSecond
+        *           KGSComparisonAfter  = aFirst is after aSecond
+        */
+        static TInt CompareIndex(
+                const CGSPluginInterface& aFirst,
+                const CGSPluginInterface& aSecond );
+
+    private: // Utility methods
+
+        /**
+        * Parses descriptor to UID.
+        */
+        static TInt ParseToUid( const TDesC8& aSource, TUid& aTarget );
+
+        /**
+        * Parsers plugin's order number
+        */
+        static TInt ParseOrderNumber( const TDesC8& aSource, TInt& aOrderNumber );
+
+        /**
+        * Print debug information.
+        */
+        static void PrintInfoDebugL( const CImplementationInformation& aInfo,
+                                    TInt aIterator,
+                                    TInt aPluginCount );
+        /**
+         * Print ordering debug data.
+         */
+        void CGSPluginLoader::PrintOrderTracesL(
+                CArrayPtrFlat<CGSPluginInterface>* aPlugins );
+
+        /**
+         * Display loading error popup message.
+         */
+        void DisplayErrorPopupL( TInt aError,
+                                 const CImplementationInformation* aInfo );
+
+    private: // From CActive
+
+        /**
+        * See base class.
+        */
+        void RunL();
+
+        /**
+        * See base class.
+        */
+        TInt RunError( TInt aError );
+
+        /**
+        * See base class.
+        */
+        void DoCancel();
+
+    private: // Data
+
+
+        // Pluginloader goes through this array and loads the plugins into
+        // iPluginArray if they fulfill the criterias.
+        RImplInfoPtrArray iImplInfoArray;
+
+        // Used as an iterator to maintain location in iImplInfoArray.
+        TInt iImplInfoArrayIterator;
+
+        // Array of loaded plugins.Plugins are owned by iAppUi. Only the array
+        // pointers are owned by this class and therefore only reset array.
+        CArrayPtrFlat<CGSPluginInterface>* iPluginArray;
+
+        // UID for plugin parent.
+        TUid iParentUid;
+
+        // Pointer to app UI. Not owned.
+        CAknViewAppUi* iAppUi;
+
+        // Pointer to observer. Not owned.
+        MGSPluginLoadObserver* iObserver;
+
+        // Number of RunL calls.
+        TInt iRunLDebugCount;
+
+        // For debugging: shows a note in case of a crashing plugin
+        CAknInfoPopupNoteController* iErrorPopup;
+
+        // Reference to GS application owned watchdog. Not onwed.
+        MGSWatchDog* iWatchDog;
+
+        // Reference to document. Not owned.
+        CGSBaseDocument* iDocument;
+
+        // Desired oactive object priority for loading child plugins.
+        CActive::TPriority iRequestedPriority;
+    };
+
+
+/**
+* Interface for GSPluginLoader observer. MGSPluginLoadObserver gets
+* notifications when plugins are loaded.
+*
+* @lib GSFramework.lib
+* @since Series60_30.1
+*/
+class MGSPluginLoadObserver
+    {
+    public: // Enums
+        enum KGSPluginLoaderStatus
+            {
+            // One plugin loaded successfully, continue to next.
+            EGSSuccess,
+            // Loading one plugin failed, contiue to next.
+            EGSFail,
+            // Client called AbortAsyncLoad(), finished loading.
+            EGSAborted,
+            // All plugins loaded successfully, finished loading.
+            EGSFinished,
+            // Severe error with loader, finished loading.
+            EGSError
+            };
+
+    public: // New
+
+        /**
+        * CGSPluginLoader calls this function when each plug-in is loaded or
+        * loading is finished..
+        */
+        IMPORT_C virtual void HandlePluginLoaded(
+            KGSPluginLoaderStatus aStatus ) = 0;
+    };
+
+
+#endif // GSPLUGINLOADER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSPrivatePluginProviderIds.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Ids for private plug-in providers.
+*
+*/
+
+
+
+#ifndef GSPRIVATEPROVIDERIDS_H
+#define GSPRIVATEPROVIDERIDS_H
+
+// CONSTANTS
+
+/**
+* Private id used for S60 internally provided GS plug-ins. This must not be 
+* disclosed to other parties. Using this id allows the plugin to be handled 
+* with more rights than other plugins:
+*   - Inserted before other plugins in listboxes.
+*   - Can define their order in the listbox.
+*   - Plug-in can belong also to other views than applications-view.
+*
+*/
+const TInt KGSPluginProviderInternal = 87329234;
+
+
+#endif // GSPRIVATEPROVIDERIDS_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSPubSubsListener.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Listener for Publish and subscribe data.
+*
+*/
+
+
+
+#ifndef GSPUBSUBSGSETTINGS_H
+#define GSPUBSUBSGSETTINGS_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class MGSSettingPSObserver;
+
+// CLASS DECLARATION
+
+/**
+*  RProperty poller.
+*
+*  @lib gs.lib
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS( CGSPubSubsListener ) : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aUid the Uid to use
+        * @param aKey item's key
+        * @param aObserver callback interface for notification
+        * @return instance of CVtEngPubSubsListener
+        */
+        IMPORT_C static CGSPubSubsListener* NewL( const TUid aUid, 
+            const TInt aKey, MGSSettingPSObserver* aObserver );
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CGSPubSubsListener();
+        
+    public: // New functions.
+
+        /**
+        * Gets integer value from P & S.
+        * @param aVal a value in return
+        * @return error code
+        */       
+        IMPORT_C TInt Get( TInt& aVal );
+
+        /**
+        * Gets 8 bit string value from P&S.
+        * @param aVal a value in return
+        * @return error code
+        */
+        IMPORT_C TInt Get( TDes8& aVal );
+        
+        /**
+        * Gets 16 bit descriptor value from P&S.
+        * @param aVal a value in return
+        * @return error code
+        */
+        IMPORT_C TInt Get( TDes16& aVal );
+        
+    private: // From CActive.
+
+        /** @see CActive::RunL */
+        virtual void RunL();
+
+        /** @see CActive::Cancel */
+        virtual void DoCancel();
+
+        /** @see CActive::RunError */
+        virtual TInt RunError( TInt aError );
+
+        /**
+        * Starts the listening (RunL).
+        */
+        void StartListening();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        * @param aUid the Uid to use
+        * @param aKey item's key
+        * @param aObserver callback interface for notification
+        */
+        CGSPubSubsListener( const TUid aUid,  TInt aKey, 
+            MGSSettingPSObserver* aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    private:    // Data
+    
+        // UID of the monitored item.
+        TUid        iUid;
+        
+        // ID of the monitored item.
+        TInt        iId;
+        
+        // Property to subscribe to.
+        RProperty   iProperty;
+        
+        // The notification interface.
+        MGSSettingPSObserver* iCallback;
+    };
+
+#endif // GSPUBSUBSGSETTINGS_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSSettingId.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   All the setting IDs are declared here
+*
+*/
+
+
+#ifndef GSSETTINGID_H
+#define GSSETTINGID_H
+
+
+// CONSTANTS
+
+// buffer size constants
+const TInt KGSBufSize128 = 128;
+
+const TInt KGSMapSize = 8;
+
+// connection packet data
+const TInt KGSSettIdV42Comp = 1;
+
+//    accessory display
+const TInt KGSSettIdAccIU = 0;
+
+
+enum {
+    KGSHeadsetDefProfile,
+    KGSLoopsetDefProfile,
+    KGSBTAudioDefProfile,
+    KGSTTYDefProfile
+    };
+
+// call display
+enum {
+    KGSSettIdOwnNumberSending,
+    KGSSettIdCallWaiting,
+    KGSSettIdCallCompletionWhenBusy,   
+    KGSSettIdSummaryAfterCall,
+    KGSSettIdPhoneLineUsed,
+    KGSSettIdPhoneLineBlocking,
+    KGSSettIdSoftRejectText
+    };
+
+#endif // GSSETTINGID_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSTabHelper.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Utility class for creating tab groups.
+*
+*/
+
+
+#ifndef GSTABHELPER_H
+#define GSTABHELPER_H
+
+#include "gsplugininterface.h"
+#include "gstabbedviewowner.h"
+
+#include <AknTabObserver.h>
+#include <e32base.h>
+#include <e32cmn.h>
+
+
+// Forward declarations
+class CAknNavigationControlContainer;
+class CAknNavigationDecorator;
+class CAknTabGroup;
+class MGSTabbedView;
+
+
+/**
+* CGSTabHelper is used to create dynamic tabs from either
+*   - CGSPluginInterface* array (plugins)
+*   - MGSTabbedView* interface Array (local views owned by plugin).
+*
+* How to use:
+*
+* 1. Call CreateTabGroupL() from the plugin's/view's DoActivate(). Providing an
+*    array of all the plugins/views which should be in the tab group including
+*    the plugin/view itself.
+*
+* 2. Call RemoveTabGroup() from the plugin's/view's DoDeactivate().
+*
+* 3. It is recommended to use CGSTabHelper* as an member variable owned by the
+*    plugin/view class.
+*
+* @lib GSFramework.lib
+* @since Series60_3.1
+*/
+class CGSTabHelper : public CBase, public MAknTabObserver
+    {
+    public: // Constructors & destructors
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        IMPORT_C static CGSTabHelper* NewL();
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        IMPORT_C static CGSTabHelper* NewLC();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CGSTabHelper();
+
+    public: // New
+
+        /**
+        * This function is for views implementing MGSTabbedViewOwner. Such may
+        * be needed in case view needs to update its selected item according to
+        * tab selection.
+        *
+        * Creates and adds a tab group to navipane. The number of visible tabs
+        * is 4 unless there are less tabbed views in which case the number of
+        * tabs equal the number of tabbed views.
+        *
+        * @param aActiveViewUid UID of the view whose tab should be activated
+        *                       when the tab group is added to the navi pane.
+        * @param aTabOwner Reference to the owner of the tabbed views.
+        */
+        IMPORT_C void CreateTabGroupL( TUid aActiveViewUid,
+                                       MGSTabbedViewOwner* aTabOwner );
+
+        /**
+        * This function is for plugin implementation.
+        *
+        * Creates and adds a tab group to navipane. The number of visible tabs
+        * is 4 unless there are less tabbed views in which case the number of
+        * tabs equal the number of tabbed views.
+        *
+        * @param aActiveViewUid UID of the view whose tab should be activated
+        *                       when the tab group is added to the navi pane.
+        * @param aTabbedViews References to the views which belong to the tab
+        *                     group.
+        */
+        IMPORT_C void CreateTabGroupL(
+            TUid aActiveViewUid,
+            CArrayPtrFlat<CGSPluginInterface>* aTabbedViews );
+
+       /**
+        * This function is for local view implementation.
+        *
+        * Creates and adds a tab group to navipane. The number of visible tabs
+        * is 4 unless there are less tabbed views in which case the number of
+        * tabs equal the number of tabbed views.
+        *
+        * @param aActiveViewUid UID of the view whose tab should be activated
+        *                       when the tab group is added to the navi pane.
+        * @param aTabbedViews References to the views which belong to the tab
+        *                     group.
+        */
+        IMPORT_C void CreateTabGroupL(
+            TUid aActiveViewUid,
+            CArrayPtrFlat<MGSTabbedView>* aTabbedViews );
+
+        /**
+        * Removes the topmost tab group from navi pane.
+        */
+        IMPORT_C void RemoveTabGroup();
+
+    public: // From MAknTabObserver
+
+        /**
+        * See base class.
+        */
+        IMPORT_C void TabChangedL( TInt aIndex );
+
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSTabHelper();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Container for navigation control object.
+        CAknNavigationControlContainer* iNaviContainer;
+
+        // Navigation decorator object. Created and owned.
+        CAknNavigationDecorator* iNaviDecorator;
+
+        // Tab group.
+        CAknTabGroup* iTabGroup;
+
+        // Pointer to App UI. Not owned.
+        CAknViewAppUi* iAppUi;
+
+        // Pointer to owner (parent) of the tabbed views.
+        MGSTabbedViewOwner* iTabOwner;
+    };
+
+#endif // GSTABHELPER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSTabbedView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*        Header file for MGSTabbedView class.
+*
+*/
+
+
+#ifndef GSTABBEDVIEW_H
+#define GSTABBEDVIEW_H
+
+#include <e32cmn.h>
+
+class CGulIcon;
+
+/**
+* Interface to be used when creating tab groups. Used by CGSTabHelper.
+*
+*/
+class MGSTabbedView
+    {
+    public: // New
+        
+        /**
+        * Creates new icon for tab. Ownership is transferred to client.
+        */
+        virtual CGulIcon* CreateTabIconL() = 0;
+        
+        /**
+        * UID of the tab.
+        */
+        virtual TUid Id() const = 0;
+    
+    };
+    
+#endif // GSTABBEDVIEW_H
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GSTabbedViewOwner.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Header file for MGSTabbedViewOwner class.
+*
+*/
+
+
+#ifndef GSTABBEDVIEWOWNER_H
+#define GSTABBEDVIEWOWNER_H
+
+#include <e32base.h>
+
+class CGSPluginInterface;
+
+/**
+* Interface for MGSTabbedView owner class. Views owning tabbed sub-views
+* implement this.
+*/
+class MGSTabbedViewOwner
+    {
+    public:
+        /**
+        * @return Reference to owned tabbed views which should be included in
+        *         the sub-view's tab group.
+        */
+        virtual CArrayPtrFlat<CGSPluginInterface>* TabbedViews() = 0;
+
+        /**
+        * Parent view implements this to handle switching tabs. This is needed
+        * in case parent view needs to update selected item index according to
+        * tab selection.
+        *
+        * @param selectedTabUid UID of the selected tab item.
+        */
+        virtual void TabChangedL( TUid selectedTabUid ) = 0;
+    };
+
+#endif // GSTABBEDVIEWOWNER_H
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/GeneralSettingsVariant.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef GENERALSETTINGSVARIANT_HRH
+#define GENERALSETTINGSVARIANT_HRH
+
+/** 
+* EGSConfigOTAAutoUpdate is on/off setting for Automatic update of service.
+* When it is set on in TGeneralSettingsLocalVariantFlags OTA is enabled.
+*/
+#define EGSConfigOTAAutoUpdate 0x00000001
+
+/** 
+* EGSConfigAutoRedial is on/off setting for Automatic redial.
+* When it is set on in TGeneralSettingsLocalVariantFlags 
+* automatic redial is enabled.
+*/
+#define EGSConfigAutoRedial 0x00000002
+
+/** 
+* EGSConfig2G3GNetworkIcon is on/off setting for 2G/3G network icon display.
+* When it is set ON in KGeneralSettingsLVFlags 
+* display of 2G/3G icon in network selection list is enabled.
+* Used in GSM/WCDMA builds ONLY.
+*/
+#define EGSConfig2G3GNetworkIcon 0x00000004
+
+/**
+* EGSConfigPowerSaveLed is on/off setting for Power Save LED mode setting.
+* When it is set ON in KGeneralSettingsLVFlags
+* Power Save LED mode item is displayed in the Display settings.
+*/
+#define EGSConfigPowerSaveLed 0x00000008
+
+/**
+* EGSConfigRestrictedSendCallerId is on/off setting for Restricted Send 
+* Caller ID setting.
+* When it is set ON in KGeneralSettingsLVFlags
+* Send Caller ID "Set by network" mode item is hidden in the Call settings.
+*/
+#define EGSConfigRestrictedSendCallerId 0x00000010
+
+/**
+* EGSConfigSecureSendCallerId is on/off setting for Secure Send Caller ID 
+* setting.
+* When it is set ON in KGeneralSettingsLVFlags
+* Send Caller ID mode item can only be changed in the Call settings
+* if a valid security code is entered.
+*/
+#define EGSConfigSecureSendCallerId 0x00000020
+
+/**
+* EGSConfigNoAutoToAutoNetworkSearch is on/off setting for Network search when 
+* the network selection setting is Automatic and the user selects Automatic
+* again. This contradicts the Telefonica request that this should be disabled.
+* 
+* If this value is set, auto-to-auto net search is disabled == Telefonica.
+*
+* Default: Automatic to Automatic Network search is enabled = 0.
+*/
+#define EGSConfigNoAutoToAutoNetworkSearch 0x00000040
+
+/**
+* EGSConfigOperatorIdle is on/off setting for enabling Operator Idle when 
+* this is been supported by the operator. 
+* If this value is set, The user can use the Operator Idle
+* instead of Active Idle.
+* This feature is Operator Specific
+*/
+#define EGSConfigOperatorIdle 0x00000080
+
+
+#endif // GENERALSETTINGSVARIANT_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/MGSSettingPSObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Observer interface for indicating publish and subscribe 
+*				         setting changes
+*
+*/
+
+
+
+
+#ifndef MGSSETTINGPSOBSERVER_H
+#define MGSSETTINGPSOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Observer interface for indicating setting changes
+*
+*  @lib GSTelPlugin
+*  @since 3.1
+*/
+class MGSSettingPSObserver
+    {
+    public:  // New functions
+
+        /**
+        * Handler for setting changed event
+        * @param aUid uid of setting        
+        * @param aId id of setting
+        * @param aStatus status of completed AO operation
+        */
+        virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
+                                      const TRequestStatus& aStatus ) = 0;
+    };
+
+#endif // MGSSETTINGPSOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/inc/MGSWatchDog.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef GSWATCHDOG_INTERFACE_H
+#define GSWATCHDOG_INTERFACE_H
+
+// System includes
+#include <e32base.h>
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+*  MGSWatchDog is responsible for quarantining plugins and updating blacklist
+*  for crashing GS plugins. This is the class responsible for keeping GS
+*  application functional even if some plugin to panics all the time.
+*
+*  This is the interface for GSWatchDog. Client has no need to know the actual
+*  implementation as it is owned by GS application.
+*
+*  @since Series60_3.2
+*/
+class MGSWatchDog
+    {
+    public: // New
+
+        /**
+        * Adds plugin to quarantine. In case GS crashes, quarantined plugin
+        * will be blacklisted so it is not loaded in next GS run. Same plugin
+        * can be quarantined multiple times or even have several uid instances
+        * in quarantine if needed as long as all these are removed
+        * correspondingly.
+        *
+        * NOTE: Plugin must ALWAYS be removed from quarantine after plugin's
+        * function execution.
+        * 1. QuarantineL().
+        * 2. Call quarantined plugin function.
+        * 3. RemoveFromQuarantineL().
+        *
+        * @param aPluginUid uid of the quarantined plugin.
+        */
+        virtual void QuarantineL( TUid aPluginUid ) = 0;
+
+        /**
+        * Removes plugin from quarantine. In case plugin is not removed from
+        * quarantine before GS exits, the plugin will be blacklisted during
+        * next GS startup.
+        *
+        * @param aPluginUid uid of the plugin to be removed from quarantine.
+        */
+        virtual void RemoveFromQuarantineL( TUid aPluginUid ) = 0;
+
+        /**
+        * @return ETrue if GS exited cleanly last time.
+        *         EFalse if GS crashed during last execution.
+        */
+        virtual TBool WasCleanExitL() = 0;
+
+        /**
+        * This must be called in all the cases GS exits normally. If GS panics,
+        * this will not be called resulting in banning of all quarantined
+        * plugins.Increments iRunsAfterCrash counter for blacklisted plugins.
+        * Sets iGSAppRunning to EFalse.
+        */
+        virtual void ReportCleanExitL() = 0;
+
+        /**
+        * Checks if plugin is in blacklist. This can be used to determine if
+        * plugin should be loaded.
+        *
+        * @return ETrue in case plugin is in blacklist and should not be loaded.
+        *         EFalse in case plugin should not be loaded
+        */
+        virtual TBool IsInBlackList( TUid aPluginUid ) = 0;
+
+    };
+
+#endif // GSWATCHDOG_INTERFACE_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/loc/gs.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Common localization strings for General Settings
+*
+*/
+
+
+
+//  LOCALISATION STRINGS
+
+// **OPTIONS MENU
+
+//d:Command in Options list
+//d:Opens the highlighted item
+//l:list_single_pane_t1_cp2
+//w:
+//r: 3.1
+//
+#define qtn_set_options_open "Open"
+
+//d:Command in Options list
+//d:Opens value changing dialog of highlighted item
+//l:list_single_pane_t1_cp2
+//w:
+//r: 3.1
+//
+#define qtn_set_options_change "Change"
+
+// **IMAGE LOADING WAIT NOTE
+
+//d:Text for image loading wait note
+//d:Shown when welcome note image or background image has been selected from image list
+//l:popup_note_wait_window
+//w:
+//r:3.1
+//
+#define qtn_set_loading_image "Loading the image..."
+
+
+// **IMAGE ERROR INFORMATION NOTES
+
+//d:Text for image corrupted information note
+//d:Shown when selected background or welcome note image is corrupted or in wrong format.
+//l:popup_note_window
+//w:
+//r:3.1
+//
+#define qtn_set_image_format_wrong "Image is corrupted or in wrong format. Can not be selected."
+
+//d:Text for image too large information note
+//d:Shown when selected background or welcome note image is too large to be opened 
+//  in memory
+//l:popup_note_window
+//w:
+//r:3.1
+//
+#define qtn_set_image_too_large "Image size is too large. Image can not be selected."
+
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/settings_framework_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="12d79fdf49c0dc289e8341bfc1ae458d" dataversion="2.0">
+  <name>Settings Framework API</name>
+  <description>Loads device settings plug-ins. Provides extensions &amp; utilities for plugins.</description>
+  <type>c++</type>
+  <collection>gssettingsuis</collection>
+  <libs>
+    <lib name="GSFramework.lib" />
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/tsrc/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+../../../../gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp
+gnumakefile settings_framework_api.mk
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_framework_api/tsrc/group/settings_framework_api.mk	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_GSFramework.dll /f
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : do_nothing
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES : do_nothing
+
+FINAL :
+	echo COPYING
+	copy \epoc32\RELEASE\winscw\udeb\MT_GSFramework.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_launch_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   File that exports the files belonging to
+:                Settings Launch API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/GSLauncher.h     MW_LAYER_PLATFORM_EXPORT_PATH(gslauncher.h)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_launch_api/inc/GSLauncher.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Launches GS views.
+*
+*/
+
+
+
+
+#ifndef C_GSLAUNCHER_H
+#define C_GSLAUNCHER_H
+
+#include <e32std.h>
+#include <e32def.h>
+#include <apgtask.h>
+
+
+
+class CGSLauncherExtension;
+/**
+ *  Launches general settings with specific plug-in opened.
+ *  Using this API, a client may request a general settings view to be shown.
+ *  Implementation will launch general settings if it is not yet running. 
+ *
+ *  Example usage of the interface:
+ *  @code
+ *   CGSLauncher* l = CGSLauncher::NewLC();
+ *   l->LaunchGSViewL ( yourPluginUid, TUid::Uid(0), KNullDesC8 ); 
+ *   CleanupStack::PopAndDestroy(l);
+ *  @endcode
+ *
+ *  @lib gslauncher.lib
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS(CGSLauncher) : public CBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructors.
+     */
+    IMPORT_C static CGSLauncher* NewL();
+
+    IMPORT_C static CGSLauncher* NewLC();
+    
+
+    /**
+    * Destructor.
+    */
+    virtual ~CGSLauncher();
+
+    /**
+     * Launches general settings with specific plug-in activated.
+     * Launching of plug-in's local views is not supported. 
+     * General settings application is started if it's not running. 
+     * Any application embedded into general settings will be closed.
+     *
+     * Needs capability: SwEvent
+     * 
+     * @since S60 5.0
+     * @param aTarget 					Target plug-in's view id. (CAknView::Id())
+     * @param aCustomMessageId  For client data. Passed to the plug-in.
+     * @param aCustomMessage  	For client data. Passed to the plug-in.
+     * @return none
+     */
+	IMPORT_C void LaunchGSViewL( const TUid aTarget,const TUid aCustomMessageId
+			,const TDesC8& aCustomMessage );
+
+
+protected:
+
+private:
+
+    CGSLauncher();
+    
+    void ConstructL();
+
+private: // data
+		CGSLauncherExtension* iExt;
+    };
+
+#endif // C_GSLAUNCHER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_launch_api/settings_launch_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,15 @@
+<?xml version="1.0" ?>
+<api id="2a748a91d76641532fe336144ad19a4c" dataversion="2.0">
+<name>Settings launch API</name>
+<description>Launches general settings with spesific view opened. 
+</description>
+<type>c++</type>
+<collection>gssettingsuis</collection>
+<libs><lib name="gslauncher.lib"/>
+</libs>
+<release category="platform" sinceversion="0"/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_launch_api/tsrc/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+../../../../gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp
+gnumakefile settings_launch_api.mk
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_launch_api/tsrc/group/settings_launch_api.mk	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_CGSLauncher.dll /f
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : do_nothing
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES : do_nothing
+
+FINAL :
+	echo COPYING
+	copy \epoc32\RELEASE\winscw\udeb\MT_CGSLauncher.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_listbox_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   File that exports the files belonging to 
+:                Settings listbox API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/GSListBox.h     MW_LAYER_PLATFORM_EXPORT_PATH(gslistbox.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_listbox_api/inc/GSListBox.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*     class description for CGSListBox & CGSListBoxItemTextArray.
+*
+*/
+
+
+
+#ifndef GS_LIST_BOX_H
+#define GS_LIST_BOX_H
+
+#include    <e32base.h>
+#include    <e32std.h>
+#include    <barsread.h>
+#include    <coemain.h>
+
+class CAknRadioButtonSettingPage;
+class CEikListBox;
+
+
+/*================================================
+* CGSListboxEntry: class to map feature->item index when selected
+* from a listbox. This is required when there are features which are
+* dynamically shown/hidden.
+================================================*/
+class CGSListboxEntry : public CBase
+	{
+	public:
+		IMPORT_C static CGSListboxEntry* NewLC( TResourceReader& aReader );
+		IMPORT_C static CGSListboxEntry* NewLC( TInt aFeatureId );
+		IMPORT_C static CGSListboxEntry* NewLC( 
+            TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId );
+			IMPORT_C ~CGSListboxEntry();
+
+	public: // Accessors
+		IMPORT_C TInt FeatureId() const;
+		IMPORT_C const TDesC& Caption() const;
+		IMPORT_C TInt Type() const;
+
+    public: // Manipulators
+		IMPORT_C void SetDynamicTextL( const TDesC& aText );
+		IMPORT_C void SetDynamicTextDoublePaneL( const TDesC& aText );
+
+	private:
+		CGSListboxEntry();
+		void ConstructL( TResourceReader& aReader );
+		void ConstructL( TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId );
+		
+	private:
+		inline TInt StaticTextLength() const { return iStaticTextLength; }
+
+	private:
+
+		/** 
+		 * The length of the static text which does not change
+		 */
+		TInt iStaticTextLength;
+
+		/**
+		 * The static text and dynamic text combined. We can always
+		 * change the dynamic part due to the fact that we know
+		 * the length (prefix) of the static part.
+		 */
+		HBufC* iCaption;
+
+		/**
+		 * One of either EGSListBoxItemTypeIsAlwaysVisible or
+		 * EGSListBoxItemTypeIsDynamic
+		 */
+		TInt iType;
+
+		/**
+		 * The id of this feature
+		 */
+		TInt iFeatureId;
+		
+		/**
+		* Maximum Length of the Dynamic text which doesnot change.. 
+		* This has been added after inclusion Double Pane List Box
+		*/
+		TInt iDynamicTextSize;
+	};
+
+
+
+/*================================================
+================================================*/
+class CGSItemTextArray : public CBase, public MDesCArray
+    {
+	public:
+	    enum TVisibility
+		    {
+		    EInvisible = 0,
+		    EVisible = 1
+		    };
+
+    public:
+        IMPORT_C static CGSItemTextArray* NewL(
+            TUint32 aResId, 
+            CCoeEnv& aEnv );
+		~CGSItemTextArray();
+
+	protected:
+		CGSItemTextArray();
+		void ConstructL( TUint32 aResId, CCoeEnv& aEnv );
+		void ConstructL( TUint32 aResId, CCoeEnv& aEnv, TInt aCount ); 
+		
+    public: // From MDesCArray
+		IMPORT_C TInt MdcaCount() const;
+		IMPORT_C TPtrC MdcaPoint( TInt aIndex ) const;
+
+	public: // API
+		
+		/** 
+		 * Used to add dynamic text to the end of an existing model item
+		 */
+		IMPORT_C void SetDynamicTextL( TInt aFeatureId, 
+            const TDesC& aAdditionalText );
+
+        /** 
+		 * Used to add dynamic text to the end of an existing model item 
+		 * When Double Pane List box is used CAknDoubleStyleListBox
+		 */
+		IMPORT_C void SetDynamicTextDoublePaneL( TInt aFeatureId, 
+            const TDesC& aAdditionalText );
+            
+		/**
+		 * Specify that this item should be visible / invisible in the
+		 * iCurrentlyDisplayedEntries array
+		 */
+		IMPORT_C void SetItemVisibilityL( TInt aFeatureId, 
+            TVisibility aVisibility );
+
+		/**
+		 * Access the id of the currently selected feature
+		 */
+        IMPORT_C virtual TInt CurrentFeature() const;
+
+		/**
+		 * Set the currently selected feature id
+		 */
+        IMPORT_C TInt IndexForFeatureIdL(TInt aFeatureId) const;
+
+		/**
+		 * Returns the feature id corresponding to an index
+		 */
+        IMPORT_C TInt FeatureIdByIndex(TInt aIndex) const;
+
+        /**
+		 * 
+		 */
+		IMPORT_C const CGSListboxEntry* FeatureByIdL( TInt aFeatureId ) const;
+
+        /**
+		 * 
+		 */
+        IMPORT_C static HBufC* GetItemCaptionFromFeatureIdLC(TUint32 aResourceId, TInt aFeatureId, CCoeEnv& aCone);
+
+
+	private:
+		static TBool CompareEntries( const CGSListboxEntry& aLeft, 
+			const CGSListboxEntry& aRight );
+
+
+	protected:
+
+		/**
+		 * All the entries which may potentially be contained within the listbox
+		 * model. This array is owned and destroyed by this class.
+		 */
+		RPointerArray< CGSListboxEntry > iAllEntries;
+
+		/**
+		 * The entries which are currently displayed within the listbox. These
+		 * pointers are actually owned in the iAllEntries array and therefore
+		 * this array must not be 'ResetAndDestroyed()' (but rather just Reset())
+		 * from within this class' destructor.
+		 */
+		RPointerArray< CGSListboxEntry > iCurrentlyDisplayedEntries;
+    };
+
+
+/*================================================
+================================================*/
+class CGSRadioButtonSettingPageItemTextArray : public CGSItemTextArray
+    {
+	public:
+		IMPORT_C static CGSRadioButtonSettingPageItemTextArray* NewL(
+            TUint32 aResId, 
+            CCoeEnv& aEnv,
+			CAknRadioButtonSettingPage* aSettingPage = NULL
+            );
+
+	private:
+		CGSRadioButtonSettingPageItemTextArray( CAknRadioButtonSettingPage* aSettingPage  );
+
+    public: // FROM CGSItemTextArray
+    	IMPORT_C TInt CurrentFeature() const;
+
+    public: // New API
+        IMPORT_C void SetRadioButtonSettingPage( CAknRadioButtonSettingPage& aPage );
+
+	private:
+
+		/**
+		 * Underlying setting page
+		 */
+		CAknRadioButtonSettingPage* iSettingPage;
+    };
+
+
+
+/*================================================
+* CGSListBoxItemTextArray: This class acts as a wrapper class for
+* CGSListboxEntry. Instance of this class is created from the
+* calling function.
+================================================*/
+class CGSListBoxItemTextArray : public CGSItemTextArray
+	{
+	public:
+		IMPORT_C static CGSListBoxItemTextArray* NewL(
+            TUint32 aResId, 
+			CEikListBox& aListBox,
+            CCoeEnv& aEnv );
+        IMPORT_C static CGSListBoxItemTextArray* NewL( 
+            TUint32 aResId, 
+            CEikListBox& aListBox, 
+            CCoeEnv& aEnv, 
+            TInt aCount );
+            
+ 	private:
+		CGSListBoxItemTextArray( CEikListBox& aListBox );
+
+    public: // FROM CGSItemTextArray
+    	IMPORT_C TInt CurrentFeature() const;
+
+	private:
+
+		/**
+		 * Underlying listbox
+		 */
+		CEikListBox& iListBox;
+	};
+
+#endif //GS_LIST_BOX_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_listbox_api/settings_listbox_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="c7072e0723fe3453a3fab8d556413ad2" dataversion="2.0">
+  <name>Settings listbox API</name>
+  <description>Helper to show listbox in device settings plugins</description>
+  <type>c++</type>
+  <collection>gssettingsuis</collection>
+  <libs>
+    <lib name="GSListBox.lib" />
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_listbox_api/tsrc/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+../../../../gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp
+gnumakefile settings_listbox_api.mk
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_listbox_api/tsrc/group/settings_listbox_api.mk	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSBackgroundImage.dll /f
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : do_nothing
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES : do_nothing
+
+FINAL :
+	echo COPYING
+	copy \epoc32\RELEASE\winscw\udeb\T_GSBackgroundImage.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   File that exports the files belonging to 
+:                Settings Plugin API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/GSPluginInterface.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsplugininterface.h)
+../inc/GSFWViewUIDs.h     MW_LAYER_PLATFORM_EXPORT_PATH(gsfwviewuids.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/inc/GSFWViewUIDs.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   View UIDs for GS FW
+* These UIDs are used to identify the parent of the view/plugin. The same UID
+* is used for both plugin and view identification.
+*
+*/
+
+
+#ifndef GSFWVIEWUIDS_H
+#define GSFWVIEWUIDS_H
+
+
+// Use this UID if plugin belongs to Main view:
+const TUid KGSMainViewUid = { 0x1020723B };
+
+
+// No item is selected in the container's listbox
+const TUid KGSNoneSelected = { 0x00000000 };
+
+// UIDs used by the sub-view plugins:
+
+// Use this UID if plugin belongs to General view:
+const TUid KGSGenPluginUid  = { 0x10207237 };
+
+// Use this UID if plugin belongs to Telephony view:
+const TUid KGSTelPluginUid  = { 0x1020723D };
+
+// Use this UID if plugin belongs to Connection view:
+const TUid KGSConPluginUid  = { 0x10207250 };
+
+// Use this UID if plugin belongs to Applications view:
+const TUid KGSAppsPluginUid = { 0x10207239 };
+
+// Use this UID if plugin belongs to Personalisation view:
+const TUid KGSPrslnPluginUid = { 0x10207252 };
+
+// Use this UID if plugin belongs to Security view:
+const TUid KGSSecurityPluginUid = { 0x1020743A };
+
+// Use this UID if plugin belongs to Standby view:
+const TUid KGSStandbyPluginUid = { 0x1020743F };
+
+// UID of General Settings application.
+// This UID is used for accessing the help IDs controlled by GS help files
+const TUid KUidGS = { 0x100058EC };
+
+// Use this UID if plugin belongs to Packet Data:
+const TUid KGSPDataPluginUid = { 0x1020724E };
+
+// Use this UID if plugin belongs to Interaction:
+const TUid KGSInteractionPluginUid = { 0x10283343 };
+
+// Use this UID if plugin belongs to Administration:
+const TUid KGSAdminPluginUid = { 0x10283341 };
+
+// Use this UID if plugin belongs to Device Management:
+const TUid KGSDeviceManagementPluginUid = { 0x10283317 };
+
+// Use this UID if plugin belongs to Device Updates:
+const TUid KGSDeviceUpdatesPluginUid = { 0x1028331B };
+
+// Use this UID if plugin belongs to Synchronisation view:
+const TUid KGSSynchronisationPluginUid = { 0x10283319 };
+
+// Use this UID if plugin belongs to Installations view:
+const TUid KGSInstallationsPluginUid = { 0x10283321 };
+
+#endif // GSFWVIEWUIDS_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/inc/GSPluginInterface.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,420 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Header file for CGSPluginInterface class.
+*
+*/
+
+
+#ifndef GSPLUGININTERFACE_H
+#define GSPLUGININTERFACE_H
+
+// System includes
+#include <GSFrameworkRsc.rsg> // For default icons
+#include <gsfwicon.mbg>
+
+#include <aknview.h>
+#include <aknViewAppUi.h>
+#include <gulicon.h>
+#include <AknsUtils.h>
+#include <aknViewAppUi.h>
+#include <data_caging_path_literals.hrh>
+
+// Constant for plugin interface:
+const TUid KGSPluginInterfaceUid        = { 0x10207236 };
+
+// Constant for listbox icon type:
+const TUid KGSIconTypeLbxItem           = { 0x10207357 };
+// Constant for listbox settings item icon type:
+const TUid KGSIconTypeLbxSettingsItem   = { 0x102750C5 };
+// Constant for tab icon type:
+const TUid KGSIconTypeTab               = { 0x10207358 };
+// Constant for icon in D-Column:
+const TUid KGSIconTypeDColumn           = { 0x10207359 };
+
+
+// Constant for indexing (iOrder):
+const TInt KGSPluginNotIndexed      = -1;
+
+_LIT( KGSDefaultIconFileName, "Z:Gsfwicon.mbm" );
+
+/**
+* This enum is used for defining custom operations types.
+*/
+enum TGSCustomOperationType
+    {
+    // This operation type returns current status of the plugin's view.
+    // If the plugin's view is active, ETrue will be returned, otherwise
+    // EFalse. Currently supported by GSStandbyPlugin.
+    EGSCustomOperationViewActive = 1
+    };
+
+/**
+* Used by GetValue(). These are the keys for retrieving a specific
+* value. This enum can be extended to provide other values as well as
+* long as the original keys are not changed.
+*/
+enum TGSPluginValueKeys
+    {
+    // Value for this key is the localized string to be shown in the second row
+    // of a listbox item. Plugins providing second row of text should provide
+    // value for this key. Second row of list item text is used for following
+    // listbox types:
+    //  - EGSListBoxTypeSingleLarge
+    //  - EGSListBoxTypeDouble2Large.
+    // For plugins listed in these listbox types, second row value can either
+    // be defined or left empty.
+    EGSPluginKeySettingsItemValueString = 1,
+    // Localized string to be used in case of custom MSK and menu activation
+    // item. See TGSMenuActivationItems.
+    EGSCustomMenuActivationText
+    };
+
+/**
+* Used by PluginItemType(). These enumerations define the desired appearance
+* of the plugin in a parent plugin's listbox. Please notice that the parent
+* listbox type cannot be altered by a child plugin so plugins using these must
+* be aware of the parent plugin listbox type. Safest alternative is to leave
+* default implementation for ItemType() in which case EGSItemTypeSingleLarge is
+* used. This should fit most of the listbox types. Additionall types can be
+* implemented and defined as long as the old enumerations will not be changed.
+*
+* Different type of items are handled differently:
+* - In case of CAknView type items, such as EGSItemTypeSingleLarge and
+*   EGSItemTypeSetting, the plugin's DoActivate() is called when user selects
+*   the item.
+* - In case of items supporting dialogs, such as EGSItemTypeSettingDialog and
+*   EGSItemTypeSettingIconDialog, HandleSelection() is called instead of
+*   DoActivate().
+*
+* Item types can be described in a matrix:
+* X: Normal list tems with large icon,
+*    settings items,
+*    settings items with icon
+* Y: Items providing CAknView - activated by DoActivate(),
+*    items providing dialog - activated by HandleSelection()
+*
+* All combinations of these are not allowed/supported.
+*/
+enum TGSListboxItemTypes
+    {
+    // CAknSingleLargeStyleListBox item:
+    // Caption of the item is a descriptor from GetCaptionL().
+    // Icon is from CreateIconL( KGSIconTypeLbxItem ).
+    EGSItemTypeSingleLarge = 1, // Default
+    // CAknSettingStyleListBox item providing a CAknView:
+    // 1st row content is a descriptor from GetCaptionL()
+    // 2nd row content is a descriptor (can be empty string id needed) from
+    //    GetValue( ..., EGSPluginKeySettingsItemValueString ).
+    EGSItemTypeSetting,
+    // CAknSettingStyleListBox item providing a CAknView:
+    // 1st row content is a descriptor from GetCaptionL()
+    // 2nd row content is a icon from CreateIconL( KGSIconTypeLbxSettingsItem )
+    // GetValue(, EGSPluginKeySettingsItemValueString ).
+    EGSItemTypeSettingIcon,
+    // CAknSettingStyleListBox item launching a dialog:
+    // 1st row content is a descriptor from GetCaptionL()
+    // 2nd row content is a descriptor (can be empty string id needed) from
+    //    GetValue( ..., EGSPluginKeySettingsItemValueString ).
+    EGSItemTypeSettingDialog,
+    // CAknSingleLargeStyleListBox item launching a dialog:
+    // Caption of the item is a descriptor from GetCaptionL().
+    // Icon is from CreateIconL( KGSIconTypeLbxItem ).
+    EGSItemTypeSingleLargeDialog
+    };
+
+/**
+* These are used to define the type of the menu item which opens the selected
+* plugin. By default, parent plugin's menu has 'Open' item for child plugins.
+* If parent plugin's menu must have 'Change' instead of 'Open' for activating
+* the plugin, use EGSMenuActivationItemChange. This functionality is just for
+* the visual aspects for views in GS - requested by UI design. Plugins are
+* handled logically similarly regardless this value.
+*/
+enum TGSMenuActivationItems
+    {
+    // Default - will use the item defined in menu resource.
+    EGSMenuActivationItemDefault = 0,
+    // Menu should contain 'Open' Item.
+    EGSMenuActivationItemOpen = 1,
+    // Menu should contain 'Change' item.
+    EGSMenuActivationItemChange,
+    // Menu should contain custom text which is defined by GetValue() function:
+    // GetValue( EGSCustomMenuActivationText, ... );
+    // NOTE: When this custom menu item is selected, used menu command ID is
+    // EGSCmdAppChange. This might be checked in for example plugin's
+    // HandleCommand(). If text is empy, MSK is empty and there's no
+    // corresponding item in options menu.
+    EGSMenuActivationItemCustom
+    };
+
+/**
+* Selection types. Used in HandleSelection().
+*/
+enum TGSSelectionTypes
+    {
+    // User selected the item by pressing selection key.
+    EGSSelectionBySelectionKey = 1,
+    // User selected the item by selecting a command from the menu.
+    EGSSelectionByMenu
+    };
+
+/**
+* Interface class for GS plugin. All GS plugins will implement this class.
+*
+* The main functionality GS framework will use from CAknView is:
+* -DoActivate()
+* -DoDeactivate()
+* -Id()
+* functions.
+*
+* Id() function must return the value of the plugin implementation UID. This
+* means that the main view of the plugin will have the same UID as the plugin
+* implementation. This will prevent multiple plugins from having same view
+* UIDs as their main view. If plugin has more views, it is plugin's
+* responsibility to ensure that the UIDs of the other views are unique. This
+* can be done for example reserving a unique UID from Symbian.
+*
+* Most of the functions have implementation using default values. Override
+* functions if different values or implementations are desired.
+*
+* CGSPluginInterface UID = 0x10207236
+*
+* See GSFWViewUIDs.h for plugin UIDs.
+*
+* Plugin implementation UID will be used when defining the parent view of a
+* plugin. If plugin belongs to application settings view, set the
+* ApplicationSettingsView plugin implementation Uid as a value in the plugin's
+* default_data field in plugin's implementation info resource file.
+*
+* Needed libraries (at least):
+* GSEcomPlugin.lib
+* GSFramework.lib
+* egul.lib
+* aknskins.lib
+* efsrv.lib
+*
+* @lib GSFramework.lib
+* @since Series60_3.1
+*/
+class CGSPluginInterface: public CAknView
+    {
+
+    // CGSPluginLoader accesses iOrder which should not be accessed outside.
+    friend class CGSPluginLoader;
+
+    public: // Constructors & destructors
+
+        /**
+        * Creates new GS plugin having the given UID.
+        * Uses Leave code KErrNotFound if implementation is not found.
+        *
+        * @param aImplementationUid Implementation UID of the plugin to be
+        *        created.
+        * @param aInitParams Plugin's initialization parameters. Make sure you know
+        *        what the plugin expects as initialization parameters. This
+        *        should be an agreement between the plugin client and the
+        *        plugin. Parameter can be used for example as sharing a common
+        *        data model between multiple plugins.
+        */
+        IMPORT_C static CGSPluginInterface* NewL(
+            const TUid aImplementationUid,
+            TAny* aInitParams );
+
+        /**
+        * Destructor
+        */
+        IMPORT_C ~CGSPluginInterface();
+
+    public: // New
+
+        /**
+        * Method for getting caption of this plugin. This should be the
+        * localized name of the settings view to be shown in parent view.
+        *
+        * @param aCaption pointer to Caption variable
+        */
+        virtual void GetCaptionL( TDes& aCaption ) const = 0;
+
+        /**
+        * Function for getting plugin's value for a certain key.
+        * Override to provide own functionality.
+        *
+        * @param aKey Key for the value to be retrieved.
+        * @parem aValue Value for the given gey in TDes format.
+        */
+        IMPORT_C virtual void GetValue( const TGSPluginValueKeys aKey,
+                                        TDes& aValue );
+
+        /**
+        * This function is called in case plugin is an item in a settings
+        * listbox and user selects the item. Override this if plugin needs to
+        * provide functionality for item selection.
+        *
+        * Default implementation activates the plugin.
+        * @param aSelectionType Defines how user selected the plugin. See
+        *        TGSSelectionTypes.
+        */
+        IMPORT_C virtual void HandleSelection(
+            const TGSSelectionTypes aSelectionType );
+
+        /**
+        * This defines the appearance of the plugin in a parent plugin listbox.
+        * Default value is EGSItemTypeSingleLarge. Please notice that the
+        * parent listbox type cannot be defined by a child plugin so plugins
+        * using these must be aware of the parent plugin listbox type.
+        *
+        * @return Desired listbox presentation and functional type for the
+        *         plugin.
+        */
+        IMPORT_C virtual TGSListboxItemTypes ItemType();
+
+        /**
+        * This function is only used for child plugins. Defines the dynamic
+        * menu item that activates this plugin from parent plugin. This menu
+        * item will override the item defined in resource file. Normally
+        * 'Open' is used to open the child plugin. Override this to change the
+        * activation to for example 'Change'. TGSMenuActivationItems defines the
+        * different possible menu items that can be used to open this plugin.
+        *
+        * Note: This also defines MSK. Menu activation item and MSK have
+        *       identical label and behaviour. An exception to this is
+        *       when custom text is empty: in this case MSK is empty but there
+        *       is no item in options menu (no empty item in menu).
+        *
+        * @ return Type of the menu item and MSK that should activate this
+        *          child plugin from parent plugin.
+        */
+        IMPORT_C virtual TGSMenuActivationItems MenuActivationItem();
+
+        /**
+        * Creates a new icon of desired type. Override this to provide custom
+        * icons. Othervise default icon is used for KGSIconTypeLbxItem. Other
+        * icons are empty. Ownership of the created icon is transferred to the
+        * caller.
+        * NOTE: Return NULL if icon is not to be displayed.
+        *
+        * Icon type UIDs (use these defined constants):
+        * KGSIconTypeLbxItem            - ListBox item icon.
+        * KGSIconTypeLbxSettingsItem    - Settings item icon.
+        * KGSIconTypeTab                - Tab icon.
+        * KGSIconTypeDColumn            - Small icon in D-column.
+        *
+        * @param aIconType UID Icon type UID of the icon to be created.
+        * @return Pointer of the icon or NULL.
+        */
+        IMPORT_C virtual CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * Method for reading the ID of the plugin provider category. See
+        * TGSPluginProviderCategory. PluginProviderCategory can be used for
+        * sorting plugins.
+        *
+        * Default value is EGSPluginProvider3rdParty. Override this function
+        * to change the category.
+        *
+        * @return Plugin provider category ID defined by
+        *         TGSPluginProviderCategory
+        */
+        IMPORT_C virtual TInt PluginProviderCategory() const;
+
+        /**
+        * Reserved for future use/plugin's custom functionality. This can be
+        * overwritten if plugin needs to have custom functionality which cannot
+        * be fulfilled otherwise.
+        *
+        * Use TGSCustomOperationType enumeration as aParam1 to
+        * define operation type.
+        */
+        IMPORT_C virtual TAny* CustomOperationL( TAny* aParam1, TAny* aParam2 );
+
+        /**
+        * Method for checking, if plugin should be visible and used in GS FW.
+        * (for example shown in listbox of the parent view).
+        *
+        * On default plugin is visible. Overwrite this function to enable or
+        * disable your plugin dynamically.
+        *
+        * @return ETrue if plugin should be visible in GS.
+        * @return EFalse if plugin should not be visible in GS.
+        */
+        IMPORT_C virtual TBool Visible() const;
+
+        /**
+        * Resets plugin's selected item index if this is supported. Default
+        * implementation does nothing. This is needed when navigating from
+        * child plugin back to parent plugin. In this case child plugin should
+        * reset selected index in its listbox.
+        */
+        IMPORT_C virtual void ResetSelectedItemIndex();
+
+        /**
+        * Sets the Index of the plugin in listbox. Used for CGSPluginLoader. Default
+        * value is KGSPluginNotIndexed which means not ordered. This value is
+        * read, if defined, from the opaque_data field of the plugin's resource
+        * definition. Index starts from 0.
+        */
+        IMPORT_C void SetOrder( TInt aOrder );
+
+        /**
+        * In case plug-in is loaded outside GS application and CGSPluginLoader,
+        * cleaning up plug-in's ECOM resources must be done manually.
+        *
+        * Example:
+        * CGSPluginInterface* myPlugin = CGSPluginInterface::NewL(...);
+        * REComSession::DestroyedImplementation( myPlugin->GetEcomDestructorKey() );
+        * delete myPlugin;
+        *
+        * @return UID of the plug-in instance which can be used to free dependent ECOM resources.
+        */
+        IMPORT_C TUid GetEcomDestructorKey();
+
+    protected: // New
+
+        /**
+        * C++ constructor.
+        */
+        IMPORT_C CGSPluginInterface();
+
+    public: // Enumerations
+
+        /**
+        * Category of the plugin provider. Provider's type affects the sorting
+        * of the plugins. Type EGSPluginProvider3rdParty plugins are allowed
+        * to be loaded only by Applications-plugin. Other categories may exist
+        * but they should be used only internally.
+        **/
+        enum TGSPluginProviderCategory
+            {
+            EGSPluginProviderOEM        = 1,
+            EGSPluginProviderOperator   = 2,
+            EGSPluginProvider3rdParty   = 3
+            };
+
+    private: // Data
+
+        // ECOM plugin instance UID.
+        TUid iDtor_ID_Key;
+
+        /**
+        * Index of the plugin in listbox. Used for CGSPluginLoader. Default
+        * value is KGSPluginNotIndexed which means not ordered. This value is
+        * read, if defined, from the opaque_data field of the plugin's resource
+        * definition. Index starts from 0.
+        */
+        TInt iOrder;
+
+    };
+
+#endif // GSPLUGININTERFACE_H
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/settings_plugin_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="d9f1332a2646ec1682d75cdad92192ae" dataversion="2.0">
+  <name>Settings Plugin API</name>
+  <description>API for the device settings plug-ins.</description>
+  <type>c++</type>
+  <collection>gssettingsuis</collection>
+  <libs>
+    <lib name="GSEcomPlugin.lib" />
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/bwins/SettingsPluginApiTestu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/tcSettingsPluginApiTest.cfg	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,21 @@
+#1
+[Test]
+title GetValue
+run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 1
+[Endtest] 
+#2 
+[Test]
+title MenuActivationItem 
+run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 2
+[Endtest] 
+#3
+[Test]
+title Visible
+run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 3 
+[Endtest]
+#4
+[Test]
+title ResetSelectedItemIndex
+run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 4 
+[Endtest]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/ui_SettingsPluginApiTest.cfg	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,31 @@
+#1
+[Test]
+title  CallGetValueL
+create SettingsPluginApiTest foobar
+foobar CallGetValueL
+delete foobar
+[Endtest] 
+#2
+[Test]
+title  CallMenuActivationItemL
+create SettingsPluginApiTest foobar
+foobar CallMenuActivationItemL
+delete foobar
+[Endtest] 
+#3
+[Test]
+title  CallVisibleL
+create SettingsPluginApiTest foobar
+foobar CallVisibleL
+delete foobar
+[Endtest] 
+#4
+[Test]
+title  CallResetSelectedItemIndexL
+create SettingsPluginApiTest foobar
+foobar CallResetSelectedItemIndexL
+delete foobar
+[Endtest] 
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/eabi/SettingsPluginApiTestu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI13CTestGSPlugin @ 2 NONAME ; #<TI>#
+	_ZTV13CTestGSPlugin @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Personalisation application localised resource IBY
+*
+*/
+
+
+/*
+-----------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    stiftestframework_SettingsPluginApiTest.iby file specifies needed test components for
+    ROM image
+
+-----------------------------------------------------------------------------
+*/
+
+#ifndef SETTINGSPLUGINAPITEST__IBY
+#define SETTINGSPLUGINAPITEST__IBY
+
+file=ABI_DIR\BUILD_DIR\SettingsPluginApiTest.DLL                SHARED_LIB_DIR\SettingsPluginApiTest.DLL
+
+data=\epoc32\data\z\system\data\testframework_SettingsPluginApiTest.ini       testframework\testframework_SettingsPluginApiTest.ini
+
+data=\epoc32\data\z\system\data\tcSettingsPluginApiTest.cfg                   testframework\tcSettingsPluginApiTest.cfg
+
+data=\epoc32\data\z\system\data\ui_SettingsPluginApiTest.cfg                  testframework\ui_SettingsPluginApiTest.cfg
+
+#endif // SETTINGSPLUGINAPITEST__IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Project specification file of  DasClientApiTest
+*
+*/
+
+
+#include <data_caging_paths.hrh> 
+#include <platform_paths.hrh>
+
+TARGET          SettingsPluginApiTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         SettingsPluginApiTest.def
+
+
+#ifdef SBSV2
+    USERINCLUDE     ../inc 
+
+    APP_LAYER_SYSTEMINCLUDE
+
+    SOURCEPATH      ../src
+#else // SBSV2 not defined
+USERINCLUDE     ..\inc 
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ..\src
+#endif // SBSV2
+
+SOURCE          SettingsPluginApiTest.cpp
+SOURCE          SettingsPluginApiTestblocks.cpp 
+SOURCE          TestGSPlugin.cpp
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY			avkon.lib
+LIBRARY         cone.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         eiksrv.lib
+LIBRARY 		GSFramework.lib
+LIBRARY 		GSEcomPlugin.lib
+  
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.pkg	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,63 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: Installation file for STIF
+;
+;
+;
+;
+; Installation file for STIF
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\udeb\SettingsPluginApiTest.dll"   -   "!:\Sys\Bin\SettingsPluginApiTest.dll"
+"\epoc32\winscw\c\SettingsPluginApiTest.bat"-"!:\SettingsPluginApiTest.bat"
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for project SettingsPluginApiTest
+*
+*/
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+
+#ifdef SBSV2
+    PRJ_TESTEXPORTS
+    SettingsPluginApiTest.iby                              /epoc32/rom/include/SettingsPluginApiTest.iby
+    ../init/SettingsPluginApiTest.bat		               /epoc32/winscw/c/SettingsPluginApiTest.bat
+    
+    ../init/testframework_SettingsPluginApiTest.ini        /epoc32/data/z/system/data/testframework.ini
+    ../init/testframework_SettingsPluginApiTest.ini        /epoc32/winscw/c/TestFramework/testframework.ini
+    ../init/testframework_SettingsPluginApiTest.ini        /epoc32/wins/c/TestFramework/testframework.ini
+
+    ../conf/ui_SettingsPluginApiTest.cfg                   /epoc32/winscw/c/TestFramework/ui_SettingsPluginApiTest.cfg
+    ../conf/ui_SettingsPluginApiTest.cfg                   /epoc32/data/z/system/data/ui_SettingsPluginApiTest.cfg
+    ../conf/ui_SettingsPluginApiTest.cfg                   /epoc32/wins/c/ui_SettingsPluginApiTest.cfg
+
+    ../conf/tcSettingsPluginApiTest.cfg                    /epoc32/wins/c/TestFramework/tcSettingsPluginApiTest.cfg
+    ../conf/tcSettingsPluginApiTest.cfg                    /epoc32/data/z/system/data/tcSettingsPluginApiTest.cfg
+    ../conf/tcSettingsPluginApiTest.cfg                    /epoc32/winscw/c/TestFramework/tcSettingsPluginApiTest.cfg
+    
+#else // SBSV2 not defined
+    PRJ_TESTEXPORTS
+
+    SettingsPluginApiTest.iby                              \epoc32\rom\include\SettingsPluginApiTest.iby
+    ..\init\SettingsPluginApiTest.bat		               \epoc32\winscw\c\SettingsPluginApiTest.bat
+    
+    ..\init\testframework_SettingsPluginApiTest.ini        \epoc32\data\z\system\data\testframework.ini
+    ..\init\testframework_SettingsPluginApiTest.ini        \epoc32\winscw\c\TestFramework\testframework.ini
+    ..\init\testframework_SettingsPluginApiTest.ini        \epoc32\wins\c\TestFramework\testframework.ini
+
+    ..\conf\ui_SettingsPluginApiTest.cfg                   \epoc32\winscw\c\TestFramework\ui_SettingsPluginApiTest.cfg
+    ..\conf\ui_SettingsPluginApiTest.cfg                   \epoc32\data\z\system\data\ui_SettingsPluginApiTest.cfg
+    ..\conf\ui_SettingsPluginApiTest.cfg                   \epoc32\wins\c\ui_SettingsPluginApiTest.cfg
+
+    ..\conf\tcSettingsPluginApiTest.cfg                    \epoc32\wins\c\TestFramework\tcSettingsPluginApiTest.cfg
+    ..\conf\tcSettingsPluginApiTest.cfg                    \epoc32\data\z\system\data\tcSettingsPluginApiTest.cfg
+    ..\conf\tcSettingsPluginApiTest.cfg                    \epoc32\winscw\c\TestFramework\tcSettingsPluginApiTest.cfg
+
+#endif // SBSV2
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+SettingsPluginApiTest.mmp
+
+PRJ_MMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/SettingsPluginApiTest.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSettingsPluginApiTest
+*
+*/
+
+
+#ifndef C_SETTINGSPLUGINAPITEST_H
+#define C_SETTINGSPLUGINAPITEST_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <aknserverapp.h> 
+#include <GSPluginInterface.h>
+
+#include "TestGSPlugin.h"
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+// User MACROS
+#define KErrGeneral     -2
+#define KFirstOption    1
+#define KSecondtOption  2
+
+//define client flags
+#define KFlagNoObserver     1
+#define KFlagReserved1      2
+#define KFlagReserved2      4
+// Logging path
+_LIT( KSettingsPluginApiTestLogPath, "\\logs\\testframework\\SettingsPluginApiTest\\" ); 
+// Log file
+_LIT( KSettingsPluginApiTestLogFile, "SettingsPluginApiTest.txt" ); 
+_LIT( KSettingsPluginApiTestLogFileWithTitle, "SettingsPluginApiTest_[%S].txt" );
+
+//
+/**
+*  CSettingsPluginApiTest test class for STIF Test Framework TestScripter.
+*  @since S60 5.0
+*/
+
+NONSHARABLE_CLASS(CSettingsPluginApiTest) : public CScriptBase/*,public MAknServerAppExitObserver*/
+    {
+public:  // Constructors and destructor
+
+    /**
+    * Two-phased constructor.
+    */
+    static CSettingsPluginApiTest* NewL( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CSettingsPluginApiTest();
+    
+/*private:
+    //function from MAknServerAppExitObserver. is used to handle the exit of the server.
+    
+    void HandleServerAppExit(TInt aReason);*/
+
+public: // Functions from base classes
+
+    /**
+    * From CScriptBase Runs a script line.
+    * @since S60 5.0
+    * @param aItem Script line containing method name and parameters
+    * @return Symbian OS error code
+    */
+    virtual TInt RunMethodL( CStifItemParser& aItem );
+    
+private:
+
+    /**
+    * C++ default constructor.
+    */
+    CSettingsPluginApiTest( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+
+    /**
+    * Frees all resources allocated from test methods.
+    * @since S60 5.0
+    */
+    void Delete();
+
+    /**
+    * Test method.
+    * @since S60 5.0
+    * @param aItem Script line containing parameters.
+    * @return Symbian OS error code.
+    */ 
+
+    TInt SetupCGSParentPluginL();
+    
+    virtual TInt CallGetValueL( CStifItemParser& aItem );
+    
+    virtual TInt CallMenuActivationItemL( CStifItemParser& aItem );
+    
+    virtual TInt CallVisibleL( CStifItemParser& aItem );
+    
+    virtual TInt CallResetSelectedItemIndexL( CStifItemParser& aItem );
+    
+    /**
+     * Method used to log version of test class
+     */
+    void SendTestClassVersion();
+    
+    /**
+     * Turn off ScreenSaver
+     * @since S60 5.0
+     * @return Symbian OS error code.
+     */
+    void TurnOffScreenSaver();
+
+    /**
+     * Restore ScreenSaver
+     * @since S60 5.0
+     * @return Symbian OS error code.
+     */
+    void RestoreScreenSaver();
+
+private:    // Data
+
+    /**
+     * ScreenSaver Property
+     */
+    TInt iOldScreenSaverProperty;
+    
+    CTestGSPlugin* iTestGsPlugin;
+    
+    /**
+     * description_of_pointer_member
+     * Not own.
+     */
+    CGSPluginInterface* iGSPluginInterface;
+    
+    };
+
+#endif      // C_SETTINGSPLUGINAPITEST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/TestGSPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef TESTGSPLUGIN_H
+#define TESTGSPLUGIN_H
+
+// INCLUDES
+#include    <GSParentPlugin.h>
+
+
+
+// CLASS DECLARATION
+
+class CTestGSPlugin : public CGSParentPlugin
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static CTestGSPlugin* NewL();
+        static CTestGSPlugin* NewLC();
+        /**
+         * Destructor
+         */
+        ~CTestGSPlugin();
+
+        
+    public:
+    
+    	void GetCaptionL( TDes& aCaption ) const;
+    	
+    	TUid Id() const;
+    	
+    private:    // Constructors and destructors
+
+        CTestGSPlugin();
+        void ConstructL();
+
+    };
+
+#endif // TESTGSPLUGIN_H
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/SettingsPluginApiTest.bat	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,21 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+md e:\bctest
+md e:\bctest\Results
+
+ATSINTERFACE.EXE -testmodule testcombiner -config C:\TestFramework\uiSettingsPluginApiTest.cfg
+copy c:\Logs\TestFramework\TestReport.txt e:\bctest\results\SETTINGS_TEST.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/testframework_SettingsPluginApiTest.ini	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,181 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+# - Set Test Reporting mode. TestReportMode's possible values are:
+#     + 'Summary': Summary of the tested test cases.
+#     + 'Environment': Hardware and software info.
+#     + 'TestCases': Test case report.
+#     + 'FullReport': Set of all above ones.
+#     + Example 'TestReportMode= Summary TestCases'
+#
+#     - CreateTestReport setting controls report creation mode
+#     + YES, Test report will created.
+#     + NO, No Test report.
+#
+#     - File path indicates the base path of the test report.
+#     - File name indicates the name of the test report.
+#
+#     - File format indicates the type of the test report.
+#     + TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#     + HTML, Test report will be html type, for example 'TestReport.html'.
+#
+#     - File output indicates output source of the test report.
+#     + FILE, Test report logging to file.
+#     + RDEBUG, Test report logging to using rdebug.
+#
+#     - File Creation Mode indicates test report overwriting if file exist.
+#     + OVERWRITE, Overwrites if the Test report file exist.
+#     + APPEND, Continue logging after the old Test report information if 
+#           report exist.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE    # Possible values: OVERWRITE or APPEND
+UITestingSupport= Yes
+SeparateProcesses= YES
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= SettingsPluginApiTest
+# Modules might have initialisation file, specified as
+# IniFile= YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= NormalCases.txt
+# TestCaseFile= SmokeCases.txt
+# TestCaseFile= ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testcombiner
+TestCaseFile= c:\testframework\tcSettingsPluginApiTest.cfg
+[End_Module]
+
+#[New_Module]
+#ModuleName= testscripter
+#TestCaseFile= c:\testframework\ui_SettingsPluginApiTest.cfg
+#[End_Module]
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+#Load testmoduleSettingsPluginApiTest, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleSettingsPluginApiTest used initialization file
+#IniFile= init.txt
+
+#TestModuleSettingsPluginApiTest used configuration file(s)
+#TestCaseFile= testcases1.cfg
+#TestCaseFile= testcases2.cfg
+#TestCaseFile= manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# Hardware and emulator environment logging path and styles can
+# be configured from here to overwrite the Logger's implemented values.
+#	
+# Settings description:
+# - Indicates option for creation log directory/directories. If log directory/directories
+#       is/are not created by user they will make by software.
+#     + YES, Create log directory/directories if not allready exist.
+#     + NO, Log directory/directories not created. Only created one is used.
+#
+# - Overwrite emulator path setting.
+#     + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#       Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#       will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+# - Overwrite emulator's logging format.
+#     + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#     + HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+# - Overwrited emulator logging output source.
+#     + FILE, Logging to file(s).
+#     + RDEBUG, Logging to using rdebug(s).
+#
+# - Overwrite hardware path setting (Same description as above in emulator path).
+# - Overwrite hardware's logging format(Same description as above in emulator format).
+# - Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+# - File Creation Mode indicates file overwriting if file exist.
+#     + OVERWRITE, Overwrites if file(s) exist.
+#     + APPEND, Continue logging after the old logging information if file(s) exist.
+#
+# - Will thread id include to the log filename.
+#     + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#     + NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+# - Will time stamps include the to log file.
+#     + YES, Time stamp added to each line in log file(s). Time stamp is 
+#       for example'12.Nov.2003 115958 LOGGING INFO'
+#     + NO, No time stamp(s).
+#
+# - Will line breaks include to the log file.
+#     + YES, Each logging event includes line break and next log event is in own line.
+#     + NO, No line break(s).
+#
+# - Will event ranking include to the log file.
+#     + YES, Event ranking number added to each line in log file(s). Ranking number 
+#       depends on environment's tics, for example(includes time stamp also)
+#       '012   12.Nov.2003 115958    LOGGING INFO'
+#     + NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+EmulatorBasePath= C:\LOGS\TestFramework\
+EmulatorFormat= HTML         # Possible values: TXT or HTML
+EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML        # Possible values: TXT or HTML
+#HardwareOutput= FILE        # Possible values: FILE or RDEBUG
+
+FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES      # Possible values: YES or NO
+#WithTimeStamp= YES          # Possible values: YES or NO
+#WithLineBreak= YES          # Possible values: YES or NO
+#WithEventRanking= YES       # Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTest.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSettingsPluginApiTest
+*
+*/
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include <SettingServerClient.h>
+#include <ScreensaverInternalPSKeys.h>
+#include <e32property.h>
+
+#include "SettingsPluginApiTest.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSettingsPluginApiTest::CSettingsPluginApiTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSettingsPluginApiTest::CSettingsPluginApiTest( CTestModuleIf& aTestModuleIf ):
+    CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSettingsPluginApiTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSettingsPluginApiTest::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KSettingsPluginApiTestLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KSettingsPluginApiTestLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KSettingsPluginApiTestLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    
+    TurnOffScreenSaver();
+    }
+
+// -----------------------------------------------------------------------------
+// CSettingsPluginApiTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSettingsPluginApiTest* CSettingsPluginApiTest::NewL( CTestModuleIf& aTestModuleIf )
+    {
+    CSettingsPluginApiTest* self = new( ELeave ) CSettingsPluginApiTest( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSettingsPluginApiTest::~CSettingsPluginApiTest()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CSettingsPluginApiTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSettingsPluginApiTest::SendTestClassVersion()
+    {
+    TVersion moduleVersion;
+    moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+    moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+    moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+
+    TFileName moduleName;
+    moduleName = _L( "SettingsPluginApiTest.dll" );
+
+    TBool newVersionOfMethod = ETrue;
+    TestModuleIf().SendTestModuleVersion( moduleVersion, moduleName, 
+        newVersionOfMethod );
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+    return ( CScriptBase* ) CSettingsPluginApiTest::NewL( aTestModuleIf );
+    }
+
+// -----------------------------------------------------------------------------
+// Turn off ScreenSaver
+// -----------------------------------------------------------------------------
+//
+void CSettingsPluginApiTest::TurnOffScreenSaver()
+    {
+    //TInt Get(TUid aCategory, TUint aKey, TInt &aValue);
+    TInt err1 = RProperty::Get( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        iOldScreenSaverProperty );
+    TInt err2 = RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        KScreenSaverAllowScreenSaver );    
+    RDebug::Printf( "screensaver property=%d err1=%d err2=%d\n", 
+        iOldScreenSaverProperty, err1, err2 );
+    }
+
+// -----------------------------------------------------------------------------
+// Restore ScreenSaver
+// -----------------------------------------------------------------------------
+//
+void CSettingsPluginApiTest::RestoreScreenSaver()
+    {
+    RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        iOldScreenSaverProperty );
+    User::ResetInactivityTime();
+    }
+
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTestblocks.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This cpp file has the functions to test SettingsPluginApi.
+*
+*/
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "SettingsPluginApiTest.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSettingsPluginApiTest::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CSettingsPluginApiTest::Delete() 
+    { 
+    if ( iGSPluginInterface )
+    	{
+    	delete iGSPluginInterface;
+    	iGSPluginInterface = NULL;
+    	}
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSettingsPluginApiTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CSettingsPluginApiTest::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "CallGetValueL", CSettingsPluginApiTest::CallGetValueL ),
+        ENTRY( "CallMenuActivationItemL", CSettingsPluginApiTest::CallMenuActivationItemL ),
+        ENTRY( "CallVisibleL", CSettingsPluginApiTest::CallVisibleL ),
+        ENTRY( "CallResetSelectedItemIndexL", CSettingsPluginApiTest::CallResetSelectedItemIndexL ),
+        // [test cases entries]
+        };
+
+    const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSettingsPluginApiTest::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CSettingsPluginApiTest::SetupCGSParentPluginL()
+	{  
+	TRAPD( error, iTestGsPlugin = CTestGSPlugin::NewL() );
+	
+	if ( KErrNone == error )
+		{
+        iGSPluginInterface = static_cast<CGSPluginInterface*> ( iTestGsPlugin );
+		}
+    
+    return error;
+	}
+
+// -----------------------------------------------------------------------------
+// CServicesDbApiTest::CallGetValueL
+// Is used to test CGSPluginInterface::GetValue
+// -----------------------------------------------------------------------------
+TInt CSettingsPluginApiTest::CallGetValueL( CStifItemParser& /*aItem*/ )
+    {
+    //
+    TInt result = 0;
+    TRAPD( error, result = SetupCGSParentPluginL() );
+    if( KErrNone != error )
+        {
+        iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error );
+        return error;
+        }
+    else
+        {
+        if( KErrNone != result )
+            {            
+            return result;
+            }
+        };
+    TBuf<256> value;
+    TRAPD( errorCall, iGSPluginInterface->GetValue( EGSPluginKeySettingsItemValueString, value ) );
+    if( errorCall != KErrNone )
+        {
+        iLog->Log( _L( "Function GetValue is called failed. The failed code is %d" ), errorCall );
+        return errorCall;
+        }
+    else
+        {
+        iLog->Log( _L( "Function GetValue called successfully." ) );
+        }
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CServicesDbApiTest::CallMenuActivationItemL
+// Is used to test CGSPluginInterface::MenuActivationItem
+// -----------------------------------------------------------------------------
+TInt CSettingsPluginApiTest::CallMenuActivationItemL( CStifItemParser& /*aItem*/ )
+    {
+    //
+    TInt result = 0;
+    TRAPD( error, result = SetupCGSParentPluginL() );
+    if(KErrNone != error)
+        {
+        iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error );
+        return error;
+        }
+    else
+        {
+        if( KErrNone != result )
+            {            
+            return result;
+            }
+        };
+    TGSMenuActivationItems GsMenuActivationItems;
+    TRAPD( errorCall, GsMenuActivationItems = iGSPluginInterface->MenuActivationItem() );
+    if( errorCall != KErrNone )
+        {
+        iLog->Log( _L( "Function MenuActivationItem is called failed. The failed code is %d" ), errorCall );
+        return errorCall;
+        }
+    else
+        {
+        iLog->Log( _L( "Function MenuActivationItem is called successfully." ) );
+        }
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CServicesDbApiTest::CallVisibleL
+// Is used to test CGSPluginInterface::Visible
+// -----------------------------------------------------------------------------
+TInt CSettingsPluginApiTest::CallVisibleL( CStifItemParser& /*aItem*/ )
+    {
+    //
+    TInt result = 0;
+    TRAPD( error, result = SetupCGSParentPluginL() );
+    if(KErrNone != error)
+        {
+        iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error );
+        return error;
+        }
+    else
+        {
+        if( KErrNone != result )
+            {            
+            return result;
+            }
+        };
+    TBool IsVisible;
+    TRAPD( errorCall, IsVisible = iGSPluginInterface->Visible() );
+    if( errorCall != KErrNone )
+        {
+        iLog->Log( _L( "Function Visible is called failed. The failed code is %d" ), errorCall );
+        return errorCall;
+        }
+    else
+        {
+        iLog->Log( _L( "Function Visible is called successfully." ) );
+        }
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CServicesDbApiTest::CallResetSelectedItemIndexL
+// Is used to test CGSPluginInterface::ResetSelectedItemIndex
+// -----------------------------------------------------------------------------
+TInt CSettingsPluginApiTest::CallResetSelectedItemIndexL( CStifItemParser& /*aItem*/ )
+    {
+    //
+    TInt result = 0 ;
+    TRAPD( error, result = SetupCGSParentPluginL() );
+    if(KErrNone != error)
+        {
+        iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error );
+        return error;
+        }
+    else
+        {
+        if( KErrNone != result )
+            {            
+            return result;
+            }
+        };
+    TRAPD( errorCall, iGSPluginInterface->ResetSelectedItemIndex() );
+    if( errorCall != KErrNone )
+        {
+        iLog->Log( _L( "Function ResetSelectedItemIndex is called failed. The failed code is %d" ), errorCall );
+        return errorCall;
+        }
+    else
+        {
+        iLog->Log( _L( "Function ResetSelectedItemIndex is called successfully." ) );
+        }
+    
+    return KErrNone;
+    }
+
+//
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/TestGSPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "TestGSPlugin.h"
+
+
+	
+// CONSTRUCTION
+CTestGSPlugin* CTestGSPlugin::NewL()
+    {
+    CTestGSPlugin* self = CTestGSPlugin::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+CTestGSPlugin* CTestGSPlugin::NewLC()
+    {
+    CTestGSPlugin* self = new( ELeave ) CTestGSPlugin();
+    CleanupStack::PushL( self );
+
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor 
+CTestGSPlugin::~CTestGSPlugin()
+    {
+    }
+
+// Default constructor
+CTestGSPlugin::CTestGSPlugin()
+    {
+    }
+
+// Second phase construct
+void CTestGSPlugin::ConstructL()
+    {
+    }
+
+
+void CTestGSPlugin::GetCaptionL( TDes& /*aCaption*/ ) const
+	{
+	
+	}
+
+TUid CTestGSPlugin::Id() const
+	{
+	return KNullUid;
+	}
+	
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_uis_cenrep_collection_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   File that exports the files belonging to 
+:                Settings Uis CenRep collection API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SettingsInternalCRKeys.h     MW_LAYER_PLATFORM_EXPORT_PATH(settingsinternalcrkeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_uis_cenrep_collection_api/inc/SettingsInternalCRKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1044 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Settings UIs domain Central Repository keys.
+*
+*/
+
+
+
+#ifndef SETTINGSINTERNALCRKEYS_H
+#define SETTINGSINTERNALCRKEYS_H
+
+// INCLUDES
+#include <e32def.h>
+
+// CONSTANTS
+
+/**
+* Network settings CR UID.
+*/
+const TUid KCRUidNetworkSettings = {0x101F8751};
+
+
+/**
+* Determines whether the user see visual notifications
+* when entering or leaving different cellular systems.
+* Possible interger values:
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsServiceAlertNotes = 0x00000004;
+
+/**
+* Determines whether the user will hear a service tone
+* when entering or leaving different cellular systems.
+* Possible interger values:
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsServiceAlertTones = 0x00000005;
+
+/**
+* Micro cellular network (Mcn) Display
+*
+* Possible values:
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsMcnDisplay = 0x00000006;
+
+
+/**
+* Security settings CR UID
+*/
+const TUid KCRUidSecuritySettings = {0x101F877A};
+
+/**
+* Autolock time
+* Possible values are:
+* 0-999 minutes
+*/
+const TUint32 KSettingsAutoLockTime = 0x00000001;
+
+/**
+* Autolock status
+* Possible values are:
+* 0 = phone is not locked
+* 1 = phone is locked
+*/
+const TUint32 KSettingsAutolockStatus = 0x00000002;
+
+/**
+* A CDMA Operator specific requirement, to be able to set the phone to
+* "Lock On Power Up" in General Settings. When this key is set to 1
+* the device security will lock the system (using Autolock) after each
+* phone reboot.
+*
+* Possible values are:
+* 0 = The phone doesn't get locked on Power Up
+* 1 = The phone gets locked on Power Up
+*/
+const TUint32 KSettingsLockOnPowerUp = 0x00000003;
+
+/**
+* Transaction Tracking status
+* Possible values are:
+* 0 = disabled
+* 1 = enabled
+*/
+const TUint32 KSettingsTransactionTracking = 0x00000004;
+
+/**
+* Automatic keyguard time in seconds
+* Possible values are from 0 to 3600
+*/
+const TUint32 KSettingsAutomaticKeyguardTime = 0x00000005;
+
+/**
+* Automatic keyguard maximum time
+* Value in seconds
+*/
+const TUint32 KSettingsMaxAutomaticKeyguardTime = 0x00000006;
+
+
+/**
+* Communication (aka networking) related settings CR UID
+*/
+const TUid KCRUidCommunicationSettings = {0x101F877B};
+
+/**
+* Name of polymorphic DLL to be loaded for VPN management UI.
+*/
+const TUint32 KSettingsVPNImplementation = 0x00000001;
+
+/**
+* VPN tab in Connection settings UI to be displayed or
+* hidden from the user.
+*
+* Possible values are:
+* 0 = Tab is hidden
+* 1 = Tab is shown
+*/
+const TUint32 KSettingsVPNSupported = 0x00000002;
+
+/**
+* Access Points item in Connection settings folder to be displayed or
+* hidden from the user.
+*
+* Possible values are:
+* 0 = item is hidden
+* 1 = item is shown
+*/
+const TUint32 KSettingsAPSettingsSupported = 0x00000003;
+
+/**
+* Terminal personalization settings CR UID
+*/
+const TUid KCRUidPersonalizationSettings = {0x101F877C};
+
+
+
+/**
+* Is operator logo is shown to the user.
+* 0 = Logo not shown
+* 1 = Logo shown
+*/
+const TUint32 KSettingsDisplayOperatorLogo = 0x00000003;
+
+/**
+* Defines if the "Operator Logo" list item is to be made visible or
+* hidden in General Settings.
+*/
+const TUint32 KSettingsShowOperatorLogoSetting = 0x00000004;
+
+/**
+* Defines if Active Idle functionality is enabled.
+* 0 = Disabled
+* 1 = Enabled
+*/
+const TUint32 KSettingsActiveIdleState = 0x00000006;
+
+/**
+* Hide/Unhide Confirm Sat operations item in UI
+* 0 = Hide
+* 1 = Show
+*/
+const TUint32 KSettingsConfirmSatOperationsSupported = 0x00000007;
+
+/**
+* Screen saver period.
+* The value is an integer between 5 and 90.
+* Default value is 15
+**/
+const TUint32 KSettingsScreenSaverPeriod =  0x00000008;
+
+/**
+* Confirm Sat operations setting
+* 0 = No
+* 1 = Yes
+*/
+const TUint32 KSettingsConfirmSatOperations = 0x00000009;
+
+/**
+* Custom banner text for idle screen
+* String value.
+*/
+const TUint32 KSettingsCustomBannerText = 0x0000000A;
+
+/**
+* Power Save Led setting value
+* Integer value.
+*/
+const TUint32 KSettingsDisplayTurnoffTimeout = 0x0000000B;
+
+/**
+* Plugin UID of the operator specific full screen ActiveIdle.
+* Integer value.
+* Default value: 0
+*/
+const TUint32 KSettingsOperatorActiveIdle = 0x0000000C;
+
+/**
+* Pen writing speed for HWR
+* Possible values are: 1-5 (very fast - very slow)
+* Default value: 3
+*/
+const TUint32 KSettingsWritingSpeed = 0x0000000D;
+
+/**
+* Pen trail width for HWR.
+* Possible values are: 1-5 (very thin - very thick)
+* Default value: 3
+*/
+const TUint32 KSettingsPenWidth = 0x0000000E;
+
+/**
+* Pen trail color for HWR.
+* 24-bit RGB colour value with 8 bits each for red, green and blue.
+* The integer is of form 0xaabbggrr
+* Default value: 0
+*/
+const TUint32 KSettingsPenColor = 0x0000000F;
+
+/**
+* Default input method of the Chinese PRC VKB.
+* Possible values are: 1 - PinYin; 4 - Stroke
+* Default value: 1
+*/
+const TUint32 KSettingsDefaultVkbPrc = 0x00000010;
+
+/**
+* Default input method of the Chinese TaiWan VKB.
+* Possible values are: 2 - ZhuYin; 4 - Stroke
+* Default value: 2
+*/
+const TUint32 KSettingsDefaultVkbTw = 0x00000011;
+
+/**
+* Default input method of the Chinese HongKong VKB.
+* Possible values are: 4 - Stroke; 8 - CangJie
+* Default value: 4
+*/
+const TUint32 KSettingsDefaultVkbHk = 0x00000012;
+
+/**
+* Pen Input Language.
+* Possible values defined in enum TLanguage
+* Default value: 0
+*/
+const TUint32 KSettingsPenInputLang = 0x00000013;
+
+/**
+* Indicates whether T-coil hearing aid mode is enabled or not.
+* Integer value.
+* Default value: 0
+* 0 = disabled
+* 1 = enabled
+*/
+const TUint32 KSettingsHearingAidMode = 0x00000014;
+
+/**
+* Guide line used in hand writing recognition box.
+* If enabled, horizontal line will appear in the box.
+* Default value: 1
+* 0 = Guide Line Off
+* 1 = Guide Line On
+*/
+const TUint32 KSettingsPenInputGuideLine = 0x00000015;
+
+/**
+* To Variate Operator Specific ActiveIdle Text.
+* String value.
+*/
+const TUint32 KSettingsOperatorVariantActiveIdleText = 0x00000016;
+
+/**
+* To variate screensaver timeout settings item visibility
+* 0 = item is hidden (default)
+* 1 = item is shown
+*/
+const TUint32 KSettingsScreensaverTimeoutItemVisibility = 0x00000017;
+
+/**
+* Indicates whether the function (recognition with dictionary) is enabled or not.
+* Boolean value.
+* Default value: 0
+* 0 = disabled
+* 1 = enabled
+*/
+const TUint32 KSettingRecognitionwithdictionary = 0x00000018;
+
+/**
+* To save the setting for enable / disable optical joystick
+* Integer value.
+* Default value: 1
+* 0 = Guide Line Off
+* 1 = Guide Line On
+*/
+const TUint32 KSettingsOpticalJoystickStatus = 0x00000019;
+
+/**
+* Telephony settings CR UID.
+*/
+const TUid KCRUidTelephonySettings = {0x101F877E};
+
+/**
+* Any key answer
+*
+* Possible values:
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsAnyKeyAnswer = 0x00000001;
+
+/**
+* Automatic redial
+*
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsAutomaticRedial = 0x00000002;
+
+/**
+* One key dialling
+*
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsOneKeyDialling = 0x00000003;
+
+/**
+* This key will include information whether the prefix change
+* is active.
+*
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsDialPrefixChangeMode = 0x00000004;
+
+/**
+* This key will include the prefix set by user.
+* Text string maximum 10 characters.
+* Only dial related characters allowed.
+*/
+const TUint32 KSettingsDialPrefixText = 0x00000005;
+
+/**
+* Soft Reject default text used.
+*
+* 0 = Default in use
+* 1 = User defined text in use
+*/
+const TUint32 KSettingsSoftRejectDefaultInUse = 0x00000006;
+
+/**
+* Soft Reject On/Off. Has the user enabled Soft Reject.
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsSoftReject = 0x00000007;
+
+/**
+* User defined Soft Reject text. Any text up to 160 characters.
+* No default value in CentRep (there is a default value, but it is
+* localized).
+*/
+const TUint32 KSettingsSoftRejectText = 0x00000008;
+
+/**
+* Defines if still image for video calls (when camera is disabled) is in use.
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsVTStillImage = 0x00000009;
+
+/**
+* This keys is required for the Video Telephony still image
+* feature in General Settings to store the still image path
+*/
+const TUint32 KSettingsVTStillImagePath = 0x0000000A;
+
+/**
+* This key is required for VoIP Last Call Timer
+*/
+const TUint32 KLogsLastCallTimerLineVoIP = 0x0000000B;
+
+/**
+* This key is required for VoIP Received Calls Timer
+*/
+const TUint32 KLogsReceivedCallsTimerLineVoIP = 0x0000000C;
+
+/**
+* This key is required for VoIP Dialled Calls Timer
+*/
+const TUint32 KLogsDialledCallsTimerLineVoIP = 0x0000000D;
+
+/**
+* This key is required for SCCP stack installation indication
+*/
+const TUint32 KSCCPinstallUpgrade = 0x0000000E;
+
+/**
+* This key is required for dynamic VoIP
+*/
+const TUint32 KDynamicVoIP = 0x0000000F;
+
+/**
+* This key is required for Long Press of Call Key setting item
+* Values: 0,1 --> Inactive
+*		  2 --> Video call
+* (Default value is 1 and when Restore Fact. Settings is done value is 0)
+*/
+const TUint32 KSettingsUiLongCallKeyPress = 0x00000010;
+
+/**
+* This key is required for VT call answer mute status
+* 0 = Ask first (default value)
+* 1 = No
+* 2 = Yes
+*/
+const TUint32 KSettingsVTVideoSending = 0x00000011;
+
+
+/**
+* key to define what to do when opening slide
+* 0: Not answer call when opening slide
+* 1: Answer call when opening slide (default)
+*/
+const TUint32 KSettingsOpeningSlideAnswer = 0x00000012;
+
+/**
+* key to define what to do when closing slide
+* 0: Not end call when closing slide
+* 1: End call when closing slide (default)
+*/
+const TUint32 KSettingsClosingSlideEnd = 0x00000013;
+
+
+/**
+* key to define whether to show or not show side settings 
+* 0: Not show slide settings (default)
+* 1: Show slide settings
+*/
+
+const TUint32 KSettingsShowSlideSettings = 0x00000014;
+
+/**
+* CDMA Telephony settings CR UID.
+*/
+const TUid KCRUidCdmaTelephonySettings = {0x101F877F};
+
+/**
+* Locale settings CR UID.
+*/
+const TUid KCRUidLocaleSettings = {0x101F8780};
+
+/**
+* Arabic & Hebrew default number mode - integer value.
+*/
+const TUint32 KSettingsDefaultNumberMode = 0x00000001;
+
+/**
+* Default Indic Number Mode for Hindi Digits - integer value.
+*/
+const TUint32 KSettingsIndicDefaultNumberMode = 0x00000002;
+
+/**
+* Peripheral settings CR UID.
+*/
+const TUid KCRUidPeripheralSettings = {0x101F8781};
+
+/**
+* Timeout for setting off the display lights.
+* Value is in seconds.
+*/
+const TUint32 KSettingsDisplayLightsTimeout = 0x00000001;
+
+/**
+* Call forwarding settings CR UID.
+*/
+const TUid KCRUidCallForwarding = {0x101F8782};
+
+/**
+* call forwarding "forwarded-to" number 1.
+* String value
+*/
+const TUint32 KSettingsCFDefaultNumber1 = 0x00000001;
+
+/**
+* call forwarding "forwarded-to" number 2.
+* String value
+*/
+const TUint32 KSettingsCFDefaultNumber2 = 0x00000002;
+
+/**
+* call forwarding "forwarded-to" number 3.
+* String value
+*/
+const TUint32 KSettingsCFDefaultNumber3 = 0x00000003;
+
+/**
+* call forwarding "forwarded-to" number 1. Alternate line
+* String value
+*/
+const TUint32 KSettingsCFDefaultNumberAls1 = 0x00000004;
+
+/**
+* call forwarding "forwarded-to" number 2. Alternate line
+* String value
+*/
+const TUint32 KSettingsCFDefaultNumberAls2 = 0x00000005;
+
+/**
+* call forwarding "forwarded-to" number 3. Alternate line
+* String value
+*/
+const TUint32 KSettingsCFDefaultNumberAls3 = 0x00000006;
+
+/**
+* "call forwarding when no reply"-timer value.
+* Integer value.
+*/
+const TUint32 KSettingsCFTimerValue = 0x00000007;
+
+/**
+* "call forwarding when no reply"-timer value for alternate line.
+* Integer value.
+*/
+const TUint32 KSettingsCFTimerValueAls = 0x00000008;
+
+/**
+* Last used number diverted data calls
+* String value
+*/
+const TUint32 KSettingsCFUsedDataNumber = 0x00000009;
+
+/**
+* Last used number diverted fax calls
+* String value
+*/
+const TUint32 KSettingsCFUsedFaxNumber = 0x0000000A;
+
+/**
+* Common Telephony Settings CR UID.
+*/
+const TUid KCRUidCommonTelephonySettings = {0x101F8831};
+
+/**
+* Summary after call
+*
+* 0 = Off
+* 1 = On
+*/
+const TUint32 KSettingsSummaryAfterCall = 0x00000001;
+
+/**
+* Settings for Rich Call features
+*/
+const TUid KCRUidRichCallSettings = {0x101F883B};
+
+/**
+* Calling Line Identification Restriction for PS calls
+*
+* 0 = KRCSEClirOff
+* 1 = KRCSEClirOn
+* 2 = KRCSEClirDefault
+*/
+const TUint32 KRCSEClir = 0x00000000;
+
+/**
+* Determines whether warning is given to user, when WLAN signal
+* strength drops too low.
+*
+* 0 = KRCSEEarlyWarningOff
+* 1 = KRCSEEarlyWarningOn
+*/
+const TUint32 KRCSEWlanEarlyWarning = 0x00000001;
+
+/**
+* Circuit Switched call waiting.
+*
+* 0 = KRCSECSCallWaitingOff
+* 1 = KRCSECSCallWaitingOn
+*/
+const TUint32 KRCSECSCallWaiting = 0x00000002;
+
+/**
+* Determines whether the registeration of VoIP is automatic or manual.
+*
+* 0 = KRCSEAutomatic
+* 1 = KRCSEManual
+*/
+const TUint32 KRCSEPSLogin = 0x00000003;
+
+/**
+* Determines whether the user wants to receive anonymous calls.
+* Possible values are:
+* 0 = KRCSEAnonymousCallsAllowed
+* 1 = KRCSEAnonymousCallsBlocked
+*/
+const TUint32 KRCSEAnonymousCallBlockRule = 0x00000004;
+
+/**
+* Determines call type preference.
+* Possible values are:
+* 0 = KRCSECSCallPreferred
+* 1 = KRCSEInternetCallPreferred
+*/
+const TUint32 KRCSEPreferredTelephony = 0x00000005;
+
+/**
+* Determines status of Do Not Disturb setting.
+* Possible values are:
+* 0 = KRCSEDoNoDisturbOff
+* 1 = KRCSEDoNoDisturbOn
+*/
+const TUint32 KRCSEDoNotDisturb = 0x00000006;
+
+/**
+* Determines status of PS (VoIP) call waiting setting.
+* Possible values are:
+* 0 = KRCSEPSCallWaitingOff
+* 1 = KRCSEPSCallWaitingOn
+*/
+const TUint32 KRCSPSCallWaiting = 0x00000007;
+
+/**
+* Determines id of preferred VOIP service.
+* 0 = Not set
+* 1 = CS / Video service
+* 2 = voip stub
+* 3 = voip service 1
+* 4 = voip service 2
+* n = voip service n
+*/
+const TUint32 KRCSPSPreferredService = 0x00000008;
+
+
+/**
+* Miscelaneous Settings
+*/
+const TUid KCRUidMiscSettings = {0x1000A82B};
+
+/**
+Phone settings CR UID
+*/
+const TUid KCRUidPhoneSettings = {0x1028239D};
+
+/**
+Call waiting feature
+0 = disabled
+1 = Enabled
+*/
+const TUint32 KPSetCallWaiting = 0x00000001;
+
+/**
+*  Device Management Settings CR UID.
+*/
+const TUid KCRUidDeviceManagementSettings = {0x2002120B};
+
+/**
+Determines whether to show power saving query before entering power saving mode. 
+0: Off
+1: On (Default)
+*/
+const TUint32 KSettingsPowerSavingQuery = 0x00000001;
+
+/**
+*  Slide Settings CR UID.
+*/
+const TUid KCRUidSlideSettings = {0x20015159};
+
+enum TSlideSetting
+    {
+    ESlideSettingOff = 0,
+    ESlideSettingOn  
+    };
+
+/**********************************************************
+ * User settings for slide handling
+ *
+ */
+
+/**
+ * Used to control which behavior is chosen when closing the cover. 
+ * Possible values are 0=Off, 1=On
+ */
+const TUint32 KSlideCloseCover                               = 0x00000001;
+
+const TUint32 KSlideOpenCoverUri                             = 0x00000002;
+
+const TUint32 KSlideOpenCoverCaption                         = 0x00000003;
+
+/**
+ * This setting defines whether keyguard is activated by closing the cover 
+ *
+ * Possible values:
+ * 0: Closing cover does not activate keyguard.
+ * 1: Closing the cover activates keyguard.
+ * 2: User is asked "Do you want to activate keyguard?".
+ * 3: Automatic - keyguard returns to the state before opening the cover.
+ */
+const TUint32 KSlideKeyguard                                 = 0x00000004;
+enum TSlideSettingKeyguard
+    {
+    ESlideSettingsKeyguardActivatingOff = 0,
+    ESlideSettingsKeyguardActivatingOn,
+    ESlideSettingsKeyguardActivatingAskMe,
+    ESlideSettingsKeyguardActivatingAutomatic
+    }; 
+
+/**
+ * Used to control if audio is routed when opening the slide. 
+ * Possible values are 0=routing not changed, 1=routing changed
+ */
+const TUint32 KSlideAudioRouting                             = 0x00000005;
+
+/**
+ * User setting for Intelligent Slide
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KSlideAutomaticAction                          = 0x00000010;
+
+/**********************************************************
+ * Configurability settings 
+ * This group of settings is used to specify which slide behavior is enabled
+ * Different slide types need different items 
+ * For example ITU-T slide need call handling with slide
+ * And full-Qwerty slide does not use call handling but requires audio routing with slide
+ */
+
+/**
+ * Defines which localisation to use for slide settings
+ * Possible values
+ * 0: Slide
+ * 1: Cover
+ * 2: Flip
+ * 3: Fold
+ * 4: Swivel
+ * 5: reserved 
+ */
+const TUint32 KSlideTerminology                             = 0x00000101;
+
+/**
+ * Slide Events to react to
+ * Depending on this value, different P/S keys in KPSUidHWRM are used for monitoring the slide state 
+ * Possible values are 
+ * 0: Grip
+ * 1: Flip
+ * 2: Twist  
+ */
+const TUint32 KSlideShowEventType                               = 0x00000102;
+
+/**
+ * Perform call handling with slide 
+ * Possible values
+ * 0: Disabled
+ * 1: Enabled 
+ */
+const TUint32 KSlideShowCallHandling                            = 0x00000110;
+
+/**
+ * Perform audio routing with slide 
+ * Possible values
+ * 0: Disabled
+ * 1: Enabled 
+ */
+const TUint32 KSlideShowAudioRouting                            = 0x00000111;
+
+/**
+ * Perform keypad lock handling with slide 
+ * Possible values
+ * 0: Disabled
+ * 1: Enabled 
+ */
+const TUint32 KSlideShowKeypadlock                              = 0x00000112;
+
+/**
+ * Application launch when slide open in idle
+ * Possible values
+ * 0: Disabled
+ * 1: Enabled 
+ */
+const TUint32 KSlideShowAppLaunch                               = 0x00000113;
+
+/**
+ * Go to idle with slide close
+ * Possible values
+ * 0: Disabled
+ * 1: Enabled 
+ */
+const TUint32 KSlideShowGoToIdle                                = 0x00000114;
+
+/**
+ * Device lock with slide 
+ * Possible values
+ * 0: Disabled
+ * 1: Enabled 
+ */
+const TUint32 KSlideShowDeviceLock                              = 0x00000115;
+
+/**********************************************************
+ * Intelligent Slide configurability settings
+ * The following items describe in which applications/views 
+ * Intelligent slide feature is enabled
+ *
+ */
+
+/**
+ * Messaging Main View
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KMessagingMainView                            = 0x00001001;
+
+/**
+ * Messaging Message List View
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KMessagingMessageListView                     = 0x00001002;
+
+/**
+ * Messaging One Row Message List View
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KMessagingOneRowMessageListView               = 0x00001003;
+
+/**
+ * Messaging Text Message Viewer
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KMessagingTextMessageViewer                   = 0x00001004;
+
+/**
+ * Messaging Multimedia Message Viewer
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KMessagingMultimediaMessageViewer             = 0x00001005;
+
+/**
+ * Messaging Uni Editor
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KMessagingUniEditor                           = 0x00001006;
+
+/**
+ * Email Viewer
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KEmailViewer                                  = 0x00001010;
+
+/**
+ * Email Editor
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KEmailEditor                                  = 0x00001011;
+
+/**
+ * Browser Content view
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KBrowserContentView                           = 0x00001020;
+
+/**
+ * Browser Bookmarks view
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KBrowserBookmarksView                         = 0x00001021;
+
+/**
+ * Clock Main view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KClockMainView                                = 0x00001030;
+
+/**
+ * Clock Alarm editor 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KClockAlarmEditor                             = 0x00001031;
+
+/**
+ * Clock MultiAlarm view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KClockMultiAlarmView                          = 0x00001032;
+
+/**
+ * Clock World clock view
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KClockWorldClockView                          = 0x00001033;
+
+/**
+ * Clock World clock view
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KClockCountDownView                           = 0x00001034;
+
+
+/**
+ * Notepad Editor
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KNotepadEditor                                = 0x00001040;
+
+/**
+ * Notepad List view
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KNotepadListView                              = 0x00001041;
+
+/**
+ * Phone Incoming call 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KPhoneIncomingCall                            = 0x00001050;
+
+/**
+ * File Manager Folder view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KFileManagerFolderView                        = 0x00001060;
+
+/**
+ * Calendar Main(Month/Week/Day/To-Do) view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KCalendarMainView                             = 0x00001070;
+
+/**
+ * Calendar Event(Meeting/Memo/Anniversary/To-Do note) view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KCalendarEventView                            = 0x00001071;
+
+/**
+ * Calendar Event(Meeting/Memo/Anniversary/To-Do note) editor 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KCalendarEventEditor                          = 0x00001072;
+
+/**
+ * Contacts Group view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KContactsGroupView                            = 0x00001080;
+
+/**
+ * Contacts Details view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KContactsDetailsView                          = 0x00001081;
+
+/**
+ * Contacts Editor 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KContactsEditor                               = 0x00001082;
+
+/**
+ * Contacts Communication Launcher view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KContactsCommunicationLauncherView            = 0x00001083;
+
+
+/**
+ * Logs view 
+ * Possible values are listed in TSlideSetting
+ */
+const TUint32 KLogsView                                     = 0x00001090;
+
+
+/**
+ * Modifier keys used for global shortcuts
+ * Possible values of scan codes are listed in e32keys.h
+ * For example EStdKeyLeftShift=0x12, EStdKeyLeftCtrl=0x16
+ */
+const TUint32 KGlobalShortcutModifier1                      = 0x00002001;
+const TUint32 KGlobalShortcutModifier2                      = 0x00002002;
+
+/**
+ * Action key scancode
+ * Possible values of scan codes are listed in e32keys.h
+ */
+const TUint32 KGlobalShortcutKey00                          = 0x00002100;
+const TUint32 KGlobalShortcutKey01                          = 0x00002101;
+const TUint32 KGlobalShortcutKey02                          = 0x00002102;
+const TUint32 KGlobalShortcutKey03                          = 0x00002103;
+const TUint32 KGlobalShortcutKey04                          = 0x00002104;
+const TUint32 KGlobalShortcutKey05                          = 0x00002105;
+const TUint32 KGlobalShortcutKey06                          = 0x00002106;
+const TUint32 KGlobalShortcutKey07                          = 0x00002107;
+const TUint32 KGlobalShortcutKey08                          = 0x00002108;
+const TUint32 KGlobalShortcutKey09                          = 0x00002109;
+const TUint32 KGlobalShortcutKey10                          = 0x00002110;
+const TUint32 KGlobalShortcutKey11                          = 0x00002111;
+const TUint32 KGlobalShortcutKey12                          = 0x00002112;
+const TUint32 KGlobalShortcutKey13                          = 0x00002113;
+const TUint32 KGlobalShortcutKey14                          = 0x00002114;
+const TUint32 KGlobalShortcutKey15                          = 0x00002115;
+const TUint32 KGlobalShortcutKey16                          = 0x00002116;
+const TUint32 KGlobalShortcutKey17                          = 0x00002117;
+const TUint32 KGlobalShortcutKey18                          = 0x00002118;
+const TUint32 KGlobalShortcutKey19                          = 0x00002119;
+
+/**
+ * Application UID that should be brought to foreground/background 
+ * when corresponding action key is pressed
+ */
+const TUint32 KGlobalShortcutApp00                          = 0x00002200;
+const TUint32 KGlobalShortcutApp01                          = 0x00002201;
+const TUint32 KGlobalShortcutApp02                          = 0x00002202;
+const TUint32 KGlobalShortcutApp03                          = 0x00002203;
+const TUint32 KGlobalShortcutApp04                          = 0x00002204;
+const TUint32 KGlobalShortcutApp05                          = 0x00002205;
+const TUint32 KGlobalShortcutApp06                          = 0x00002206;
+const TUint32 KGlobalShortcutApp07                          = 0x00002207;
+const TUint32 KGlobalShortcutApp08                          = 0x00002208;
+const TUint32 KGlobalShortcutApp09                          = 0x00002209;
+const TUint32 KGlobalShortcutApp10                          = 0x00002210;
+const TUint32 KGlobalShortcutApp11                          = 0x00002211;
+const TUint32 KGlobalShortcutApp12                          = 0x00002212;
+const TUint32 KGlobalShortcutApp13                          = 0x00002213;
+const TUint32 KGlobalShortcutApp14                          = 0x00002214;
+const TUint32 KGlobalShortcutApp15                          = 0x00002215;
+const TUint32 KGlobalShortcutApp16                          = 0x00002216;
+const TUint32 KGlobalShortcutApp17                          = 0x00002217;
+const TUint32 KGlobalShortcutApp18                          = 0x00002218;
+const TUint32 KGlobalShortcutApp19                          = 0x00002219;
+
+#endif      // SETTINGSINTERNALCRKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_plat/settings_uis_cenrep_collection_api/settings_uis_cenrep_collection_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="05d73692cd3d5df58b5ed4259ad6c553" dataversion="2.0">
+  <name>Settings Uis CenRep collection API</name>
+  <description>See the logical API descriptions from the Nokia Crep And PS Keys sheet (Network Settings API, Accessory Settings API, Device Security Settings API, Communication Settings API, Personalization Settings API, Profile Accessory Settings API, Telephony Feature Settings API, CDMA Telephony Feature Settings API, Locale Settings API, Peripheral Settings API, Call Forwarding Settings API, Common Telephony Settings API, Rich Call Settings API, Accessory Light Settings API, Call Waiting Settings API)</description>
+  <type>c++</type>
+  <collection>gssettingsuis</collection>
+  <libs>
+  </libs>
+  <release category="platform"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+#include "../profiles_engine_active_profile_settings_api/group/bld.inf"
+#include "../profiles_engine_wrapper_api/group/bld.inf"
+
+PRJ_TESTMMPFILES
+
+//  End of File 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_active_profile_settings_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Profiles Engine Active Profile Settings API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/ProfileEngineSDKCRKeys.h     MW_LAYER_PUBLIC_EXPORT_PATH(ProfileEngineSDKCRKeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_active_profile_settings_api/inc/ProfileEngineSDKCRKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the constant definitions of the Central
+ *                Repository keys and the Central Repository UID of Profiles
+ *                Engine Active Profile Settings API.
+ *
+*/
+
+
+
+#ifndef PROFILEENGINESDKCRKEYS_H
+#define PROFILEENGINESDKCRKEYS_H
+
+
+//  INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+
+/**
+ * This is a READ-ONLY API to get information about the settings of the
+ * currently active profile.
+ *
+ * How to use:
+ *
+ * @code
+ * #include <centralrepository.h>
+ * #include <ProfileEngineSDKCRKeys.h>
+ *
+ * CRepository* cr = CRepository::NewLC( KCRUidProfileEngine );
+ * TInt value;
+ *
+ * // Get the ID of the currently active profile:
+ * User::LeaveIfError( cr->Get( KProEngActiveProfile, value ) );
+ * // use value
+ *
+ * // Get the ringing type of the active profile:
+ * User::LeaveIfError( cr->Get( KProEngActiveRingingType, value ) );
+ * // use value
+ *
+ * // Get the keypad tones volume level of the active profile:
+ * User::LeaveIfError( cr->Get( KProEngActiveKeypadVolume, value ) );
+ * // use value
+ *
+ * // Get the ringing volume of the active profile:
+ * User::LeaveIfError( cr->Get( KProEngActiveRingingVolume, value ) );
+ * // use value
+ *
+ * // Get the game and warning tone setting of the active profile:
+ * User::LeaveIfError( cr->Get( KProEngActiveWarningTones, value ) );
+ * // use value
+ *
+ * // Get the message alert setting of the active profile:
+ * User::LeaveIfError( cr->Get( KProEngActiveMessageAlert, value ) );
+ * // use value
+ *
+ * CleanupStack::PopAndDestroy( cr );
+ * @endcode
+ * 
+ * The UID of the Central Repository file containing the settings. Should be
+ * given as a parameter in CRepository::NewL() call.
+ */
+const TUid KCRUidProfileEngine = {0x101F8798};
+
+/**
+* The id of the currently active profile, integer value.
+* Possible values:
+*
+* 0 = General profile (default value)<br>
+* 1 = Silent profile<br>
+* 2 = Meeting profile<br>
+* 3 = Outdoor profile<br>
+* 4 = Pager profile<br>
+* 5 = Off-line profile<br>
+* 6 = Drive profile<br>
+* 30-49 = User-created profiles<br>
+**/
+const TUint32 KProEngActiveProfile = 0x7E000001;
+
+/**
+* Ringing type of the active profile, integer value.
+*
+* Possible values:
+*
+* 0 = Ringing (default value)<br>
+* 1 = Ascending<br>
+* 2 = Ring once<br>
+* 3 = Beep once<br>
+* 4 = Silent<br>
+**/
+const TUint32 KProEngActiveRingingType = 0x7E000002;
+
+/**
+* Keypad volume of the active profile, integer value.
+*
+* Possible values:
+*
+* 0 (keypad tones off)<br>
+* 1<br>
+* 2 (default)<br>
+* 3<br>
+**/
+const TUint32 KProEngActiveKeypadVolume = 0x7E000004;
+
+/**
+* Ringing volume of the active profile, integer value.
+*
+* Possible value range: 1-10
+*
+* Default value : 7
+**/
+const TUint32 KProEngActiveRingingVolume = 0x7E000008;
+
+/**
+* Warning & Game Tones of the active profile, integer value.
+*
+* Possible values:
+*
+* 0 = off<br>
+* 1 = on (default value)<br>
+**/
+const TUint32 KProEngActiveWarningTones = 0x7E000020;
+
+/**
+* Message Alert Tone of the active profile, integer value.
+*
+* Possible values:
+*
+* 0 = Off (= the profile is silent)<br>
+* 1 = On (default value)<br>
+**/
+const TUint32 KProEngActiveMessageAlert = 0x7E000040;
+
+
+#endif      // PROFILEENGINESDKCRKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_active_profile_settings_api/profiles_engine_active_profile_settings_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="16892f626ff0396db62a597028dfe37b" dataversion="2.0">
+  <name>Profiles Engine Active Profile Settings API</name>
+  <description>Enables read-only access to certain settings in the current active profile</description>
+  <type>c++</type>
+  <collection>profilesservices</collection>
+  <libs>
+  </libs>
+  <release category="public" sinceversion="0"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Profiles Engine Wrapper API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/Profile.hrh     MW_LAYER_PUBLIC_EXPORT_PATH(Profile.hrh)
+../inc/MProEngActiveProfileObserver.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngActiveProfileObserver.h)
+../inc/MProEngProfileNameArray.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileNameArray.h)
+../inc/MProEngProfileObserver.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileObserver.h)
+../inc/MProEngNotifyHandler.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngNotifyHandler.h)
+../inc/MProEngProfileName.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileName.h)
+../inc/MProEngProfileActivationObserver.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileActivationObserver.h)
+../inc/ProEngFactory.h     MW_LAYER_PUBLIC_EXPORT_PATH(ProEngFactory.h)
+../inc/MProEngProfile.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngProfile.h)
+../inc/MProEngAlertToneSeeker.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngAlertToneSeeker.h)
+../inc/MProEngTones.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngTones.h)
+../inc/MProEngAlertToneSeekerObserver.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngAlertToneSeekerObserver.h)
+../inc/MProEngToneSettings.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngToneSettings.h)
+../inc/MProEngProfileNameArrayObserver.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileNameArrayObserver.h)
+../inc/MProEngEngine.h     MW_LAYER_PUBLIC_EXPORT_PATH(MProEngEngine.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngActiveProfileObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract interface for handling the active profile events.
+*
+*/
+
+
+
+#ifndef MPROENGACTIVEPROFILEOBSERVER_H
+#define MPROENGACTIVEPROFILEOBSERVER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProEngActiveProfileObserverExt;
+
+// CLASS DECLARATION
+
+/**
+* Active profile modification observer interface.
+* Implement this interface to get notifications of changes in the active profile
+* data.
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+class MProEngActiveProfileObserver
+    {
+    public: // New functions
+
+        /**
+        * Abstract method for handling active profile modification event.
+        * This method is called when the current active profile has been
+        * modified some way. Note, this doesn't get events if a profile is
+        * activated, for that implement MProEngProfileActivationObserver.
+        * 
+        * @since Series 60 3.1
+        */
+        virtual void HandleActiveProfileModifiedL() = 0;
+
+        /**
+         * Error handler for handling the errors in the active profile
+         * modification notification process. If HandleActiveProfileModifiedL()
+         * leaves, this method is called with the leave code. This method has
+         * default empty implementation.
+         * @since S60 3.1
+         * @param aError the code of the error which occurred during
+         *        notification process.
+         */
+        virtual void HandleActiveProfileNotificationError(
+                TInt /* aError */ ) {};
+
+    protected:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MProEngActiveProfileObserver() {}
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngActiveProfileObserverExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGACTIVEPROFILEOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngAlertToneSeeker.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract interface for find media files suitable to be 
+*  				set as an alert tone in Profiles.
+*
+*/
+
+
+
+#ifndef MPROENGALERTTONESEEKER_H
+#define MPROENGALERTTONESEEKER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProEngAlertToneSeekerExt;
+class MProEngAlertToneSeekerObserver;
+
+// CLASS DECLARATION
+
+/**
+*  This class can be used to find media files suitable to be set as an alert
+*  tone in Profiles.
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+class MProEngAlertToneSeeker
+    {
+    public: // New functions
+
+        /**
+        * Asynchronous method that searches all the tone files that can be used
+        * as alert tones in Profiles. The resulting list of the tone paths is
+        * delivered to the MProEngAlertToneSeekerObserver.
+        * This is a very long lasting operation (~minutes), so this shouldn't
+        * be performed too often.
+        * @since S 60 3.1
+        * @param aObserver Reference to the client-implemented observer which
+        *        will get the list of tones after the list has been constructed.
+        */
+        virtual void FetchAlertToneListL(
+                MProEngAlertToneSeekerObserver& aObserver ) = 0;
+
+        /**
+         * Cancels the asynchronous fetch operation.
+         * @since S60 3.1
+         */
+        virtual void CancelFetch() = 0;
+
+    public:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MProEngAlertToneSeeker() {}
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngAlertToneSeekerExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGALERTTONESEEKER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngAlertToneSeekerObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Interface to get the list of the alert tones from MProEngAlertToneSeeker.
+*
+*/
+
+
+
+#ifndef MPROENGALERTTONESEEKEROBSERVER_H
+#define MPROENGALERTTONESEEKEROBSERVER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProEngAlertToneSeekerObserverExt;
+
+// CLASS DECLARATION
+
+/**
+*  Interface to get the list of the alert tones from MProEngAlertToneSeeker.
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+class MProEngAlertToneSeekerObserver
+    {
+    public: // New functions
+
+        /**
+        * Abstract method to get notification when the MProEngAlertToneSeeker
+        * has completed the list of alert tones.
+        * @since Series 60 3.1
+        * @param aToneList Array containing the path names of the tones found.
+        * The ownership of the array is transferred to the observer.
+        */
+        virtual void HandleAlertToneListCompletedL( MDesCArray* aToneList ) = 0;
+
+        /**
+        * Abstract method for handling errors in alert tone list creation
+        * process. Also if HandleAlertToneListCompletedL() method leaves, the
+        * leave code will be passed to this method.
+        * @since Series 60 3.1
+        * @param aError System wide error code.
+        */
+        virtual void HandleError( TInt aError ) = 0;
+
+    protected:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MProEngAlertToneSeekerObserver() {}
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngAlertToneSeekerObserverExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGALERTTONESEEKEROBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngEngine.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile engine interface.
+*
+*/
+
+
+
+#ifndef MPROENGENGINE_H
+#define MPROENGENGINE_H
+
+// INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class RFs;
+class MProEngProfile;
+class MProEngProfileNameArray;
+class MProEngChangeObserverExt;
+
+// CLASS DECLARATION
+
+/**
+*  Profile engine interface.
+*  This class offers methods to get active profile, active profile ID,
+*  profile names array and set active profile.
+*  How to use:
+*  @code
+*  // Create profile engine by using Factory:
+*  MProEngEngine* profileEngine = NewEngineL();
+*
+*  // Free resources with MProEngEngine::Release();
+*  profileEngine->Release();
+*  // or if you release resources in destructor:
+*  if( iEngine )
+*      {
+*      iEngine->Release();
+*      }
+*
+*  // If you put this class to CleanupStack then use void CleanupReleasePushL()
+*     CleanupReleasePushL( *profileEngine );
+*  @endcode
+*
+*  @lib ProfileEngine.lib 
+*  @since 3.1
+*/
+class MProEngEngine
+    {
+    public:  // Destructor
+
+        virtual ~MProEngEngine() {};
+
+    public:
+
+        /**
+        * Free resources of MProEngEngine.
+        * @since 3.1
+        */
+        virtual void Release() = 0;
+
+        /**
+        * Return active profile, ownership transferred.
+        * @since 3.1
+        * @return Instance of the MProfile
+        */
+        virtual MProEngProfile* ActiveProfileLC() = 0;
+
+        /**
+        * Return active profile, ownership transferred.
+        * @since 3.1
+        * @return Instance of the MProfile
+        */
+        virtual MProEngProfile* ActiveProfileL() = 0;
+
+        /**
+        * Return active profile ID or system error code.
+        * @since 3.1
+        * @return Active profile ID or system error code.
+        */
+        virtual TInt ActiveProfileId() = 0;
+
+        /**
+        * Return profile name array, ownership transferred.
+        * @since 3.1
+        * @return Instance of the profile name array
+        */
+        virtual MProEngProfileNameArray* ProfileNameArrayLC() = 0;
+
+        /**
+        * Set the active profile, if ID is incorrect then leave with
+        * KErrNotFound. This method can be called only by processes having
+        * WriteDeviceData capability.
+        * @since 3.1
+        * @param aId Profile ID
+        */
+        virtual void SetActiveProfileL( TInt aId ) = 0;
+
+        /**
+        * Return the settings of the profile with the given ID. The created
+        * object is pushed in the cleanup stack and the ownership is
+        * transferred. Leave with KErrNotFound if a profile with the given ID
+        * can not be found.
+        * @since 3.1
+        * @param aId Profile ID
+        * @return Instance of the MProEngProfile
+        */
+        virtual MProEngProfile* ProfileLC( TInt aId ) = 0;
+
+        /**
+        * Return the settings of the profile with the given ID, the ownership
+        * of the created object is transferred. Leave with KErrNotFound if a
+        * profile with the given ID can not be found.
+        * @since 3.1
+        * @param aId Profile ID
+        * @return Instance of the MProEngProfile
+        */
+        virtual MProEngProfile* ProfileL( TInt aId ) = 0;
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngChangeObserverExt* Extension() { return NULL; }
+
+    };
+
+#endif      //  MPROENGENGINE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngNotifyHandler.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Abstract interface for handling profile change notification
+*
+*/
+
+
+
+#ifndef MPROENGNOTIFYHANDLER_H
+#define MPROENGNOTIFYHANDLER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProEngNotifyHandlerExt;
+class MProEngProfileActivationObserver;
+class MProEngActiveProfileObserver;
+class MProEngProfileObserver;
+class MProEngProfileNameArrayObserver;
+
+// CLASS DECLARATION
+
+/**
+* Profiles change notification handler.
+* This class is used for registration to get notifications about changes in
+* Profiles data.
+*
+*  @lib ProfileEngine.lib
+*  @since S60 3.1
+*/
+class MProEngNotifyHandler
+    {
+    public: // New functions
+
+        /**
+         * Request notifications of profile activations. The notifications are
+         * received as long as CancelProfileActivationNotifications() or
+         * CancelAll() is called. If the client wants to change the observer,
+         * he should first cancel these notifications and then re-request them
+         * with the new observer instance.
+         * @since S60 3.1
+         * @param aObserver Reference to the observer to be notified in the
+         *        event of profile activation.
+         * @return KErrNone if succesful, KErrAlreadyExists if this notification
+         *         handler is already used for requesting profile activation
+         *         notifications. In other cases another system wide error code.
+         */
+        virtual TInt RequestProfileActivationNotificationsL(
+                MProEngProfileActivationObserver& aObserver ) = 0;
+
+        /**
+         * Request notifications of active profile modifications.
+         * The notifications are received as long as
+         * CancelActiveProfileNotifications() or CancelAll() is called. If the
+         * client wants to change the observer, he should first cancel these
+         * notifications and then re-request them with the new observer
+         * instance.
+         * @since S60 3.1
+         * @param aObserver Reference to the observer to be notified in the
+         *        event of active profile modification.
+         * @return KErrNone if succesful, KErrAlreadyExists if this notification
+         *         handler is already used for requesting active profile
+         *         notifications. In other cases another system wide error code.
+         */
+        virtual TInt RequestActiveProfileNotificationsL(
+                MProEngActiveProfileObserver& aObserver ) = 0;
+
+        /**
+         * Request notifications about changes in the given profile.
+         * This is useful for cases when the client is interested about
+         * changes in a specific profile no matter if the profile is active or
+         * not. The notifications are received as long as
+         * CancelProfileNotifications() or CancelAll() is called. If the
+         * client wants to change the observer for the notifications about the
+         * same profile, he should first cancel these notifications and then
+         * re-request them with the new observer instance.
+         * @since S60 3.1
+         * @param aObserver Reference to the observer to be notified in the
+         *        event of modification of the specified profile.
+         * @param aProfileId the ID of the profile the changes of which has to
+         *        be notified.
+         * @return KErrNone if succesful, KErrAlreadyExists if this notification
+         *         handler is already used for requesting notifications of
+         *         changes in the given profile. KErrNotFound, if a profile with
+         *         the given ID does not exist. In other cases another system
+         *         wide error code.
+         */
+        virtual TInt RequestProfileNotificationsL(
+                MProEngProfileObserver& aObserver,
+                TInt aProfileId ) = 0;
+
+        /**
+         * Request notifications about changes in the profile name array. This
+         * includes the cases when: a new profile has been created, a profile
+         * has been deleted, the name of a profile has been changed.
+         * The notifications are received as long as
+         * CancelProfileNameArrayNotifications() or CancelAll() is called. If
+         * the client wants to change the observer, he should first cancel these
+         * notifications and then re-request them with the new observer
+         * instance.
+         * @since S60 3.1
+         * @param aObserver Reference to the observer to be notified in the
+         *        event of a profile name array modification.
+         * @return KErrNone if succesful, KErrAlreadyExists if this notification
+         *         handler is already used for requesting profile name array
+         *         notifications. In other cases another system wide error code.
+         */
+        virtual TInt RequestProfileNameArrayNotificationsL(
+                MProEngProfileNameArrayObserver& aObserver ) = 0;
+
+        /**
+         * Cancel the registration for receiving notifications about profile
+         * activation events.
+         * @since S60 3.1
+         */
+        virtual void CancelProfileActivationNotifications() = 0;
+
+        /**
+         * Cancel the registration for receiving notifications about the active
+         * profile modification events.
+         * @since S60 3.1
+         */
+        virtual void CancelActiveProfileNotifications() = 0;
+
+        /**
+         * Cancel the registration for receiving notifications about the given
+         * profile modification events.
+         * @since S60 3.1
+         * @param aProfileId The ID of the profile for which the client wants
+         *        to cancel the receiving of modification events.
+         */
+        virtual void CancelProfileNotifications( TInt aProfileId ) = 0;
+
+        /**
+         * Cancel the registration for receiving notifications about the changes
+         * in the profile name array.
+         * @since S60 3.1
+         */
+        virtual void CancelProfileNameArrayNotifications() = 0;
+
+        /**
+        * Cancel all the registrations for receiving notifications.
+        * @since Series 60 3.1
+        */
+        virtual void CancelAll() = 0;
+
+    public:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MProEngNotifyHandler() {}
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngNotifyHandlerExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGNOTIFYHANDLER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfile.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile settings interface.
+*
+*/
+
+
+
+#ifndef MPROENGPROFILE_H
+#define MPROENGPROFILE_H
+
+//  INCLUDES
+#include <cntdef.h> // TContactItemId
+
+// FORWARD DECLARATIONS
+class MProEngProfileName;
+class MProEngTones;
+class MProEngToneSettings;
+class MProEngProfileExt;
+
+// CLASS DECLARATION
+
+/**
+*  Profile settings interface.
+*  MProEngProfile offers methods to get the alert for items, profile settings
+*  and profile name interface.
+*  How to use:
+*  @code
+*  // Get active profile with MProEngEngine::ActiveProfileL().
+*  MProEngProfile* profile = iProfileEngine->ActiveProfileL();
+*
+*  // Use profile object here...
+*
+*  // When you are ready, free resources with MProEngProfile::Release()
+*  profile->Release();
+*
+*  // If you release resources in destructor then:
+*  if( iProfile )
+*      {
+*      iProfile->Release();
+*      }
+*
+*  // If you put this class to CleanupStack then use void CleanupReleasePushL()
+*  CleanupReleasePushL( *profile );
+*  @endcode
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+class MProEngProfile
+    {
+    protected:  // Destructor
+
+        virtual ~MProEngProfile() {};
+
+    public: // New functions
+
+        /**
+        * Free resources of the profile.
+        * @since 3.1
+        */
+        virtual void Release() = 0;
+
+        /**
+        * Return the alert for item array.
+        * Only the calls coming from people who belong to one or more
+        * "Alert for" groups returned here trigger an audible alert.
+        * @since 3.1
+        * @return Alert for array
+        */
+        virtual const TArray<TContactItemId> AlertForL() = 0;
+
+        /**
+        * This method set alert for items to the profile.
+        * Only the calls coming from people who belong to one or more
+        * "Alert for" groups set here trigger an audible alert.
+        * @since 3.1
+        * @param aAlertFor Alert for array. If the length of this array is 0,
+        *        it is interpreted: "alert for all calls".
+        * @return KErrAccessDenied, if the "Alert for" groups setting of the
+        *         profile is unmodifiable.
+        *         KErrArgument, if the argument array is too large.
+        *         KErrNone, if succesful.
+        */
+        virtual TInt SetAlertForL(
+            const TArray<TContactItemId>& aAlertFor ) = 0;
+
+        /**
+        * Return whether this profile is silent. A profile being silent means
+        * that either the ringing type is silent or all the alert tones are set
+        * to "None".
+        * @since 3.1
+        * @return ETrue if this profile is silent.
+        */
+        virtual TBool IsSilent() const = 0;
+
+        /**
+        * Return profile name interface.
+        * @since 3.1
+        * @return Instance of the profile name interface.
+        */
+        virtual MProEngProfileName& ProfileName() const = 0;
+
+        /**
+        * Return profile tones interface.
+        * @since 3.1
+        * @return Instance of the profile tones interface.
+        */
+        virtual MProEngTones& ProfileTones() const = 0;
+
+        /**
+        * Returns tone settings of this profile.
+        * @since 3.1
+        * @return Returns tone settings of this profile.
+        */
+        virtual MProEngToneSettings& ToneSettings() const = 0;
+
+        /**
+        * Store profile settings.
+        * Leaves with:
+        * KErrAccessDenied if one or more of the settings of this profile is/are
+        * read-only,<br>
+        * KErrAlreadyExists if the profile name has been changed and there
+        * already is a profile with the same name,<br>
+        * KErrNotFound if a file set as an alert tone cannot be found,<br>
+        * KErrNotSupported if the MIME type of a file set as an alert tone is
+        * not supported to be used as an alert tone,<br>
+        * KErrArgument if a file set as an alert tone is DRM-protected but the
+        * platform does not allow the files of this MIME type to be set as alert
+        * tones when protected,<br>
+        * KErrPermissionDenied, if a file set as an alert tone is not
+        * DRM-protected and the platform does not allow the files of this MIME
+        * type to be set as alert tones when unprotected,<br>
+        * KErrCancel, if a file set as an alert tone is an unactivated DRM file
+        * and user does not want to activate it,<br>
+        * KErrTooBig if the tone file set for ringing tone (line 1 or line 2) is
+        * too big in case the platform has this kind of limitation set,<br>
+        * another system-wide error code.
+        * 
+        * Only processes with WriteDeviceData capability can succesfully call
+        * this method.
+        * @since 3.1
+        */
+        virtual void CommitChangeL() = 0;
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngProfileExt* Extension() { return NULL; }
+
+    };
+
+#endif      //  MPROENGPROFILE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileActivationObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profile activation observer interface.
+*
+*/
+
+
+
+#ifndef MPROENGPROFILEACTIVATIONOBSERVER_H
+#define MPROENGPROFILEACTIVATIONOBSERVER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileActivationObserverExt;
+
+// CLASS DECLARATION
+
+/**
+* Profile activation observer interface.
+* Implement this interface to get notifications when the current active profile
+* changes.
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+class MProEngProfileActivationObserver
+    {
+    public: // New functions
+
+        /**
+        * Abstract method for handling profile activation event. This method is
+        * called always when a profile is activated, even if the current active
+        * profile is re-activated.
+        * @since S60 3.1
+        * @param aProfileId The ID of the new active profile.
+        */
+        virtual void HandleProfileActivatedL( TInt aProfileId ) = 0;
+                                         
+        /**
+         * Error handler for handling the errors in the profile activation
+         * notification process. If HandleProfileActivatedL() leaves, this
+         * method is called with the leave code. This method has default empty
+         * implementation.
+         * @since S60 3.1
+         * @param aError the code of the error which occurred during
+         *        notification process.
+         */
+        virtual void HandleProfileActivationNotificationError(
+                TInt /* aError */ ) {};
+
+
+    protected:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MProEngProfileActivationObserver() {}
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngProfileActivationObserverExt* Extension() {return NULL;}
+
+    };
+
+#endif      // MPROENGPROFILEACTIVATIONOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileName.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile name interface.
+*
+*/
+
+
+
+#ifndef MPROENGPROFILENAME_H
+#define MPROENGPROFILENAME_H
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileNameExt; 
+
+// CLASS DECLARATION
+
+/**
+*  Profile name interface.
+*  This interface offers methods to get profile ID and to get and set the
+*  profile name.
+*
+*  @lib N/A
+*  @since 3.1
+*/
+class MProEngProfileName
+    {
+    protected:  // Destructor
+
+        virtual ~MProEngProfileName() {};
+
+    public:
+        /**
+        * Returns ID of the profile.
+        * @since 3.1
+        * @return Returns ID of the profile.
+        */
+        virtual TInt Id() const = 0;
+
+        /**
+        * Returns the name of the profile.
+        * @since 3.1
+        * @return Returns name of the profile.
+        */
+        virtual const TDesC& Name() const = 0;
+
+        /**
+        * Set the name of the profile.
+        * @since 3.1
+        * @param aName Name of the profile.
+        * @return KErrNone if succesful,
+        *         KErrAccessDenied if name setting of this profile is read-only,
+        *         KErrAlreadyExists if the name is already used by another
+        *         profile.
+        *         
+        */
+        virtual TInt SetNameL( const TDesC& aName ) = 0;
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngProfileNameExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGPROFILENAME_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileNameArray.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile name array interface.
+*
+*/
+
+
+
+#ifndef MPROENGPROFILENAMEARRAY_H
+#define MPROENGPROFILENAMEARRAY_H
+
+//  INCLUDES
+#include <bamdesca.h> // MDesCArray
+
+// FORWARD DECLARATIONS
+class MProEngProfileName;
+class MProEngProfileNameArrayExt;
+
+// CLASS DECLARATION
+
+/**
+*  Profile name array interface.
+*
+*  How to use:
+*  Get profile names array with MProEngEngine::ProfileNameArrayLC().
+*  @code
+*  MProEngProfileNameArray* nameArray =
+*      iProfileEngine->ProfileNameArrayLC();
+*  @endcode
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+class MProEngProfileNameArray : public MDesCArray
+    {
+    public: // New functions
+
+        /**
+        * Return the ID of the profile in the given array index.
+        * @since 3.1
+        * @param aIndex index of the profile.
+        * @return Return the ID of the profile in the given array index.
+        *         KErrNotFound if the index is out of bounds.
+        */
+        virtual TInt ProfileId( TInt aIndex ) const = 0;
+
+        /**
+        * Find profile index by ID of the profile.
+        * @since 3.1
+        * @param aId ID of the profile.
+        * @return Return index of the profile. KErrNotFound if
+        *         profile isn't found.
+        */
+        virtual TInt FindById( TInt aId ) const = 0;
+
+        /**
+        * Find profile index by name of the profile.
+        * @since 3.1
+        * @param aProfileName name of the profile.
+        * @return Return index of the profile. KErrNotFound if
+        *         profile isn't found.
+        */
+        virtual TInt FindByName( const TDesC& aProfileName ) const = 0;
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngProfileNameArrayExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGPROFILENAMEARRAY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileNameArrayObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile name array modification observer interface.
+*
+*/
+
+
+
+#ifndef MPROENGPROFILENAMEARRAYOBSERVER_H
+#define MPROENGPROFILENAMEARRAYOBSERVER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileNameArrayObserverExt;
+
+// CLASS DECLARATION
+
+/**
+* Profile name array modification observer interface.
+* Implement this interface to get notifications of changes in the data of a
+* selected profile.
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+class MProEngProfileNameArrayObserver
+    {
+    public: // New functions
+
+        /**
+        * Abstract method for handling profile name array modification event.
+        * This method is called when the contents of profile name array is
+        * changed some way. These cases include:
+        * - a profile has been created,
+        * - a profile has been deleted,
+        * - the name of a profile has been changed.
+        * Note, that when there has been many simultaneous changes in Profiles
+        * data so that it cannot be identified what has changed, then this
+        * method may be called even if nothing hasn't actually changed in the
+        * name array content.
+        * @since S60 3.1
+        */
+        virtual void HandleProfileNameArrayModificationL() = 0;
+
+        /**
+         * Error handler for handling the errors in the profile name array
+         * modification notification process.
+         * If HandleProfileNameArrayModificationL() leaves, this method is
+         * called with the leave code. This method has default empty
+         * implementation.
+         * @since S60 3.1
+         * @param aError the code of the error which occurred during
+         *        notification process.
+         */
+        virtual void HandleProfileNameArrayNotificationError(
+                TInt /* aError */ ) {};
+
+    protected:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MProEngProfileNameArrayObserver() {}
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngProfileNameArrayObserverExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGPROFILENAMEARRAYOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngProfileObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profile modification observer interface.
+*
+*/
+
+
+
+#ifndef MPROENGPROFILEOBSERVER_H
+#define MPROENGPROFILEOBSERVER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileObserverExt;
+
+// CLASS DECLARATION
+
+/**
+* Profile modification observer interface.
+* Implement this interface to get notifications of changes in the data of a
+* selected profile.
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+class MProEngProfileObserver
+    {
+    public: // New functions
+
+        /**
+        * Abstract method for handling profile modification event.
+        * This method is called when one of client chosen profiles has been
+        * modified some way.
+        * @since S60 3.1
+        * @param aProfileId The ID of the profile that was modified. If there
+        * has been many simultaneous changes in Profiles data, so that one
+        * profile cannot be identified, this is KErrNotFound. In this case,
+        * client gets this notification as many times as there are profiles
+        * he has requested notifications about. The savest way is to use
+        * own handlers for every profile of interest.
+        */
+        virtual void HandleProfileModifiedL( TInt aProfileId ) = 0;
+
+        /**
+         * Error handler for handling the errors in the profile modification
+         * notification process. If HandleProfileModifiedL() leaves,
+         * this method is called with the leave code. This method has
+         * default empty implementation.
+         * @since S60 3.1
+         * @param aError the code of the error which occurred during
+         *        notification process.
+         */
+        virtual void HandleProfileNotificationError(
+                TInt /* aError */ ) {};
+
+    protected:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MProEngProfileObserver() {}
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngProfileObserverExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGPROFILEOBSERVER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngToneSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile tone settings interface.
+*
+*/
+
+
+
+#ifndef MPROENGTONESETTINGS_H
+#define MPROENGTONESETTINGS_H
+
+// INCLUDES
+#include <e32std.h>
+#include <Profile.hrh>
+
+// FORWARD DECLARATIONS
+class MProEngToneSettingsExt;
+
+// CLASS DECLARATION
+
+/**
+*  Profile tone settings interface.
+*  This interface offers methods to set and get the following settings: ringing
+*  type, keypad volume, ringing volume, vibrating alert, warning and game tones
+*  and text-to-speech.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+class MProEngToneSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProEngToneSettings() {};
+
+    public:
+
+        /**
+        * Returns the ringing type.
+        * @since 3.1
+        * @return Returns the ringing type.
+        */
+        virtual TProfileRingingType RingingType() const = 0;
+
+        /**
+        * Returns the keypad volume.
+        * @since 3.1
+        * @return Returns the keypad volume.
+        */
+        virtual TProfileKeypadVolume KeypadVolume() const = 0;
+
+        /**
+        * Returns the ringing volume.
+        * @since 3.1
+        * @return Returns the ringing volume.
+        */
+        virtual TProfileRingingVolume RingingVolume() const = 0;
+
+        /**
+        * Returns the state of vibrating alert setting.
+        * @since 3.1
+        * @return Returns the state of vibrating alert setting.
+        */
+        virtual TBool VibratingAlert() const = 0;
+
+        /**
+        * Returns the state of warning and game tones setting.
+        * @since 3.1
+        * @return Returns the state of warning and game tones setting.
+        */
+        virtual TBool WarningAndGameTones() const = 0;
+
+        /**
+        * Returns the state of text-to-speech setting.
+        * @since 3.1
+        * @return Returns the state of text-to-speech setting.
+        */
+        virtual TBool TextToSpeech() const = 0;
+
+        /**
+        * Sets the ringing type.
+        * @since 3.1
+        * @param aRingingType The new value for ringing type.
+        * @return KErrNone if succesful, KErrAccessDenied if ringing type
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetRingingType( TProfileRingingType aRingingType ) = 0;
+
+        /**
+        * Sets the keypad volume.
+        * @since 3.1
+        * @param aKeypadVolume The new value for keypad tones volume.
+        * @return KErrNone if succesful, KErrAccessDenied if keypad tones
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetKeypadVolume( TProfileKeypadVolume aKeypadVolume ) = 0;
+
+        /**
+        * Sets the ringing volume.
+        * @since 3.1
+        * @param aRingingVolume The new value for ringing volume.
+        * @return KErrNone if succesful, KErrAccessDenied if ringing volume
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetRingingVolume(
+                TProfileRingingVolume aRingingVolume ) = 0;
+
+        /**
+        * Sets the state of vibrating alert setting.
+        * @since 3.1
+        * @param aVibratingAlert The new state for the vibrating alert setting.
+        * @return KErrNone if succesful, KErrAccessDenied if vibrating alert
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetVibratingAlert( TBool aVibratingAlert ) = 0;
+
+        /**
+        * Sets the state of warning and game tones setting.
+        * @since 3.1
+        * @param aWarningAndGameTones The new state for Warning and Game tones
+        * setting.
+        * @return KErrNone if succesful, KErrAccessDenied if warning and game
+        *         tones setting of this profile is read-only.
+        */
+        virtual TInt SetWarningAndGameTones( TBool aWarningAndGameTones ) = 0;
+
+        /**
+        * Sets the state of text-to-speech setting.
+        * @since 3.1
+        * @param aTextToSpeech The new state for text-to-speech setting.
+        * @return KErrNone if succesful, KErrAccessDenied if text-to-speech
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetTextToSpeech( TBool aTextToSpeech ) = 0;
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngToneSettingsExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGTONESETTINGS_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile tones interface.
+*
+*/
+
+
+
+#ifndef MPROENGTONES_H
+#define MPROENGTONES_H
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class MProEngTonesExt;
+
+// CLASS DECLARATION
+
+/**
+*  Profile tones interface.
+*  This interface offers methods to get line 1 and 2 ringing tone,
+*  message alert tone, e-mail alert tone and video call alert tone.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+class MProEngTones
+    {
+    protected:  // Destructor
+
+        virtual ~MProEngTones() {};
+
+    public:
+
+        /**
+        * Returns line 1 ringing tone file name.
+        * @since 3.1
+        * @return Returns line 1 ringing tone file name.
+        */
+        virtual const TDesC& RingingTone1() const = 0;
+
+        /**
+        * Returns line 2 ringing tone file name. If alternate line service
+        * isn't supported by the network, this isn't used for anything.
+        * @since 3.1
+        * @return Returns line 2 ringing tone file name.
+        */
+        virtual const TDesC& RingingTone2() const = 0;
+
+        /**
+        * Returns message alert tone file name.
+        * @since 3.1
+        * @return Returns message alert tone file name.
+        */
+        virtual const TDesC& MessageAlertTone() const = 0;
+
+        /**
+        * Returns Email alert tone file name.
+        * @since 3.1
+        * @return Returns Email alert tone file name.
+        */
+        virtual const TDesC& EmailAlertTone() const = 0;
+
+        /**
+        * Returns Video call ringing tone file name.
+        * @since 3.1
+        * @return Returns Video call ringing tone file name.
+        */
+        virtual const TDesC& VideoCallRingingTone() const = 0;
+
+        /**
+        * Set line 1 ringing tone.
+        * @since 3.1
+        * @param aRingingTone File name of the ringing tone. If the ringing tone
+        *        should be left empty, this should be KNullDesC.
+        * @return KErrNone if succesful, KErrAccessDenied if line 1 ringing tone
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetRingingTone1L( const TDesC& aRingingTone ) = 0;
+
+        /**
+        * Set line 2 ringing tone. Note, that this tone can be set even if the
+        * network does not support the alternate line service. In this case, the
+        * value of line 2 ringing tone is still saved in Profiles data but it
+        * isn't used for anything.
+        * @since 3.1
+        * @param aRingingTone File name of the ringing tone. If the line 2
+        *        ringing tone should be left empty, this should be KNullDesC.
+        * @return KErrNone if succesful, KErrAccessDenied if line 2 ringing tone
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetRingingTone2L( const TDesC& aRingingTone ) = 0;
+
+        /**
+        * Set message alert tone.
+        * @since 3.1
+        * @param aMessageAlertTone File name of the message alert tone. If the
+        *        alert tone should be left empty, this should be KNullDesC.
+        * @return KErrNone if succesful, KErrAccessDenied if message alert tone
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetMessageAlertToneL(
+            const TDesC& aMessageAlertTone ) = 0;
+
+        /**
+        * Set Email alert tone file name.
+        * @since 3.1
+        * @param aEmailAlertTone Email alert tone. If the alert tone should be
+        *        be left empty, this should be KNullDesC.
+        * @return KErrNone if succesful, KErrAccessDenied if e-mail alert tone
+        *         setting of this profile is read-only.
+        */
+        virtual TInt SetEmailAlertToneL(
+            const TDesC& aEmailAlertTone ) = 0;
+
+        /**
+        * Set Video call ringing tone file name.
+        * @since 3.1
+        * @param aRingingTone Video call ringing tone file name. If the alert
+        *        tone should be left empty, this should be KNullDesC.
+        * @return KErrNone if succesful, KErrAccessDenied if video call ringing
+        *         tone setting of this profile is read-only.
+        */
+        virtual TInt SetVideoCallRingingToneL(
+            const TDesC& aRingingTone ) = 0;
+
+    private: // Extension interface
+
+        /**
+        * This member is internal and not intended for use.
+        */
+        virtual MProEngTonesExt* Extension() { return NULL; }
+
+    };
+
+#endif      // MPROENGTONES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/ProEngFactory.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Factory for Profiles Engine Wrapper.
+*
+*/
+
+
+
+#ifndef PROENGFACTORY_H
+#define PROENGFACTORY_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class RFs;
+class MProEngEngine;
+class MProEngAlertToneSeeker;
+class MProEngNotifyHandler;
+
+// CLASS DECLARATION
+
+/**
+*  Factory for Profiles Engine Wrapper.
+*  You can create new instances of Profiles Engines, Notification Handlers and
+*  Alert Tone Seekers by using this factory.<br><br>
+*  Example:
+*  @code
+*  // Create a new instance of Profiles Engine:
+*  MProEngEngine* engine =
+*      ProEngFactory::NewEngineLC();
+*
+*  // Create a new instance of Notification Handler:
+*  MProEngNotifyHandler* notifyHandler =
+*      ProEngFactory::NewNotifyHandlerL();
+*
+*  // Create a new instance of Alert Tone Seeker:
+*  MProEngAlertToneSeeker* toneSeeker =
+*      ProEngFactory::NewAlertToneSeekerL();
+*  @endcode
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+class ProEngFactory
+    {
+    public: // New functions
+
+        /**
+        * Create a new instance of Profiles Engine.
+        * @since Series 60 3.1
+        * @return New instance of Profiles Engine.
+        *         Ownership is transferred to the client application.
+        */
+        IMPORT_C static MProEngEngine* NewEngineL();
+
+        /**
+        * Create a new instance of Profiles Engine. The created object is
+        * pushed into the cleanup stack.
+        * @since Series 60 3.1
+        * @return New instance of Profiles Engine.
+        *         Ownership is transferred to the client application.
+        */
+        IMPORT_C static MProEngEngine* NewEngineLC();
+
+        /**
+        * Create a new instance of Profiles Engine.
+        * @since Series 60 3.1
+        * @param aFs A reference to an open file server session. aFs must
+        *        remain connected for the lifetime of the returned object.
+        * @return New instance of Profiles Engine.
+        *         Ownership is transferred to the client application.
+        */
+        IMPORT_C static MProEngEngine* NewEngineL( RFs& aFs );
+
+        /**
+        * Create a new instance of Profiles Engine. The created object is
+        * pushed into the cleanup stack.
+        * @since Series 60 3.1
+        * @param aFs A reference to an open file server session. aFs must
+        *        remain connected for the lifetime of the returned object.
+        * @return New instance of Profiles Engine.
+        *         Ownership is transferred to the client application.
+        */
+        IMPORT_C static MProEngEngine* NewEngineLC( RFs& aFs );
+
+        /**
+        * Create a new instance of Profiles Notification Handler.
+        * @since Series 60 3.1
+        * @return New instance of Notification Handler.
+        *         Ownership is transferred to the client application.
+        */
+        IMPORT_C static MProEngNotifyHandler* NewNotifyHandlerL();
+
+        /**
+        * Create a new instance of Profiles Alert Tone Seeker.
+        * @since Series 60 3.1
+        * @return New instance of Alert Tone Seeker.
+        *         Ownership is transferred to the client application.
+        */
+        IMPORT_C static MProEngAlertToneSeeker* NewAlertToneSeekerL();
+
+    private:
+
+        // Prohibit C++ default constructor.
+        ProEngFactory();
+        // Prohibit Destructor.
+        ~ProEngFactory();
+
+    };
+
+#endif      // PROENGFACTORY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/Profile.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine enumerations TProfileKeypadVolume,
+*                TProfileRingingType, TDefaultProfileId and
+*                TProfileRingingVolume
+*
+*/
+
+
+#ifndef __PROFILE_HRH__
+#define __PROFILE_HRH__
+
+// DATA TYPES
+
+/**
+* Ringing type of an alert tone. This affects how the tone is actually played
+* when a call or a message arrives.
+*/
+enum TProfileRingingType
+    {
+    /** The tone is played in a loop.
+    */
+    EProfileRingingTypeRinging      = 0,
+    /**
+    * The tone is played in a loop. On the 1st round, the volume is gradually
+    * increment from the lowest level to the set level.
+    */
+    EProfileRingingTypeAscending    = 1,
+    /** The tone is played only once.
+    */
+    EProfileRingingTypeRingingOnce  = 2,
+    /**
+    * The phone only beeps once instead of playing the tone if one has been set.
+    */
+    EProfileRingingTypeBeepOnce     = 3,
+    /** The phone is silent.
+    */
+    EProfileRingingTypeSilent       = 4
+    };
+
+/**
+* Available volume levels for keypad tones.
+*/
+enum TProfileKeypadVolume
+    {
+    EProfileKeypadVolumeOff    = 0,
+    EProfileKeypadVolumeLevel1 = 1,
+    EProfileKeypadVolumeLevel2 = 2,
+    EProfileKeypadVolumeLevel3 = 3
+    };
+
+/**
+* Default profile identifiers. Default profiles are those pre-installed in the
+* phone.
+*/
+enum TDefaultProfileId
+    {
+    EProfileGeneralId   = 0,
+    EProfileSilentId    = 1,
+    EProfileMeetingId   = 2,
+    EProfileOutdoorId   = 3,
+    EProfilePagerId     = 4,
+	EProfileOffLineId   = 5, ///< Use this only if Off-Line Profile is supported
+	EProfileDriveId   = 6    ///< Use this only if Drive Profile is supported
+    };
+
+/**
+* Available volume levels for alert tones.
+*/
+enum TProfileRingingVolume
+    {
+    EProfileRingingVolumeLevel1 = 1,
+    EProfileRingingVolumeLevel2 = 2,
+    EProfileRingingVolumeLevel3 = 3,
+    EProfileRingingVolumeLevel4 = 4,
+    EProfileRingingVolumeLevel5 = 5,
+    EProfileRingingVolumeLevel6 = 6,
+    EProfileRingingVolumeLevel7 = 7,
+    EProfileRingingVolumeLevel8 = 8,
+    EProfileRingingVolumeLevel9 = 9,
+    EProfileRingingVolumeLevel10 = 10
+    };
+
+#endif // __PROFILE_HRH__
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/profiles_engine_wrapper_api.metaxml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="3006998ae00188df3141cbd063ed494b" dataversion="2.0">
+  <name>Profiles Engine Wrapper API</name>
+  <description>A public interface for getting and setting profile information/settings and for searching all the tone files that can be used as alert tones. No new profiles can be created and the existing profiles cannot be deleted by using this interface.</description>
+  <type>c++</type>
+  <collection>profilesservices</collection>
+  <libs>
+    <lib name="ProfileEngine.lib" />
+  </libs>
+  <release category="public" sinceversion="0"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/Bmarm/ProEngWrapAPIU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/Bwins/ProEngWrapAPIU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/EABI/ProEngWrapAPIU.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.cfg	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,426 @@
+[Test]
+title NewEngineL
+create ProEngWrapAPI foobar
+foobar NewEngineL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title NewEngineLC
+create ProEngWrapAPI foobar
+foobar NewEngineLC pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title NewEngineLCWithRFsL
+create ProEngWrapAPI foobar
+foobar NewEngineLCWithRFsL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title NewNotifyHandlerL
+create ProEngWrapAPI foobar
+foobar NewNotifyHandlerL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ReqProfActNotificationsL
+create ProEngWrapAPI foobar
+foobar ReqProfActNotificationsL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title CanProfActNotificationsL
+create ProEngWrapAPI foobar
+foobar CanProfActNotificationsL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ReqActProfNotificationsL
+create ProEngWrapAPI foobar
+foobar ReqActProfNotificationsL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title CanActProfNotificationsL
+create ProEngWrapAPI foobar
+foobar CanActProfNotificationsL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ReqProfNotificationsL
+create ProEngWrapAPI foobar
+foobar ReqProfNotificationsL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title CanProfNotificationsL
+create ProEngWrapAPI foobar
+foobar CanProfNotificationsL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ReqProfNameArrayNotL
+create ProEngWrapAPI foobar
+foobar ReqProfNameArrayNotL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title CanProfNameArrayNotL
+create ProEngWrapAPI foobar
+foobar CanProfNameArrayNotL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title CancelAllL
+create ProEngWrapAPI foobar
+foobar CancelAllL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title ActiveProfileLC
+create ProEngWrapAPI foobar
+foobar ActiveProfileLC pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ActiveProfileL
+create ProEngWrapAPI foobar
+foobar ActiveProfileL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ActiveProfileIdL
+create ProEngWrapAPI foobar
+foobar ActiveProfileIdL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ProfileNameArrayLC
+create ProEngWrapAPI foobar
+foobar ProfileNameArrayLC pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title SetActiveProfileL
+create ProEngWrapAPI foobar
+foobar SetActiveProfileL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ProfileLC
+create ProEngWrapAPI foobar
+foobar ProfileLC pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title ProfileL
+create ProEngWrapAPI foobar
+foobar ProfileL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title MdcaCountL
+create ProEngWrapAPI foobar
+foobar MdcaCountL pa ra me ters
+delete foobar
+[Endtest] 
+
+[Test]
+title MdcaPointL
+create ProEngWrapAPI foobar
+foobar MdcaPointL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title ProfileIdL
+create ProEngWrapAPI foobar
+foobar ProfileIdL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title FindByIdL
+create ProEngWrapAPI foobar
+foobar FindByIdL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title FindByNameL
+create ProEngWrapAPI foobar
+foobar FindByNameL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title ProfileNameL
+create ProEngWrapAPI foobar
+foobar ProfileNameL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title ProfileTonesL
+create ProEngWrapAPI foobar
+foobar ProfileTonesL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title ToneSettingsL
+create ProEngWrapAPI foobar
+foobar ToneSettingsL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title AlertForL
+create ProEngWrapAPI foobar
+foobar AlertForL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetAlertForL
+create ProEngWrapAPI foobar
+foobar SetAlertForL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title IsSilentL
+create ProEngWrapAPI foobar
+foobar IsSilentL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title CommitChangeL
+create ProEngWrapAPI foobar
+foobar CommitChangeL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title NameL
+create ProEngWrapAPI foobar
+foobar NameL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title IdL
+create ProEngWrapAPI foobar
+foobar IdL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetNameL
+create ProEngWrapAPI foobar
+foobar SetNameL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title RingingTone1L
+create ProEngWrapAPI foobar
+foobar RingingTone1L pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title RingingTone2L
+create ProEngWrapAPI foobar
+foobar RingingTone2L pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title MessageAlertToneL
+create ProEngWrapAPI foobar
+foobar MessageAlertToneL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title EmailAlertToneL
+create ProEngWrapAPI foobar
+foobar EmailAlertToneL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title VideoCallRingingToneL
+create ProEngWrapAPI foobar
+foobar VideoCallRingingToneL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetRingingTone1L
+create ProEngWrapAPI foobar
+foobar SetRingingTone1L pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetRingingTone2L
+create ProEngWrapAPI foobar
+foobar SetRingingTone2L pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetMessageAlertToneL
+create ProEngWrapAPI foobar
+foobar SetMessageAlertToneL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetEmailAlertToneL
+create ProEngWrapAPI foobar
+foobar SetEmailAlertToneL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetVideoCallRingingToneL
+create ProEngWrapAPI foobar
+foobar SetVideoCallRingingToneL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title RingingTypeL
+create ProEngWrapAPI foobar
+foobar RingingTypeL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title KeypadVolumeL
+create ProEngWrapAPI foobar
+foobar KeypadVolumeL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title RingingVolumeL
+create ProEngWrapAPI foobar
+foobar RingingVolumeL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title VibratingAlertL
+create ProEngWrapAPI foobar
+foobar VibratingAlertL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title WarningAndGameTonesL
+create ProEngWrapAPI foobar
+foobar WarningAndGameTonesL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title TextToSpeechL
+create ProEngWrapAPI foobar
+foobar TextToSpeechL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetRingingTypeL
+create ProEngWrapAPI foobar
+foobar SetRingingTypeL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetKeypadVolumeL
+create ProEngWrapAPI foobar
+foobar SetKeypadVolumeL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetRingingVolumeL
+create ProEngWrapAPI foobar
+foobar SetRingingVolumeL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetVibratingAlertL
+create ProEngWrapAPI foobar
+foobar SetVibratingAlertL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetWarningAndGameTonesL
+create ProEngWrapAPI foobar
+foobar SetWarningAndGameTonesL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title SetTextToSpeechL
+create ProEngWrapAPI foobar
+foobar SetTextToSpeechL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title NewAlertToneSeekerL
+create ProEngWrapAPI foobar
+foobar NewAlertToneSeekerL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title FetchAlertToneListL
+create ProEngWrapAPI foobar
+foobar FetchAlertToneListL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title CancelFetchL
+create ProEngWrapAPI foobar
+foobar CancelFetchL pa ra me ters
+delete foobar
+[Endtest]
+
+[Test]
+title NewEngineLWithRFsL
+create ProEngWrapAPI foobar
+foobar NewEngineL pa ra me ters
+delete foobar
+[Endtest] 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+#if defined(__S60_)
+        // To get the OS_LAYER_SYSTEMINCLUDE-definition
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          ProEngWrapAPI.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         ProEngWrapAPI.def
+
+#ifdef SBSV2
+USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    MW_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/internal
+	#endif // __S60_
+
+#else // SBSV2 not defined
+USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    MW_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/internal
+	#endif // __S60_
+
+SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          ProEngWrapAPI.cpp
+SOURCE          ProEngWrapAPIBlocks.cpp CSchedulerUtility.cpp
+
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         bafl.lib efsrv.lib
+LIBRARY         apparc.lib cone.lib eikcore.lib eikcoctl.lib avkon.lib eikctl.lib
+LIBRARY         commonengine.lib
+LIBRARY         profileengine.lib
+
+
+LANG            SC
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI_DoxyFile.txt	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,222 @@
+# Doxyfile 1.4.1
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = ProEngWrapAPI
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = Z:\\ProEngWrapAPI\
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = YES
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = 
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = NO
+EXTRACT_LOCAL_CLASSES  = NO
+EXTRACT_LOCAL_METHODS  = NO
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = NO
+GENERATE_TESTLIST      = NO
+GENERATE_BUGLIST       = NO
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = YES
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = Z:\\ProEngWrapAPI\
+FILE_PATTERNS          = *.h \
+                         *.rh \
+                         *.hrh
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = NO
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = YES
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = YES
+TOC_EXPAND             = YES
+DISABLE_INDEX          = YES
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = YES
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = YES
+RTF_OUTPUT             = Doc
+COMPACT_RTF            = YES
+RTF_HYPERLINKS         = YES
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = YES
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = NONSHARABLE_CLASS
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/TestFramework.ini	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,201 @@
+#
+# This is STIF initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module.
+# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
+#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
+#
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 'Empty', 'Summary', 'Environment',
+                                                     'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementdisablenone  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0                    # Default timeout value for each test case. In milliseconds
+UITestingSupport= YES        # Possible values: YES or NO
+SeparateProcesses= YES       # Possible values: YES or NO (default: NO)
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+TestCaseFile= c:\testframework\ProEngWrapAPI.cfg
+[End_Module]
+
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIF logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+#	- Will write log file in unicode format.
+#		+ YES, Log file will be written in unicode format
+#		+ NO, Log will be written as normal, not unicode, file.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+#NOTE: TestEngine and TestServer logging settings cannot change here
+
+#CreateLogDirectories= YES    # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML         # Possible values: TXT or HTML
+#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML         # Possible values: TXT or HTML
+#HardwareOutput= FILE         # Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES       # Possible values: YES or NO
+#WithTimeStamp= YES           # Possible values: YES or NO
+#WithLineBreak= YES           # Possible values: YES or NO
+#WithEventRanking= YES        # Possible values: YES or NO
+
+#FileUnicode= YES             # Possible values: YES or NO
+#AddTestCaseTitle= YES        # Possible values: YES or NO
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+proeng_z.bat		/epoc32/winscw/c/proeng_z.bat
+proeng_c.bat		/epoc32/winscw/c/proeng_c.bat
+ProEngWrapAPI.cfg       /Epoc32/winscw/c/testframework/ProEngWrapAPI.cfg
+testframework.ini /Epoc32/winscw/c/testframework/testframework_ProEngWrapAPI.ini
+
+PRJ_TESTMMPFILES
+
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+ProEngWrapAPI.mmp
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/proeng_c.bat	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy C:\TestFramework\testframework_ProEngWrapAPI.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule testscripter -config C:\TestFramework\ProEngWrapAPI.cfg
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\SP_ProEngWrapAPI.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/proeng_z.bat	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,25 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy z:\TestFramework\testframework_ProEngWrapAPI.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule testscripter -config C:\TestFramework\ProEngWrapAPI.cfg
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\SP_ProEngWrapAPI.txt
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/inc/CSchedulerUtility.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef CSCHEDULERUTILITY_H
+#define CSCHEDULERUTILITY_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+* A singleton class used to handle starting and stopping a new scheduler-loop
+* This stops the scheduler loop if it was started by this class.
+*
+*  @lib Profiles_PEC.lib
+*  @since 3.0
+*/
+class CSchedulerUtility : public CBase
+    {
+    public: // New functions
+        
+        /**
+        * Create and return instance of CSchedulerUtility.
+        * @since 3.0
+        * @return instance of CSchedulerUtility
+        */
+        //static CSchedulerUtility* InstanceL();
+    	
+        /** 
+        * Two-phased constructor.
+        */
+        static CSchedulerUtility* NewL();
+                
+        /**
+        * Destroys the scheduler utility instance.
+        * @since 3.0
+        */
+       // static void Release();
+
+        /**
+         * Starts a new scheduler loop if one isn't already started.
+         * @since 3.0
+         */
+        void Start();
+
+        /**
+         * Stops a scheduler loop if it was started by this class.
+         * @since 3.0
+         */
+        void Stop();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSchedulerUtility();
+        
+    private:  
+
+        /**
+        * C++ default constructor.
+        */
+        CSchedulerUtility();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    private:    // Data
+         
+        CActiveSchedulerWait* iWait;      
+
+    };
+
+#endif      // CSCHEDULERUTILITY_H
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/inc/ProEngWrapAPI.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,390 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef PROENGWRAPAPI_H
+#define PROENGWRAPAPI_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+
+#include <e32std.h>
+#include <e32debug.h>
+#include <e32base.h>
+#include <f32file.h>
+#include <e32property.h>
+#include <MProEngEngine.h>
+#include <MProEngProfile.h>
+#include <MProEngProfileName.h>
+#include <MProEngProfileNameArray.h>
+#include <MProEngTones.h>
+#include <ProEngFactory.h>
+#include <MProEngToneSettings.h>
+#include <MProEngAlertToneSeeker.h>
+#include <MProEngAlertToneSeekerObserver.h>
+#include <MProEngNotifyHandler.h>
+#include <MProEngActiveProfileObserver.h>
+#include <MProEngProfileActivationObserver.h>
+#include <MProEngProfileObserver.h>
+#include <MProEngProfileNameArrayObserver.h>
+#include "CSchedulerUtility.h"
+
+
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 31
+#define TEST_CLASS_VERSION_MINOR 8
+#define TEST_CLASS_VERSION_BUILD 48
+
+// Logging path
+_LIT( KProEngWrapAPILogPath, "\\logs\\testframework\\ProEngWrapAPI\\" ); 
+// Log file
+_LIT( KProEngWrapAPILogFile, "ProEngWrapAPI.txt" ); 
+_LIT( KProEngWrapAPILogFileWithTitle, "ProEngWrapAPI_[%S].txt" );
+
+// MODULE DATA STRUCTURES
+
+class CProEngVTNotifyHandlerWrapper : public CBase
+    {
+    public:
+        CProEngVTNotifyHandlerWrapper() {}
+        ~CProEngVTNotifyHandlerWrapper() { delete iNotifyHandler; }
+        void SetObject( MProEngNotifyHandler* aNotifyHandler )
+            {
+            iNotifyHandler = aNotifyHandler;
+            }
+    private:
+        MProEngNotifyHandler* iNotifyHandler;
+    };
+
+class CProEngVTAlertToneSeekerWrapper : public CBase
+    {
+    public:
+        CProEngVTAlertToneSeekerWrapper() {}
+        ~CProEngVTAlertToneSeekerWrapper() { delete iSeeker; }
+        void SetObject( MProEngAlertToneSeeker* aSeeker )
+            {
+            iSeeker = aSeeker;
+            }
+    private:
+        MProEngAlertToneSeeker* iSeeker;
+    };
+
+class CProEngVTSeekerObserver : public CBase,
+                                public MProEngAlertToneSeekerObserver
+    {
+    public:
+        CProEngVTSeekerObserver(CSchedulerUtility& aSchedulerUtility):iSchedulerUtility(aSchedulerUtility){
+        //iSchedulerUtility = aSchedulerUtility;
+        }
+        ~CProEngVTSeekerObserver() {};
+        void HandleAlertToneListCompletedL( MDesCArray* aToneList )
+            {
+            RDebug::Print( _L( "ProEng Validation test VTSeekerObserver::HndlAlrtTnLstCmpltd" ) );
+            delete aToneList;
+            iSchedulerUtility.Stop();
+           // CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleError( TInt /* aError */ )
+            {
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+    public:
+        CSchedulerUtility& iSchedulerUtility;
+    };
+
+class CProEngVTObserver: public CBase,
+                         public MProEngActiveProfileObserver,
+                         public MProEngProfileActivationObserver,
+                         public MProEngProfileObserver,
+                         public MProEngProfileNameArrayObserver
+    {
+    public:
+        CProEngVTObserver(CSchedulerUtility& aSchedulerUtility):iSchedulerUtility(aSchedulerUtility){
+        //iSchedulerUtility = aSchedulerUtility;
+        }
+        ~CProEngVTObserver() {};
+
+        void HandleActiveProfileModifiedL()
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof modified" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleActiveProfileNotificationError(
+                TInt /* aError */ )
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof error" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleProfileActivatedL( TInt /* aProfileId */ )
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof activated" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleProfileActivationNotificationError(
+                TInt /* aError */ )
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof activated error" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleProfileNameArrayModificationL()
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle name array notify" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleProfileNameArrayNotificationError(
+                TInt /* aError */ )
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle name array notify error" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleProfileModifiedL( TInt /* aProfileId */ )
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle profile notify" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+
+        void HandleProfileNotificationError(
+                TInt /* aError */ )
+            {
+            RDebug::Print( _L( "ProEng Validation test VTObserver handle profile notify error" ) );
+            iSchedulerUtility.Stop();
+            //CSchedulerUtility::InstanceL()->Stop();
+            }
+    public:
+        CSchedulerUtility& iSchedulerUtility;
+
+    };
+
+
+
+// FORWARD DECLARATIONS
+class CProEngWrapAPI;
+
+
+// CLASS DECLARATION
+
+/**
+*  CProEngWrapAPI test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CProEngWrapAPI) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProEngWrapAPI* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProEngWrapAPI();
+ 
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CProEngWrapAPI( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        virtual TInt NewEngineL();
+        virtual TInt NewEngineLC();
+        virtual TInt NewEngineLCWithRFsL();
+        virtual TInt NewNotifyHandlerL();
+        virtual TInt RequestProfileActivationNotificationsL();
+        virtual TInt CancelProfileActivationNotificationsL();
+        virtual TInt RequestActiveProfileNotificationsL();
+        virtual TInt CancelActiveProfileNotificationsL();
+        virtual TInt RequestProfileNotificationsL();
+        virtual TInt CancelProfileNotificationsL();
+        virtual TInt RequestProfileNameArrayNotificationsL();
+        virtual TInt CancelProfileNameArrayNotificationsL();
+        virtual TInt CancelAllL();
+        virtual TInt ActiveProfileLC();
+        virtual TInt ActiveProfileL();
+        virtual TInt ActiveProfileIdL();
+        virtual TInt ProfileNameArrayLC();
+        virtual TInt SetActiveProfileL();
+        virtual TInt ProfileLC();
+        virtual TInt ProfileL();
+        
+        virtual TInt MdcaCountL();
+        void TestProfileNameArrayMdcaCountL(MProEngProfileNameArray& aNameArray);
+        virtual TInt MdcaPointL();
+        void TestProfileNameArrayMdcaPointL(MProEngProfileNameArray& aNameArray);
+        virtual TInt ProfileIdL();
+        void TestProfileNameArrayProfileIdL(MProEngProfileNameArray& aNameArray);
+        virtual TInt FindByIdL();
+        void TestProfileNameArrayFindByIdL(MProEngProfileNameArray& aNameArray);
+        virtual TInt FindByNameL();
+        void TestProfileNameArrayFindByNameL(MProEngProfileNameArray& aNameArray);
+        
+        virtual TInt ProfileNameL();
+        void TestProfileSettingsProfileNameL(MProEngProfile& aProfile);
+        virtual TInt ProfileTonesL();
+        void TestProfileSettingsProfileTonesL(MProEngProfile& aProfile);
+        virtual TInt ToneSettingsL();
+        void TestProfileSettingsToneSettingsL(MProEngProfile& aProfile);
+        virtual TInt AlertForL();
+        void TestProfileSettingsAlertForL(MProEngProfile& aProfile);
+        virtual TInt SetAlertForL();
+        void TestProfileSettingsSetAlertForL(MProEngProfile& aProfile);
+        virtual TInt IsSilentL();
+        void TestProfileSettingsIsSilentL(MProEngProfile& aProfile);                
+        virtual TInt CommitChangeL();
+        void TestProfileSettingsCommitChangeL(MProEngProfile& aProfile);
+        
+        virtual TInt NameL();
+        void TestProfileSettingsNameL(MProEngProfile& aProfile);
+        virtual TInt IdL();
+        void TestProfileSettingsIdL(MProEngProfile& aProfile);
+        virtual TInt SetNameL();
+        void TestProfileSettingsSetNameL(MProEngProfile& aProfile);
+        
+        virtual TInt RingingTone1L();
+        void TestProfileSettingsRingingTone1L(MProEngProfile& aProfile);
+        virtual TInt RingingTone2L();
+        void TestProfileSettingsRingingTone2L(MProEngProfile& aProfile);
+        virtual TInt MessageAlertToneL();
+        void TestProfileSettingsMessageAlertToneL(MProEngProfile& aProfile);
+        virtual TInt EmailAlertToneL();
+        void TestProfileSettingsEmailAlertToneL(MProEngProfile& aProfile);
+        virtual TInt VideoCallRingingToneL();
+        void TestProfileSettingsVideoCallRingingToneL(MProEngProfile& aProfile);
+        virtual TInt SetRingingTone1L();
+        void TestProfileSettingsSetRingingTone1L(MProEngProfile& aProfile);
+        virtual TInt SetRingingTone2L();
+        void TestProfileSettingsSetRingingTone2L(MProEngProfile& aProfile);
+        virtual TInt SetMessageAlertToneL();
+        void TestProfileSettingsSetMessageAlertToneL(MProEngProfile& aProfile);
+        virtual TInt SetEmailAlertToneL();
+        void TestProfileSettingsSetEmailAlertToneL(MProEngProfile& aProfile);
+        virtual TInt SetVideoCallRingingToneL();
+        void TestProfileSettingsSetVideoCallRingingToneL(MProEngProfile& aProfile);
+        
+        virtual TInt RingingTypeL();
+        void TestProfileSettingsRingingTypeL(MProEngProfile& aProfile);
+        virtual TInt KeypadVolumeL();
+        void TestProfileSettingsKeypadVolumeL(MProEngProfile& aProfile);        
+        virtual TInt RingingVolumeL();
+        void TestProfileSettingsRingingVolumeL(MProEngProfile& aProfile);
+        virtual TInt VibratingAlertL();
+        void TestProfileSettingsVibratingAlertL(MProEngProfile& aProfile);
+        virtual TInt WarningAndGameTonesL();
+        void TestProfileSettingsWarningAndGameTonesL(MProEngProfile& aProfile);
+        virtual TInt TextToSpeechL();
+        void TestProfileSettingsTextToSpeechL(MProEngProfile& aProfile);
+        virtual TInt SetRingingTypeL();
+        void TestProfileSettingsSetRingingTypeL(MProEngProfile& aProfile);
+        virtual TInt SetKeypadVolumeL();
+        void TestProfileSettingsSetKeypadVolumeL(MProEngProfile& aProfile);        
+        virtual TInt SetRingingVolumeL();
+        void TestProfileSettingsSetRingingVolumeL(MProEngProfile& aProfile);
+        virtual TInt SetVibratingAlertL();
+        void TestProfileSettingsSetVibratingAlertL(MProEngProfile& aProfile);
+        virtual TInt SetWarningAndGameTonesL();
+        void TestProfileSettingsSetWarningAndGameTonesL(MProEngProfile& aProfile);
+        virtual TInt SetTextToSpeechL();
+        void TestProfileSettingsSetTextToSpeechL(MProEngProfile& aProfile);
+        
+        virtual TInt NewAlertToneSeekerL();
+        virtual TInt FetchAlertToneListL();
+        virtual TInt CancelFetchL();
+        
+        virtual TInt NewEngineLWithRFsL();
+
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        CSchedulerUtility* iSchedulerUtility;
+        RFs iFs;
+
+    };
+
+#endif      // PROENGWRAPAPI_H
+
+// End of File
Binary file gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.pkg	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,36 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"SP_ProEngWrapAPI"},(0x20015A1D),1,0,0,TYPE=SA
+[0x101F7961],3,*,*,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+
+"\Epoc32\Release\armv5\urel\ProEngWrapAPI.dll"-"!:\sys\bin\ProEngWrapAPI.dll"
+"\Epoc32\winscw\c\testframework\testframework_ProEngWrapAPI.ini"-"!:\TestFramework\testframework_ProEngWrapAPI.ini"
+"\Epoc32\winscw\c\testframework\ProEngWrapAPI.cfg"-"!:\TestFramework\ProEngWrapAPI.cfg"
+"\epoc32\winscw\c\proeng_c.bat"-"!:\proeng.bat"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/CSchedulerUtility.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include    "CSchedulerUtility.h"
+#include    <e32svr.h>
+
+// ============================ LOCAL DEFINITIONS ================= =============
+//static CSchedulerUtility* iInstance;
+//CSchedulerUtility* CSchedulerUtility::iInstance;
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSchedulerUtility::CSchedulerUtility
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSchedulerUtility::CSchedulerUtility()
+    {
+    RDebug::Print( _L( "Digia:CSchedulerUtility::CSchedulerUtility()" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CSchedulerUtility::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSchedulerUtility::ConstructL()
+    {
+    iWait = new ( ELeave ) CActiveSchedulerWait;
+    }
+
+// -----------------------------------------------------------------------------
+// CSchedulerUtility::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSchedulerUtility* CSchedulerUtility::NewL()
+    {
+    CSchedulerUtility* self = new( ELeave ) CSchedulerUtility;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+    
+// Destructor
+CSchedulerUtility::~CSchedulerUtility()
+    {
+    Stop();
+    delete iWait;
+    RDebug::Print( _L( "Digia:CSchedulerUtility::~CSchedulerUtility()" ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSchedulerUtility::InstanceL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*CSchedulerUtility* CSchedulerUtility::InstanceL()
+    {
+    if( iInstance == NULL )
+        {
+        iInstance = CSchedulerUtility::NewL();
+        }
+    return iInstance;
+    }
+*/
+/*void CSchedulerUtility::Release()
+    {
+    delete iInstance;
+    iInstance = NULL;
+    }
+*/
+// -----------------------------------------------------------------------------
+// CSchedulerUtility::Start
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CSchedulerUtility::Start()
+    {
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSchedulerUtility::Stop
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CSchedulerUtility::Stop()
+    {
+    if( iWait->IsStarted() )
+        {
+        iWait->AsyncStop();
+        }
+    }
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPI.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "ProEngWrapAPI.h"
+#include <SettingServerClient.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CProEngWrapAPI
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProEngWrapAPI::CProEngWrapAPI( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProEngWrapAPI::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    iSchedulerUtility = CSchedulerUtility::NewL(); 
+    User::LeaveIfError( iFs.Connect() );
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KProEngWrapAPILogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KProEngWrapAPILogFile);
+        }
+
+    iLog = CStifLogger::NewL( KProEngWrapAPILogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngWrapAPI* CProEngWrapAPI::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CProEngWrapAPI* self = new (ELeave) CProEngWrapAPI( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+   
+ //   CTestModuleIf &testMod = TestModuleIf();
+ //   testMod.SetBehaviour(ETestLeaksMem);
+
+    return self;
+
+    }
+
+// Destructor
+CProEngWrapAPI::~CProEngWrapAPI()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+   //CSchedulerUtility::Release(); 
+    if(iSchedulerUtility)
+        {
+        delete iSchedulerUtility;
+        iSchedulerUtility = NULL;
+        }
+
+   iFs.Close() ;  
+       
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CProEngWrapAPI::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CProEngWrapAPI::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("ProEngWrapAPI.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	
+    TestModuleIf().SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CProEngWrapAPI::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPIBlocks.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1930 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "ProEngWrapAPI.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CProEngWrapAPI::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "NewEngineL", CProEngWrapAPI::NewEngineL ),
+        ENTRY( "NewEngineLC", CProEngWrapAPI::NewEngineLC ),
+        ENTRY( "NewEngineLCWithRFsL", CProEngWrapAPI::NewEngineLCWithRFsL ),
+        ENTRY( "NewNotifyHandlerL", CProEngWrapAPI::NewNotifyHandlerL ),
+        ENTRY( "ReqProfActNotificationsL", CProEngWrapAPI::RequestProfileActivationNotificationsL ),
+        ENTRY( "CanProfActNotificationsL", CProEngWrapAPI::CancelProfileActivationNotificationsL ),
+        ENTRY( "ReqActProfNotificationsL", CProEngWrapAPI::RequestActiveProfileNotificationsL ),
+        ENTRY( "CanActProfNotificationsL", CProEngWrapAPI::CancelProfileActivationNotificationsL ),
+        ENTRY( "ReqProfNotificationsL", CProEngWrapAPI::RequestProfileNotificationsL ),
+        ENTRY( "CanProfNotificationsL", CProEngWrapAPI::CancelProfileNotificationsL ),
+        ENTRY( "ReqProfNameArrayNotL", CProEngWrapAPI::RequestProfileNameArrayNotificationsL ),
+        ENTRY( "CanProfNameArrayNotL", CProEngWrapAPI::CancelProfileNameArrayNotificationsL ),
+        ENTRY( "CancelAllL", CProEngWrapAPI::CancelAllL ),
+        ENTRY( "ActiveProfileLC", CProEngWrapAPI::ActiveProfileLC ),
+        ENTRY( "ActiveProfileL", CProEngWrapAPI::ActiveProfileLC ),
+        ENTRY( "ActiveProfileIdL", CProEngWrapAPI::ActiveProfileIdL ),
+        ENTRY( "ProfileNameArrayLC", CProEngWrapAPI::ProfileNameArrayLC ),
+        ENTRY( "SetActiveProfileL", CProEngWrapAPI::SetActiveProfileL ),
+        ENTRY( "ProfileLC", CProEngWrapAPI::ProfileLC ),
+        ENTRY( "ProfileL", CProEngWrapAPI::ProfileL ),
+        ENTRY( "MdcaCountL", CProEngWrapAPI::MdcaCountL ),
+        ENTRY( "MdcaPointL", CProEngWrapAPI::MdcaPointL ),
+        ENTRY( "ProfileIdL", CProEngWrapAPI::ProfileIdL ),
+        ENTRY( "FindByIdL", CProEngWrapAPI::FindByIdL ),
+        ENTRY( "FindByNameL", CProEngWrapAPI::FindByNameL ),
+        ENTRY( "ProfileNameL", CProEngWrapAPI::ProfileNameL ),
+        ENTRY( "ProfileTonesL", CProEngWrapAPI::ProfileTonesL ),
+        ENTRY( "ToneSettingsL", CProEngWrapAPI::ToneSettingsL ),
+        ENTRY( "AlertForL", CProEngWrapAPI::AlertForL ),
+        ENTRY( "SetAlertForL", CProEngWrapAPI::SetAlertForL ),
+        ENTRY( "IsSilentL", CProEngWrapAPI::IsSilentL ),
+        ENTRY( "CommitChangeL", CProEngWrapAPI::CommitChangeL ),
+        ENTRY( "NameL", CProEngWrapAPI::NameL ),
+        ENTRY( "IdL", CProEngWrapAPI::IdL ),
+        ENTRY( "SetNameL", CProEngWrapAPI::SetNameL ),
+        ENTRY( "RingingTone1L", CProEngWrapAPI::RingingTone1L ),
+        ENTRY( "RingingTone2L", CProEngWrapAPI::RingingTone2L ),
+        ENTRY( "MessageAlertToneL", CProEngWrapAPI::MessageAlertToneL ),
+        ENTRY( "EmailAlertToneL", CProEngWrapAPI::EmailAlertToneL ),
+        ENTRY( "VideoCallRingingToneL", CProEngWrapAPI::VideoCallRingingToneL ),
+        ENTRY( "SetRingingTone1L", CProEngWrapAPI::SetRingingTone1L ),
+        ENTRY( "SetRingingTone2L", CProEngWrapAPI::SetRingingTone2L ),
+        ENTRY( "SetMessageAlertToneL", CProEngWrapAPI::SetMessageAlertToneL ),
+        ENTRY( "SetEmailAlertToneL", CProEngWrapAPI::SetEmailAlertToneL ),
+        ENTRY( "SetVideoCallRingingToneL", CProEngWrapAPI::SetVideoCallRingingToneL ),
+        ENTRY( "RingingTypeL", CProEngWrapAPI::RingingTypeL ),
+        ENTRY( "KeypadVolumeL", CProEngWrapAPI::KeypadVolumeL ),
+        ENTRY( "RingingVolumeL", CProEngWrapAPI::RingingVolumeL ),
+        ENTRY( "VibratingAlertL", CProEngWrapAPI::VibratingAlertL ),
+        ENTRY( "WarningAndGameTonesL", CProEngWrapAPI::WarningAndGameTonesL ),
+        ENTRY( "TextToSpeechL", CProEngWrapAPI::TextToSpeechL ),
+        ENTRY( "SetRingingTypeL", CProEngWrapAPI::SetRingingTypeL ),
+        ENTRY( "SetKeypadVolumeL", CProEngWrapAPI::SetKeypadVolumeL ),
+        ENTRY( "SetRingingVolumeL", CProEngWrapAPI::SetRingingVolumeL ),
+        ENTRY( "SetVibratingAlertL", CProEngWrapAPI::SetVibratingAlertL ),
+        ENTRY( "SetWarningAndGameTonesL", CProEngWrapAPI::SetWarningAndGameTonesL ),
+        ENTRY( "SetTextToSpeechL", CProEngWrapAPI::SetTextToSpeechL ),
+        ENTRY( "NewAlertToneSeekerL", CProEngWrapAPI::NewAlertToneSeekerL ),
+        ENTRY( "FetchAlertToneListL", CProEngWrapAPI::FetchAlertToneListL ),
+        ENTRY( "CancelFetchL", CProEngWrapAPI::CancelFetchL ),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::NewEngineL
+// Test:    ProEngFactory::NewEngineL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::NewEngineL()
+    {
+    RDebug::Print( _L( "ProEng Validation test NewEngineL" ) );
+    MProEngEngine* engine( NULL );
+    TRAP_IGNORE( engine = ProEngFactory::NewEngineL() );
+      if(engine)
+        {
+        engine->Release();
+        engine = NULL;
+        }
+        return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::NewEngineLC
+// Test:    ProEngFactory::NewEngineLC()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::NewEngineLC()
+    {
+    RDebug::Print( _L( "ProEng Validation test NewEngineLC" ) );
+    MProEngEngine* engine(NULL);
+    engine = ProEngFactory::NewEngineLC();
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::NewEngineLCWithRFsL
+// Test:    ProEngFactory::NewEngineLC(RFs)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::NewEngineLCWithRFsL()
+    {
+     
+    RDebug::Print( _L( "ProEng Validation test NewEngineLCWithRFsL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::NewEngineLCWithRFsL
+// Test:    ProEngFactory::NewNotifyHandlerL()
+// Test:    MProEngNotifyHandler::RequestProfileActivationNotificationsL(MProEngProfileActivationObserver&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+
+TInt CProEngWrapAPI::NewNotifyHandlerL()
+    {
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if (nh)
+        {
+        wrapper->SetObject(nh);
+        }
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RequestProfileActivationNotificationsL
+// Test:    MProEngNotifyHandler::RequestProfileActivationNotificationsL(MProEngProfileActivationObserver&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RequestProfileActivationNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test RequestProfileActivationNotificationsL begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+
+    TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) );
+    engine->SetActiveProfileL( EProfileMeetingId );
+    iSchedulerUtility->Start();
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CancelProfileActivationNotificationsL
+// Test:    MProEngNotifyHandler::CancelProfileActivationNotifications()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::CancelProfileActivationNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test CancelProfileActivationNotificationsL begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+
+    TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) );
+    engine->SetActiveProfileL( EProfileMeetingId );
+    iSchedulerUtility->Start();
+    nh->CancelProfileActivationNotifications();
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RequestActiveProfileNotificationsL
+// Test:    MProEngNotifyHandler::RequestActiveProfileNotificationsL(MProEngActiveProfileObserver&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RequestActiveProfileNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test RequestProfileActivationNotificationsL begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+
+    MProEngProfile* activeProfile = engine->ActiveProfileLC();
+    MProEngToneSettings& ts( activeProfile->ToneSettings() );
+    TRAP_IGNORE( 
+            nh->RequestActiveProfileNotificationsL ( *observer ) );
+    ts.SetVibratingAlert( !ts.VibratingAlert() );
+    activeProfile->CommitChangeL();
+    iSchedulerUtility->Start();
+    CleanupStack::PopAndDestroy(); // activeProfile
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CancelActiveProfileNotificationsL
+// Test:    MProEngNotifyHandler::CancelActiveProfileNotifications()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::CancelActiveProfileNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test CancelActiveProfileNotifications begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+    MProEngProfile* activeProfile = engine->ActiveProfileLC();
+    MProEngToneSettings& ts( activeProfile->ToneSettings() );
+    RDebug::Print( _L( "ProEng Validation test TestNotifyHandler 5" ) );
+    TRAP_IGNORE( 
+            nh->RequestActiveProfileNotificationsL ( *observer ) );
+    ts.SetVibratingAlert( !ts.VibratingAlert() );
+    activeProfile->CommitChangeL();
+    iSchedulerUtility->Start();
+    nh->CancelActiveProfileNotifications();
+    CleanupStack::PopAndDestroy(); // activeProfile
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RequestProfileNotificationsL
+// Test:    MProEngNotifyHandler::RequestProfileNotificationsL(MProEngActiveProfileObserver&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RequestProfileNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test RequestProfileNotificationsL begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+
+    MProEngProfile* generalProfile = engine->ProfileLC( EProfileGeneralId );
+    MProEngToneSettings& ts2( generalProfile->ToneSettings() );
+    TRAP_IGNORE( 
+            nh->RequestProfileNotificationsL( *observer,
+                                                   EProfileGeneralId ) );
+    ts2.SetVibratingAlert( !ts2.VibratingAlert() );
+    generalProfile->CommitChangeL();
+    iSchedulerUtility->Start();
+    CleanupStack::PopAndDestroy(); // generalProfile
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CancelProfileNotificationsL
+// Test:    MProEngNotifyHandler::CancelProfileNotifications()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::CancelProfileNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test CancelProfileNotifications begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+    MProEngProfile* generalProfile = engine->ProfileLC( EProfileGeneralId );
+    MProEngToneSettings& ts2( generalProfile->ToneSettings() );
+    TRAP_IGNORE( 
+            nh->RequestProfileNotificationsL( *observer,
+                                                   EProfileGeneralId ) );
+    ts2.SetVibratingAlert( !ts2.VibratingAlert() );
+    generalProfile->CommitChangeL();
+    iSchedulerUtility->Start();
+    //CSchedulerUtility::InstanceL()->Start(); // observer stops this
+    nh->CancelProfileNotifications( EProfileMeetingId );
+    CleanupStack::PopAndDestroy(); // generalProfile
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RequestProfileNameArrayNotificationsL
+// Test:    MProEngNotifyHandler::RequestProfileNameArrayNotificationsL(MProEngActiveProfileObserver&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RequestProfileNameArrayNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test RequestProfileNameArrayNotificationsL begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+    MProEngProfile* silentProfile = engine->ProfileLC( EProfileSilentId );
+    MProEngProfileName& silentName( silentProfile->ProfileName() );
+    TRAP_IGNORE( 
+              nh->RequestProfileNameArrayNotificationsL ( *observer ) );
+      // All this hassle here is just for modifying the name in every run of this
+      // test so that we really get notification from Cenrep:
+    HBufC* nameBuf = silentName.Name().AllocLC();
+    TPtr ptr( nameBuf->Des() );
+    TInt lastCharPos( nameBuf->Length() - 1 );
+    const TUint KWrapperVTAllOnes( 0xFFFF );
+    ptr[lastCharPos] = ptr[lastCharPos] ^ KWrapperVTAllOnes;
+    silentName.SetNameL( *nameBuf );
+    CleanupStack::PopAndDestroy( nameBuf );
+    silentProfile->CommitChangeL();
+    iSchedulerUtility->Start();
+    CleanupStack::PopAndDestroy(); // silentProfile
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CancelProfileNameArrayNotificationsL
+// Test:    MProEngNotifyHandler::CancelProfileNameArrayNotifications()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::CancelProfileNameArrayNotificationsL()
+    {
+    RDebug::Print( _L( "ProEng Validation test CancelProfileNameArrayNotificationsL begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
+    CleanupStack::PushL( observer );
+    MProEngProfile* silentProfile = engine->ProfileLC( EProfileSilentId );
+    MProEngProfileName& silentName( silentProfile->ProfileName() );
+    TRAP_IGNORE( 
+              nh->RequestProfileNameArrayNotificationsL ( *observer ) );
+      // All this hassle here is just for modifying the name in every run of this
+      // test so that we really get notification from Cenrep:
+    HBufC* nameBuf = silentName.Name().AllocLC();
+    TPtr ptr( nameBuf->Des() );
+    TInt lastCharPos( nameBuf->Length() - 1 );
+    const TUint KWrapperVTAllOnes( 0xFFFF );
+    ptr[lastCharPos] = ptr[lastCharPos] ^ KWrapperVTAllOnes;
+    silentName.SetNameL( *nameBuf );
+    CleanupStack::PopAndDestroy( nameBuf );
+    silentProfile->CommitChangeL();
+    iSchedulerUtility->Start();
+    //CSchedulerUtility::InstanceL()->Start(); // observer stops this
+    nh->CancelProfileNameArrayNotifications();
+    CleanupStack::PopAndDestroy(); // silentProfile
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CancelAllL
+// Test:    MProEngEngine::CancelAll()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::CancelAllL()
+    {
+    RDebug::Print( _L( "ProEng Validation test CancelAllL begin" ) );
+    RDebug::Print( _L( "ProEng Validation test NewNotifyHandlerL" ) );
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    MProEngNotifyHandler* nh( NULL );
+    CProEngVTNotifyHandlerWrapper* wrapper = new ( ELeave )CProEngVTNotifyHandlerWrapper();
+    CleanupStack::PushL( wrapper );
+    TRAP_IGNORE( nh = ProEngFactory::NewNotifyHandlerL() );
+    if( nh )
+        {
+        wrapper->SetObject( nh ); //  takes ownership
+        }
+    nh->CancelAll();
+    CleanupStack::PopAndDestroy( wrapper );
+    CleanupStack::PopAndDestroy(); // engine
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ActiveProfileLC
+// Test:    MProEngEngine::ActiveProfileLC()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ActiveProfileLC()
+    {
+   RDebug::Print( _L( "ProEng Validation test ActiveProfileLC" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = engine->ActiveProfileLC();
+   CleanupStack::PopAndDestroy(); // prof
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ActiveProfileL
+// Test:    MProEngEngine::ActiveProfileL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ActiveProfileL()
+    {
+   RDebug::Print( _L( "ProEng Validation test ActiveProfileL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = engine->ActiveProfileL();
+   if(prof)
+       {
+       prof->Release();
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ActiveProfileId
+// Test:    MProEngEngine::ActiveProfileId()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ActiveProfileIdL()
+    {
+   RDebug::Print( _L( "ProEng Validation test ActiveProfileId" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   //RDebug::Print( _L( "ProEng Validation test TestEngineL 3" ) );
+   TInt id( engine->ActiveProfileId() );
+   RDebug::Print( _L( "Active id:%d" ), id ); 
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ProfileNameArrayLC
+// Test:    MProEngEngine::ProfileNameArrayLC()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ProfileNameArrayLC()
+    {
+   RDebug::Print( _L( "ProEng Validation test ProfileNameArrayLC" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   TRAP_IGNORE(
+           MProEngProfileNameArray* names( engine->ProfileNameArrayLC() );
+           CleanupStack::PopAndDestroy(); // names
+           );
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetActiveProfileL
+// Test:    MProEngEngine::SetActiveProfileL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetActiveProfileL()
+    {
+   RDebug::Print( _L( "ProEng Validation test SetActiveProfileL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   TRAP_IGNORE( engine->SetActiveProfileL( EProfileSilentId ) ); 
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ProfileLC
+// Test:    MProEngEngine::ProfileLC()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ProfileLC()
+    {
+   RDebug::Print( _L( "ProEng Validation test ProfileLC" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( 
+               prof = engine->ProfileLC( EProfileSilentId );
+               CleanupStack::PopAndDestroy(); // prof
+               prof = NULL;
+               );
+ 
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ProfileL
+// Test:    MProEngEngine::ProfileLC()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ProfileL()
+    {
+   RDebug::Print( _L( "ProEng Validation test ProfileL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       //TRAP_IGNORE( TestProfileSettingsL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::MdcaCountL
+// Test:    MProEngProfileNameArray::MdcaCount()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::MdcaCountL()
+    {
+   RDebug::Print( _L( "ProEng Validation test MdcaCount" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   TRAP_IGNORE(
+           MProEngProfileNameArray* names( engine->ProfileNameArrayLC() );
+           TestProfileNameArrayMdcaCountL( *names );
+           CleanupStack::PopAndDestroy(); // names
+            );
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+void CProEngWrapAPI::TestProfileNameArrayMdcaCountL(MProEngProfileNameArray& aNameArray)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileNameArrayMdcaCountL begin" ) );
+    TInt count( aNameArray.MdcaCount() );
+    RDebug::Print( _L( "count = %d" ), count );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::MdcaPointL
+// Test:    MProEngProfileNameArray::MdcaPoint(TInt)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::MdcaPointL()
+    {
+   RDebug::Print( _L( "ProEng Validation test MdcaPoint" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   TRAP_IGNORE(
+           MProEngProfileNameArray* names( engine->ProfileNameArrayLC() );
+           TestProfileNameArrayMdcaPointL( *names );
+           CleanupStack::PopAndDestroy(); // names
+            );
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+void CProEngWrapAPI::TestProfileNameArrayMdcaPointL(MProEngProfileNameArray& aNameArray)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileNameArrayMdcaPointL begin" ) );
+    TInt count( aNameArray.MdcaCount() );
+    RDebug::Print( _L( "count = %d" ), count );
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        TPtrC name( aNameArray.MdcaPoint( i ) );
+        RDebug::Print( _L( "ProEng Validation test nameArray[%d].MdcaPoint=%S" ), i, &name );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ProfileIdL
+// Test:    MProEngProfileNameArray::ProfileId(TInt)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ProfileIdL()
+    {
+   RDebug::Print( _L( "ProEng Validation test ProfileId" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   TRAP_IGNORE(
+           MProEngProfileNameArray* names( engine->ProfileNameArrayLC() );
+           TestProfileNameArrayProfileIdL( *names );
+           CleanupStack::PopAndDestroy(); // names
+            );
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+void CProEngWrapAPI::TestProfileNameArrayProfileIdL(MProEngProfileNameArray& aNameArray)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileNameArrayProfileIdL begin" ) );
+    TInt count( aNameArray.MdcaCount() );
+    RDebug::Print( _L( "count = %d" ), count );
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        TPtrC name( aNameArray.MdcaPoint( i ) );
+        TInt id( aNameArray.ProfileId( i ) );
+        RDebug::Print( _L( "ProEng Validation test nameArray[%d].MdcaPoint=%S" ), i, &name );
+        RDebug::Print( _L( "ProEng Validation test nameArray[%d].ProfileId=%d" ), i, id );
+        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::FindByIdL
+// Test:    MProEngProfileNameArray::FindById(TInt)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::FindByIdL()
+    {
+   RDebug::Print( _L( "ProEng Validation test FindByIdL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   TRAP_IGNORE(
+           MProEngProfileNameArray* names( engine->ProfileNameArrayLC() );
+           TestProfileNameArrayFindByIdL( *names );
+           CleanupStack::PopAndDestroy(); // names
+            );
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+
+void CProEngWrapAPI::TestProfileNameArrayFindByIdL(MProEngProfileNameArray& aNameArray)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileNameArrayFindByIdL begin" ) );
+    TInt count( aNameArray.MdcaCount() );
+    RDebug::Print( _L( "count = %d" ), count );
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        TPtrC name( aNameArray.MdcaPoint( i ) );
+        TInt id( aNameArray.ProfileId( i ) );
+        RDebug::Print( _L( "ProEng Validation test nameArray[%d].MdcaPoint=%S" ), i, &name );
+        RDebug::Print( _L( "ProEng Validation test nameArray[%d].ProfileId=%d" ), i, id );
+        
+        }
+    TInt idx( aNameArray.FindById( EProfileMeetingId ) );
+    RDebug::Print( _L( "ProEng Validation test Index of Meeting profile = %d" ), idx );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::FindByNameL
+// Test:    MProEngProfileNameArray::FindByName(const TDesC&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::FindByNameL()
+    {
+   RDebug::Print( _L( "ProEng Validation test FindByNameL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   TRAP_IGNORE(
+           MProEngProfileNameArray* names( engine->ProfileNameArrayLC() );
+           TestProfileNameArrayFindByNameL( *names );
+           CleanupStack::PopAndDestroy(); // names
+            );
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileNameArrayFindByNameL(MProEngProfileNameArray& aNameArray)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileNameArrayFindByNameL begin" ) );
+    TInt count( aNameArray.MdcaCount() );
+    RDebug::Print( _L( "count = %d" ), count );
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        TPtrC name( aNameArray.MdcaPoint( i ) );
+        TInt id( aNameArray.ProfileId( i ) );
+        RDebug::Print( _L( "ProEng Validation test nameArray[%d].MdcaPoint=%S" ), i, &name );
+        RDebug::Print( _L( "ProEng Validation test nameArray[%d].ProfileId=%d" ), i, id );
+        
+        }
+    TInt idx;
+    _LIT( KProEngVTSilent, "Silent" );
+    idx = aNameArray.FindByName( KProEngVTSilent );
+    RDebug::Print( _L( "ProEng Validation test Index of Silent profile = %d" ), idx );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ProfileNameL
+// Test:    MProEngProfile::ProfileName()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ProfileNameL()
+    {
+   RDebug::Print( _L( "ProEng Validation test ProfileNameL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsProfileNameL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsProfileNameL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsProfileNameL begin" ) );
+    MProEngProfileName& name( aProfile.ProfileName() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ProfileTonesL
+// Test:    MProEngProfile::ProfileTones()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ProfileTonesL()
+    {
+   RDebug::Print( _L( "ProEng Validation test ProfileTonesL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsProfileTonesL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsProfileTonesL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsProfileTonesL begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::ToneSettingsL
+// Test:    MProEngProfile::ToneSettings()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::ToneSettingsL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test ToneSettingsL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsToneSettingsL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsToneSettingsL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsRingingTypeL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::AlertForL
+// Test:    MProEngProfile::AlertForL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::AlertForL()
+    {
+   RDebug::Print( _L( "ProEng Validation test AlertForL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsAlertForL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsAlertForL(MProEngProfile& aProfile)
+    {
+    // Alert for getter/setter:
+    TRAP_IGNORE(const TArray<TContactItemId> alertFor = aProfile.AlertForL(););    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetAlertForL
+// Test:    MProEngProfile::SetAlertForL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetAlertForL()
+    {
+   RDebug::Print( _L( "ProEng Validation test setAlertForL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetAlertForL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetAlertForL(MProEngProfile& aProfile)
+    {
+    // Alert for getter/setter:
+     TRAP_IGNORE(
+            const TArray<TContactItemId> alertFor = aProfile.AlertForL();
+            aProfile.SetAlertForL( alertFor );
+            );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::IsSilentL
+// Test:    MProEngProfile::IsSilentL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::IsSilentL()
+    {
+   RDebug::Print( _L( "ProEng Validation test IsSilentL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsIsSilentL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsIsSilentL(MProEngProfile& aProfile)
+    {
+    TBool silent( aProfile.IsSilent() );
+    RDebug::Print( _L( "ProEng Validation test profile silent=%d" ), silent );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CommitChangeL
+// Test:    MProEngProfile::CommitChangeL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::CommitChangeL()
+    {
+   RDebug::Print( _L( "ProEng Validation test CommitChangeL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsCommitChangeL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsCommitChangeL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test before CommitChangeL" ) );
+    TRAP_IGNORE( aProfile.CommitChangeL() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::NameL
+// Test:    MProEngProfileName::Name()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::NameL()
+    {
+   RDebug::Print( _L( "ProEng Validation test NameL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsNameL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsNameL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsNameL begin" ) );
+    MProEngProfileName& name( aProfile.ProfileName() );
+    const TDesC& daName( name.Name() );
+    RDebug::Print( _L( "ProEng Validation test profile name=%S" ), &daName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::IdL
+// Test:    MProEngProfileName::Id()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::IdL()
+    {
+   RDebug::Print( _L( "ProEng Validation test IdL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsIdL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsIdL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsIdL begin" ) );
+    MProEngProfileName& name( aProfile.ProfileName() );
+    TInt id( name.Id() );
+    RDebug::Print( _L( "ProEng Validation test profile id=%d" ), id );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetNameL
+// Test:    MProEngProfileName::SetNameL(const TDesC&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetNameL()
+    {
+   RDebug::Print( _L( "ProEng Validation test SetNameL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetNameL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetNameL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetNameL begin" ) );
+    MProEngProfileName& name( aProfile.ProfileName() );
+    const TDesC& daName( name.Name() );
+    HBufC* nameToBeSet = daName.AllocLC();
+    RDebug::Print( _L( "ProEng Validation test before SetNameL" ) );
+    TRAP_IGNORE( name.SetNameL( *nameToBeSet ) );
+    CleanupStack::PopAndDestroy(nameToBeSet);
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RingingTone1L
+// Test:    MProEngTones::RingingTone1()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RingingTone1L()
+    {
+   RDebug::Print( _L( "ProEng Validation test RingingTone1L" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsRingingTone1L( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsRingingTone1L(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsRingingTone1L begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& rtone( tones.RingingTone1() );
+    RDebug::Print( _L( "ProEng Validation test rtone=%S" ), &rtone );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RingingTone2L
+// Test:    MProEngTones::RingingTone1()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RingingTone2L()
+    {
+   RDebug::Print( _L( "ProEng Validation test RingingTone2L" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsRingingTone2L( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsRingingTone2L(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsRingingTone2L begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& rtone2( tones.RingingTone2() );
+    RDebug::Print( _L( "ProEng Validation test rtone2 =%S" ), &rtone2 );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::MessageAlertToneL
+// Test:    MProEngTones::MessageAlertTone()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::MessageAlertToneL()
+    {
+   RDebug::Print( _L( "ProEng Validation test MessageAlertToneL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsMessageAlertToneL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsMessageAlertToneL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsMessageAlertToneL begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& mtone( tones.MessageAlertTone() );
+    RDebug::Print( _L( "ProEng Validation test mtone =%S" ), &mtone );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::EmailAlertToneL
+// Test:    MProEngTones::EmailAlertTone()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::EmailAlertToneL()
+    {
+   RDebug::Print( _L( "ProEng Validation test EmailAlertToneL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsEmailAlertToneL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsEmailAlertToneL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsEmailAlertToneL begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& etone( tones.EmailAlertTone() );
+    RDebug::Print( _L( "ProEng Validation test etone =%S" ), &etone );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::VideoCallRingingToneL
+// Test:    MProEngTones::VideoCallRingingToneL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::VideoCallRingingToneL()
+    {
+   RDebug::Print( _L( "ProEng Validation test VideoCallRingingToneL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsVideoCallRingingToneL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsVideoCallRingingToneL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsVideoCallRingingToneL begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& vcallTone( tones.VideoCallRingingTone() );
+    RDebug::Print( _L( "ProEng Validation test vcallTone =%S" ), &vcallTone );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetRingingTone1L
+// Test:    MProEngTones::SetRingingTone1L(const TDesC&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetRingingTone1L()
+    {
+   RDebug::Print( _L( "ProEng Validation test SetRingingTone1L" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetRingingTone1L( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetRingingTone1L(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetRingingTone1L begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& rtone( tones.RingingTone1() );
+    HBufC* toneToBeSet = rtone.AllocLC();
+    RDebug::Print( _L( "ProEng Validation test before SetRingingTone1L rtone=%S" ), toneToBeSet );
+    TRAP_IGNORE( tones.SetRingingTone1L( *toneToBeSet ) );
+    CleanupStack::PopAndDestroy( toneToBeSet );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetRingingTone2L
+// Test:    MProEngTones::SetRingingTone2L(const TDesC&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetRingingTone2L()
+    {
+   RDebug::Print( _L( "ProEng Validation test SetRingingTone2L" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetRingingTone2L( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetRingingTone2L(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetRingingTone2L begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& rtone2( tones.RingingTone2() );
+    HBufC* toneToBeSet = rtone2.AllocLC();
+    RDebug::Print( _L( "ProEng Validation test before SetRingingTone1L rtone2=%S" ), toneToBeSet );
+    TRAP_IGNORE( tones.SetRingingTone2L( *toneToBeSet ) );
+    CleanupStack::PopAndDestroy( toneToBeSet );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetMessageAlertToneL
+// Test:    MProEngTones::SetMessageAlertTone()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetMessageAlertToneL()
+    {
+   RDebug::Print( _L( "ProEng Validation test SetMessageAlertToneL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetMessageAlertToneL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetMessageAlertToneL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetMessageAlertToneL begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& mtone( tones.MessageAlertTone() );
+    RDebug::Print( _L( "ProEng Validation test mtone =%S" ), &mtone );
+    RDebug::Print( _L( "ProEng Validation test before SetMessageAlertToneL" ) );
+    TRAP_IGNORE( tones.SetMessageAlertToneL( mtone ) );        
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetEmailAlertToneL
+// Test:    MProEngTones::SetEmailAlertTone()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetEmailAlertToneL()
+    {
+   RDebug::Print( _L( "ProEng Validation test SetEmailAlertToneL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetEmailAlertToneL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetEmailAlertToneL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetEmailAlertToneL begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& etone( tones.EmailAlertTone() );
+    RDebug::Print( _L( "ProEng Validation test etone =%S" ), &etone );
+    RDebug::Print( _L( "ProEng Validation test before SetEmailAlertToneL" ) );
+    TRAP_IGNORE( tones.SetEmailAlertToneL( etone ) );        
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetVideoCallRingingToneL
+// Test:    MProEngTones::SetVideoCallRingingToneL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetVideoCallRingingToneL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test SetVideoCallRingingToneL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetVideoCallRingingToneL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetVideoCallRingingToneL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetVideoCallRingingToneL begin" ) );
+    MProEngTones& tones( aProfile.ProfileTones() );
+    const TDesC& vcallTone( tones.VideoCallRingingTone() );
+    RDebug::Print( _L( "ProEng Validation test vcallTone =%S" ), &vcallTone );
+    RDebug::Print( _L( "ProEng Validation test before SetVideoCallAlertToneL" ) );
+    TRAP_IGNORE( tones.SetVideoCallRingingToneL( vcallTone ) );
+        
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RingingTypeL
+// Test:    MProEngToneSettings::RingingType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RingingTypeL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test RingingTypeL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsRingingTypeL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsRingingTypeL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsRingingTypeL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TProfileRingingType rtype( toneSettings.RingingType() );
+    RDebug::Print( _L( "ProEng Validation test ringing type=%d" ), toneSettings.RingingType() );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::KeypadVolumeL
+// Test:    MProEngToneSettings::KeypadVolumeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::KeypadVolumeL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test KeypadVolumeL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsKeypadVolumeL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsKeypadVolumeL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsKeypadVolumeL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TProfileKeypadVolume keyvol( toneSettings.KeypadVolume() );
+    RDebug::Print( _L( "ProEng Validation test ringing keypad=%d" ), toneSettings.KeypadVolume() );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::RingingVolumeL
+// Test:    MProEngToneSettings::RingingVolumeL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::RingingVolumeL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test RingingVolumeL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsRingingVolumeL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsRingingVolumeL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsRingingVolumeL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TProfileRingingVolume ringvol( toneSettings.RingingVolume() );
+    RDebug::Print( _L( "ProEng Validation test ringing volume=%d" ), toneSettings.RingingVolume() );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::VibratingAlertL
+// Test:    MProEngToneSettings::VibratingAlertL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::VibratingAlertL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test VibratingAlertL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsVibratingAlertL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsVibratingAlertL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsVibratingAlertL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TBool vibra( toneSettings.VibratingAlert() );
+    RDebug::Print( _L( "ProEng Validation test vibra=%d" ), vibra );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::WarningAndGameTonesL
+// Test:    MProEngToneSettings::WarningAndGameTonesL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::WarningAndGameTonesL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test WarningAndGameTonesL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsWarningAndGameTonesL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsWarningAndGameTonesL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsWarningAndGameTonesL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TBool warntones( toneSettings.WarningAndGameTones() );
+    RDebug::Print( _L( "ProEng Validation test warntones = %d" ), warntones );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::TextToSpeechL
+// Test:    MProEngToneSettings::TextToSpeechL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::TextToSpeechL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test TextToSpeechL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsTextToSpeechL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsTextToSpeechL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsTextToSpeechL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TBool tts( toneSettings.TextToSpeech() );
+    RDebug::Print( _L( "ProEng Validation test TextToSpeech =%d" ), tts);    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetRingingType
+// Test:    MProEngToneSettings::SetRingingType(TProfileRingingType)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetRingingTypeL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test SetRingingTypeL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetRingingTypeL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetRingingTypeL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetRingingTypeL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TProfileRingingType rtype( toneSettings.RingingType() );
+    toneSettings.SetRingingType( rtype );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetKeypadVolumeL
+// Test:    MProEngToneSettings::SetKeypadVolumeL(TProfileKeypadVolume)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetKeypadVolumeL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test SetKeypadVolumeL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetKeypadVolumeL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetKeypadVolumeL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetKeypadVolumeL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TProfileKeypadVolume keyvol( toneSettings.KeypadVolume() );
+    toneSettings.SetKeypadVolume( keyvol );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetRingingVolumeL
+// Test:    MProEngToneSettings::RingingVolumeL(TProfileRingingVolume)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetRingingVolumeL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test SetRingingVolumeL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetRingingVolumeL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetRingingVolumeL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetRingingVolumeL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TProfileRingingVolume ringvol( toneSettings.RingingVolume() );
+    toneSettings.SetRingingVolume( ringvol );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetVibratingAlertL
+// Test:    MProEngToneSettings::SetVibratingAlertL(TBool)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetVibratingAlertL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test SetVibratingAlertL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetVibratingAlertL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+ 
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetVibratingAlertL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetVibratingAlertL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TBool vibra( toneSettings.VibratingAlert() );
+    toneSettings.SetVibratingAlert( vibra );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetWarningAndGameTonesL
+// Test:    MProEngToneSettings::WarningAndGameTonesL(TBool)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetWarningAndGameTonesL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test SetWarningAndGameTonesL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetWarningAndGameTonesL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetWarningAndGameTonesL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetWarningAndGameTonesL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TBool warntones( toneSettings.WarningAndGameTones() );
+    toneSettings.SetWarningAndGameTones( warntones );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::SetTextToSpeechL
+// Test:    MProEngToneSettings::SetTextToSpeechL(TBool)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::SetTextToSpeechL()
+    {
+     
+   RDebug::Print( _L( "ProEng Validation test SetTextToSpeechL" ) );
+   MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+   MProEngProfile* prof = NULL;
+   TRAP_IGNORE( prof = engine->ProfileL( EProfileGeneralId ) );
+   if( prof )
+       {
+       CleanupReleasePushL( *prof );
+       TRAP_IGNORE( TestProfileSettingsSetTextToSpeechL( *prof ) );
+       CleanupStack::PopAndDestroy( prof );
+       prof = NULL;
+       }
+   CleanupStack::PopAndDestroy(); // engine
+   return KErrNone;
+    }
+
+void CProEngWrapAPI::TestProfileSettingsSetTextToSpeechL(MProEngProfile& aProfile)
+    {
+    RDebug::Print( _L( "ProEng Validation test TestProfileSettingsSetTextToSpeechL begin" ) );
+    MProEngToneSettings& toneSettings( aProfile.ToneSettings() );
+    TBool tts( toneSettings.TextToSpeech() );
+    toneSettings.SetTextToSpeech( tts );    
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::NewAlertToneSeekerL
+// Test:    ProEngFactory::NewAlertToneSeekerL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::NewAlertToneSeekerL()
+    {
+       RDebug::Print( _L( "ProEng Validation test NewAlertToneSeekerL" ) );
+       MProEngAlertToneSeeker* seeker( NULL );
+       CProEngVTAlertToneSeekerWrapper* wrapper = new ( ELeave )
+           CProEngVTAlertToneSeekerWrapper();
+       CleanupStack::PushL( wrapper );
+       TRAP_IGNORE( seeker = ProEngFactory::NewAlertToneSeekerL() );
+       if( seeker )
+           {
+           wrapper->SetObject( seeker ); //  takes ownership
+           }
+       CleanupStack::PopAndDestroy( wrapper );
+       return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::FetchAlertToneListL
+// Test : MProEngAlertToneSeeker::FetchAlertToneListL(MProEngAlertToneSeekerObserver&)
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::FetchAlertToneListL()
+    {
+       RDebug::Print( _L( "ProEng Validation test FetchAlertToneListL" ) );
+       MProEngAlertToneSeeker* seeker( NULL );
+       CProEngVTAlertToneSeekerWrapper* wrapper = new ( ELeave )
+           CProEngVTAlertToneSeekerWrapper();
+       CleanupStack::PushL( wrapper );
+       TRAP_IGNORE( seeker = ProEngFactory::NewAlertToneSeekerL() );
+       if( seeker )
+           {
+           wrapper->SetObject( seeker ); //  takes ownership
+           }
+       CProEngVTSeekerObserver* observer = new ( ELeave ) CProEngVTSeekerObserver(*iSchedulerUtility);
+       CleanupStack::PushL( observer );
+       TRAP_IGNORE( seeker->FetchAlertToneListL( *observer ) );
+       iSchedulerUtility->Start();
+       CleanupStack::PopAndDestroy( observer );
+       CleanupStack::PopAndDestroy( wrapper );
+       return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngWrapAPI::CancelFetchL
+// Test : MProEngAlertToneSeeker::CancelFetch()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProEngWrapAPI::CancelFetchL()
+    {
+       RDebug::Print( _L( "ProEng Validation test CancelFetchL" ) );
+       MProEngAlertToneSeeker* seeker( NULL );
+       CProEngVTAlertToneSeekerWrapper* wrapper = new ( ELeave )
+           CProEngVTAlertToneSeekerWrapper();
+       CleanupStack::PushL( wrapper );
+       TRAP_IGNORE( seeker = ProEngFactory::NewAlertToneSeekerL() );
+       if( seeker )
+           {
+           wrapper->SetObject( seeker ); //  takes ownership
+           }
+       CProEngVTSeekerObserver* observer = new ( ELeave ) CProEngVTSeekerObserver(*iSchedulerUtility);
+       CleanupStack::PushL( observer );
+       TRAP_IGNORE( seeker->FetchAlertToneListL( *observer ) );
+       iSchedulerUtility->Start();
+       seeker->CancelFetch();
+       CleanupStack::PopAndDestroy( observer );
+       CleanupStack::PopAndDestroy( wrapper );
+       return KErrNone;
+    }
+
+TInt CProEngWrapAPI::NewEngineLWithRFsL()
+	{
+    MProEngEngine* engine = ProEngFactory::NewEngineL( iFs );
+    if( engine )
+    	{
+    	return KErrNone;
+    	}
+    return KErrGeneral;
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/BWINS/BackgroundImageU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,15 @@
+EXPORTS
+	??1CGSBackgroundImage@@UAE@XZ @ 1 NONAME ; CGSBackgroundImage::~CGSBackgroundImage(void)
+	?BackgroundImageL@CGSBackgroundImage@@QAEHXZ @ 2 NONAME ; int CGSBackgroundImage::BackgroundImageL(void)
+	?DeleteImageL@CGSBackgroundImage@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CGSBackgroundImage::DeleteImageL(class TDesC16 const &)
+	?GetPlnsStatus@CGSBackgroundImage@@QAEHXZ @ 4 NONAME ; int CGSBackgroundImage::GetPlnsStatus(void)
+	?IsPersonalisationApplicationL@CGSBackgroundImage@@QAEXXZ @ 5 NONAME ; void CGSBackgroundImage::IsPersonalisationApplicationL(void)
+	?NewL@CGSAsyncImageHandling@@SAPAV1@AAVRFs@@PAVMGSAsyncImageHandlingObserver@@ABVTDesC16@@@Z @ 6 NONAME ; class CGSAsyncImageHandling * CGSAsyncImageHandling::NewL(class RFs &, class MGSAsyncImageHandlingObserver *, class TDesC16 const &)
+	?NewL@CGSBackgroundImage@@SAPAV1@XZ @ 7 NONAME ; class CGSBackgroundImage * CGSBackgroundImage::NewL(void)
+	?SetBackgroundImageL@CGSBackgroundImage@@QAEXH@Z @ 8 NONAME ; void CGSBackgroundImage::SetBackgroundImageL(int)
+	?SetBackgroundImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@@Z @ 9 NONAME ; void CGSBackgroundImage::SetBackgroundImagePathL(class TDesC16 const &)
+	?SetBackgroundImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVTDes16@@@Z @ 10 NONAME ; void CGSBackgroundImage::SetBackgroundImagePathL(class TDesC16 const &, class TDes16 &)
+	?SetBackgroundImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVTDes16@@W4TGSWallpaperType@@@Z @ 11 NONAME ; void CGSBackgroundImage::SetBackgroundImagePathL(class TDesC16 const &, class TDes16 &, enum TGSWallpaperType)
+	?SetVTStillImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVCGSAsyncImageHandling@@@Z @ 12 NONAME ; void CGSBackgroundImage::SetVTStillImagePathL(class TDesC16 const &, class CGSAsyncImageHandling &)
+	?SetWelcomeNoteImageL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVCGSAsyncImageHandling@@@Z @ 13 NONAME ; void CGSBackgroundImage::SetWelcomeNoteImageL(class TDesC16 const &, class CGSAsyncImageHandling &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/BWINS/GSEcomPluginU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,16 @@
+EXPORTS
+	??0CGSPluginInterface@@IAE@XZ @ 1 NONAME ; CGSPluginInterface::CGSPluginInterface(void)
+	??1CGSPluginInterface@@UAE@XZ @ 2 NONAME ; CGSPluginInterface::~CGSPluginInterface(void)
+	?CreateIconL@CGSPluginInterface@@UAEPAVCGulIcon@@VTUid@@@Z @ 3 NONAME ; class CGulIcon * CGSPluginInterface::CreateIconL(class TUid)
+	?CustomOperationL@CGSPluginInterface@@UAEPAXPAX0@Z @ 4 NONAME ; void * CGSPluginInterface::CustomOperationL(void *, void *)
+	?GetValue@CGSPluginInterface@@UAEXW4TGSPluginValueKeys@@AAVTDes16@@@Z @ 5 NONAME ; void CGSPluginInterface::GetValue(enum TGSPluginValueKeys, class TDes16 &)
+	?HandleSelection@CGSPluginInterface@@UAEXW4TGSSelectionTypes@@@Z @ 6 NONAME ; void CGSPluginInterface::HandleSelection(enum TGSSelectionTypes)
+	?ItemType@CGSPluginInterface@@UAE?AW4TGSListboxItemTypes@@XZ @ 7 NONAME ; enum TGSListboxItemTypes CGSPluginInterface::ItemType(void)
+	?NewL@CGSPluginInterface@@SAPAV1@VTUid@@PAX@Z @ 8 NONAME ; class CGSPluginInterface * CGSPluginInterface::NewL(class TUid, void *)
+	?PluginProviderCategory@CGSPluginInterface@@UBEHXZ @ 9 NONAME ; int CGSPluginInterface::PluginProviderCategory(void) const
+	?Visible@CGSPluginInterface@@UBEHXZ @ 10 NONAME ; int CGSPluginInterface::Visible(void) const
+	?ResetSelectedItemIndex@CGSPluginInterface@@UAEXXZ @ 11 NONAME ; void CGSPluginInterface::ResetSelectedItemIndex(void)
+	?MenuActivationItem@CGSPluginInterface@@UAE?AW4TGSMenuActivationItems@@XZ @ 12 NONAME ; enum TGSMenuActivationItems CGSPluginInterface::MenuActivationItem(void)
+	?SetOrder@CGSPluginInterface@@QAEXH@Z @ 13 NONAME ; void CGSPluginInterface::SetOrder(int)
+	?GetEcomDestructorKey@CGSPluginInterface@@QAE?AVTUid@@XZ @ 14 NONAME ; class TUid CGSPluginInterface::GetEcomDestructorKey(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/BWINS/GSFrameworkU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+EXPORTS
+	?SetDetails@CGSPluginWrapper@@QAEXVTUid@@@Z @ 1 NONAME ; void CGSPluginWrapper::SetDetails(class TUid)
+	?SelectedPlugin@CGSParentPlugin@@QAEPAVCGSPluginInterface@@XZ @ 2 NONAME ; class CGSPluginInterface * CGSParentPlugin::SelectedPlugin(void)
+	?SelectedItem@CGSBaseContainer@@UAEHXZ @ 3 NONAME ; int CGSBaseContainer::SelectedItem(void)
+	?SetNaviPaneL@CGSBaseView@@MAEXXZ @ 4 NONAME ; void CGSBaseView::SetNaviPaneL(void)
+	?Container@CGSBaseView@@QAEPAVCGSBaseContainer@@XZ @ 5 NONAME ; class CGSBaseContainer * CGSBaseView::Container(void)
+	?WatchDog@CGSBaseDocument@@QAEPAVMGSWatchDog@@XZ @ 6 NONAME ; class MGSWatchDog * CGSBaseDocument::WatchDog(void)
+	?SetSelectedItem@CGSBaseContainer@@UAEXH@Z @ 7 NONAME ; void CGSBaseContainer::SetSelectedItem(int)
+	?ComponentControl@CGSBaseContainer@@EBEPAVCCoeControl@@H@Z @ 8 NONAME ; class CCoeControl * CGSBaseContainer::ComponentControl(int) const
+	?NewL@CGSPubSubsListener@@SAPAV1@VTUid@@HPAVMGSSettingPSObserver@@@Z @ 9 NONAME ; class CGSPubSubsListener * CGSPubSubsListener::NewL(class TUid, int, class MGSSettingPSObserver *)
+	?GetImplInfo@CGSBaseDocument@@QAE?AV?$RPointerArray@VCImplementationInformation@@@@XZ @ 10 NONAME ; class RPointerArray<class CImplementationInformation> CGSBaseDocument::GetImplInfo(void)
+	?LoadNextPluginL@CGSPluginLoader@@AAEXXZ @ 11 NONAME ; void CGSPluginLoader::LoadNextPluginL(void)
+	??0CGSParentPlugin@@IAE@XZ @ 12 NONAME ; CGSParentPlugin::CGSParentPlugin(void)
+	?NewL@CGSPluginLoader@@SAPAV1@PAVCAknViewAppUi@@@Z @ 13 NONAME ; class CGSPluginLoader * CGSPluginLoader::NewL(class CAknViewAppUi *)
+	?GetHelpContext@CGSParentPlugin@@UAEXAAVTCoeHelpContext@@@Z @ 14 NONAME ; void CGSParentPlugin::GetHelpContext(class TCoeHelpContext &)
+	?HandleCommandL@CGSParentPlugin@@MAEXH@Z @ 15 NONAME ; void CGSParentPlugin::HandleCommandL(int)
+	?Get@CGSPubSubsListener@@QAEHAAVTDes8@@@Z @ 16 NONAME ; int CGSPubSubsListener::Get(class TDes8 &)
+	??1CGSBaseContainer@@UAE@XZ @ 17 NONAME ; CGSBaseContainer::~CGSBaseContainer(void)
+	?NewL@CGSTabHelper@@SAPAV1@XZ @ 18 NONAME ; class CGSTabHelper * CGSTabHelper::NewL(void)
+	?ResetSelectedItemIndex@CGSParentPlugin@@UAEXXZ @ 19 NONAME ; void CGSParentPlugin::ResetSelectedItemIndex(void)
+	??1CGSPubSubsListener@@UAE@XZ @ 20 NONAME ; CGSPubSubsListener::~CGSPubSubsListener(void)
+	?SetObserver@CGSPluginLoader@@QAEXPAVMGSPluginLoadObserver@@@Z @ 21 NONAME ; void CGSPluginLoader::SetObserver(class MGSPluginLoadObserver *)
+	?PrepareForUIDestruction@CGSBaseDocument@@QAEXXZ @ 22 NONAME ; void CGSBaseDocument::PrepareForUIDestruction(void)
+	??1CGSPluginLoader@@UAE@XZ @ 23 NONAME ; CGSPluginLoader::~CGSPluginLoader(void)
+	?CreateNaviPaneContextL@CGSBaseView@@MAEXH@Z @ 24 NONAME ; void CGSBaseView::CreateNaviPaneContextL(int)
+	?CreateTabGroupL@CGSTabHelper@@QAEXVTUid@@PAV?$CArrayPtrFlat@VMGSTabbedView@@@@@Z @ 25 NONAME ; void CGSTabHelper::CreateTabGroupL(class TUid, class CArrayPtrFlat<class MGSTabbedView> *)
+	?SetOptionFlags@CGSParentPlugin@@UAEXAAV?$TBitFlagsT@K@@@Z @ 26 NONAME ; void CGSParentPlugin::SetOptionFlags(class TBitFlagsT<unsigned long> &)
+	??1CGSBaseDocument@@UAE@XZ @ 27 NONAME ; CGSBaseDocument::~CGSBaseDocument(void)
+	?CreateTabGroupL@CGSTabHelper@@QAEXVTUid@@PAVMGSTabbedViewOwner@@@Z @ 28 NONAME ; void CGSTabHelper::CreateTabGroupL(class TUid, class MGSTabbedViewOwner *)
+	?DynInitMenuPaneL@CGSParentPlugin@@MAEXHPAVCEikMenuPane@@@Z @ 29 NONAME ; void CGSParentPlugin::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?RemoveTabGroup@CGSTabHelper@@QAEXXZ @ 30 NONAME ; void CGSTabHelper::RemoveTabGroup(void)
+	?DoDeactivate@CGSBaseView@@UAEXXZ @ 31 NONAME ; void CGSBaseView::DoDeactivate(void)
+	?RequestPriority@CGSPluginLoader@@QAEXW4TPriority@CActive@@@Z @ 32 NONAME ; void CGSPluginLoader::RequestPriority(enum CActive::TPriority)
+	?ConstructL@CGSPluginLoader@@AAEXPAVCAknViewAppUi@@@Z @ 33 NONAME ; void CGSPluginLoader::ConstructL(class CAknViewAppUi *)
+	?AbortAsyncLoad@CGSPluginLoader@@QAEXXZ @ 34 NONAME ; void CGSPluginLoader::AbortAsyncLoad(void)
+	?OpenLocalizedResourceFileL@CGSBaseView@@QAEXABVTDesC16@@AAVRConeResourceLoader@@@Z @ 35 NONAME ; void CGSBaseView::OpenLocalizedResourceFileL(class TDesC16 const &, class RConeResourceLoader &)
+	?ResetSelectedItemIndex@CGSBaseView@@UAEXXZ @ 36 NONAME ; void CGSBaseView::ResetSelectedItemIndex(void)
+	?BaseConstructL@CGSParentPlugin@@QAEXHH@Z @ 37 NONAME ; void CGSParentPlugin::BaseConstructL(int, int)
+	??1CGSEComNotifier@@UAE@XZ @ 38 NONAME ; CGSEComNotifier::~CGSEComNotifier(void)
+	?DoDeactivate@CGSParentPlugin@@MAEXXZ @ 39 NONAME ; void CGSParentPlugin::DoDeactivate(void)
+	?DoActivateL@CGSParentPlugin@@MAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 40 NONAME ; void CGSParentPlugin::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &)
+	?OfferKeyEventL@CGSBaseContainer@@EAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 41 NONAME ; enum TKeyResponse CGSBaseContainer::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?NewL@CGSEComNotifier@@SAPAV1@PAVMGSEComObserver@@V?$RPointerArray@VCImplementationInformation@@@@@Z @ 42 NONAME ; class CGSEComNotifier * CGSEComNotifier::NewL(class MGSEComObserver *, class RPointerArray<class CImplementationInformation>)
+	?Get@CGSPubSubsListener@@QAEHAAH@Z @ 43 NONAME ; int CGSPubSubsListener::Get(int &)
+	?SortPluginsL@CGSPluginLoader@@QAEXPAV?$CArrayPtrFlat@VCGSPluginInterface@@@@@Z @ 44 NONAME ; void CGSPluginLoader::SortPluginsL(class CArrayPtrFlat<class CGSPluginInterface> *)
+	??1CGSTabHelper@@UAE@XZ @ 45 NONAME ; CGSTabHelper::~CGSTabHelper(void)
+	?HandlePluginLoaded@CGSParentPlugin@@UAEXW4KGSPluginLoaderStatus@MGSPluginLoadObserver@@@Z @ 46 NONAME ; void CGSParentPlugin::HandlePluginLoaded(enum MGSPluginLoadObserver::KGSPluginLoaderStatus)
+	?ListBoxType@CGSParentPlugin@@UAE?AW4TGSListboxTypes@@XZ @ 47 NONAME ; enum TGSListboxTypes CGSParentPlugin::ListBoxType(void)
+	?FocusChanged@CGSBaseContainer@@UAEXW4TDrawNow@@@Z @ 48 NONAME ; void CGSBaseContainer::FocusChanged(enum TDrawNow)
+	?UpperLevelViewUid@CGSParentPlugin@@UAE?AVTUid@@XZ @ 49 NONAME ; class TUid CGSParentPlugin::UpperLevelViewUid(void)
+	?OptionFlags@CGSParentPlugin@@UBEABV?$TBitFlagsT@K@@XZ @ 50 NONAME ; class TBitFlagsT<unsigned long> const & CGSParentPlugin::OptionFlags(void) const
+	?BaseConstructL@CGSBaseContainer@@QAEXABVTRect@@HH@Z @ 51 NONAME ; void CGSBaseContainer::BaseConstructL(class TRect const &, int, int)
+	?TabChangedL@CGSTabHelper@@UAEXH@Z @ 52 NONAME ; void CGSTabHelper::TabChangedL(int)
+	?CountComponentControls@CGSBaseContainer@@EBEHXZ @ 53 NONAME ; int CGSBaseContainer::CountComponentControls(void) const
+	?NewLC@CGSTabHelper@@SAPAV1@XZ @ 54 NONAME ; class CGSTabHelper * CGSTabHelper::NewLC(void)
+	?SetCurrentItem@CGSBaseView@@UAEXH@Z @ 55 NONAME ; void CGSBaseView::SetCurrentItem(int)
+	??1CGSBaseView@@UAE@XZ @ 56 NONAME ; CGSBaseView::~CGSBaseView(void)
+	?Get@CGSPubSubsListener@@QAEHAAVTDes16@@@Z @ 57 NONAME ; int CGSPubSubsListener::Get(class TDes16 &)
+	?PreparePluginCacheL@CGSBaseDocument@@QAEXAAVCEikAppUi@@@Z @ 58 NONAME ; void CGSBaseDocument::PreparePluginCacheL(class CEikAppUi &)
+	?HandleResourceChange@CGSBaseContainer@@UAEXH@Z @ 59 NONAME ; void CGSBaseContainer::HandleResourceChange(int)
+	?UpdateView@CGSParentPlugin@@UAEXXZ @ 60 NONAME ; void CGSParentPlugin::UpdateView(void)
+	?TransferDynamicPluginL@CGSParentPlugin@@UAEXPAVCGSPluginInterface@@@Z @ 61 NONAME ; void CGSParentPlugin::TransferDynamicPluginL(class CGSPluginInterface *)
+	?SizeChanged@CGSBaseContainer@@EAEXXZ @ 62 NONAME ; void CGSBaseContainer::SizeChanged(void)
+	??0CGSBaseContainer@@QAE@XZ @ 63 NONAME ; CGSBaseContainer::CGSBaseContainer(void)
+	??1CGSParentPlugin@@UAE@XZ @ 64 NONAME ; CGSParentPlugin::~CGSParentPlugin(void)
+	?NewPluginUnloadWrapperLC@CGSBaseDocument@@QAEPAVCGSPluginWrapper@@XZ @ 65 NONAME ; class CGSPluginWrapper * CGSBaseDocument::NewPluginUnloadWrapperLC(void)
+	?HandleListBoxEventL@CGSBaseView@@MAEXPAVCEikListBox@@W4TListBoxEvent@MEikListBoxObserver@@@Z @ 66 NONAME ; void CGSBaseView::HandleListBoxEventL(class CEikListBox *, enum MEikListBoxObserver::TListBoxEvent)
+	?OpenLocalizedResourceFileL@CGSParentPlugin@@QAEXABVTDesC16@@AAVRConeResourceLoader@@@Z @ 67 NONAME ; void CGSParentPlugin::OpenLocalizedResourceFileL(class TDesC16 const &, class RConeResourceLoader &)
+	?DoActivateL@CGSBaseView@@UAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 68 NONAME ; void CGSBaseView::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &)
+	?CreateTabGroupL@CGSTabHelper@@QAEXVTUid@@PAV?$CArrayPtrFlat@VCGSPluginInterface@@@@@Z @ 69 NONAME ; void CGSTabHelper::CreateTabGroupL(class TUid, class CArrayPtrFlat<class CGSPluginInterface> *)
+	??0CGSBaseView@@QAE@XZ @ 70 NONAME ; CGSBaseView::CGSBaseView(void)
+	??1CGSPluginWrapper@@UAE@XZ @ 71 NONAME ; CGSPluginWrapper::~CGSPluginWrapper(void)
+	?FocusChanged@CGSParentContainer@@UAEXW4TDrawNow@@@Z @ 72 NONAME ; void CGSParentContainer::FocusChanged(enum TDrawNow)
+	?LoadAsyncL@CGSPluginLoader@@QAEXVTUid@@0PAV?$CArrayPtrFlat@VCGSPluginInterface@@@@@Z @ 73 NONAME ; void CGSPluginLoader::LoadAsyncL(class TUid, class TUid, class CArrayPtrFlat<class CGSPluginInterface> *)
+	?ConstructL@CGSBaseDocument@@IAEXXZ @ 74 NONAME ; void CGSBaseDocument::ConstructL(void)
+	?CreateContainerL@CGSBaseView@@MAEXXZ @ 75 NONAME ; void CGSBaseView::CreateContainerL(void)
+	??0CGSBaseDocument@@IAE@AAVCEikApplication@@@Z @ 76 NONAME ; CGSBaseDocument::CGSBaseDocument(class CEikApplication &)
+	?CreateShimmedViewL@CGSBaseDocument@@QAEXVTUid@@@Z @ 77 NONAME ; void CGSBaseDocument::CreateShimmedViewL(class TUid)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/BWINS/GSListBoxU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+EXPORTS
+	??1CGSListboxEntry@@UAE@XZ @ 1 NONAME ; CGSListboxEntry::~CGSListboxEntry(void)
+	?Caption@CGSListboxEntry@@QBEABVTDesC16@@XZ @ 2 NONAME ; class TDesC16 const & CGSListboxEntry::Caption(void) const
+	?CurrentFeature@CGSItemTextArray@@UBEHXZ @ 3 NONAME ; int CGSItemTextArray::CurrentFeature(void) const
+	?CurrentFeature@CGSListBoxItemTextArray@@UBEHXZ @ 4 NONAME ; int CGSListBoxItemTextArray::CurrentFeature(void) const
+	?CurrentFeature@CGSRadioButtonSettingPageItemTextArray@@UBEHXZ @ 5 NONAME ; int CGSRadioButtonSettingPageItemTextArray::CurrentFeature(void) const
+	?FeatureByIdL@CGSItemTextArray@@QBEPBVCGSListboxEntry@@H@Z @ 6 NONAME ; class CGSListboxEntry const * CGSItemTextArray::FeatureByIdL(int) const
+	?FeatureId@CGSListboxEntry@@QBEHXZ @ 7 NONAME ; int CGSListboxEntry::FeatureId(void) const
+	?FeatureIdByIndex@CGSItemTextArray@@QBEHH@Z @ 8 NONAME ; int CGSItemTextArray::FeatureIdByIndex(int) const
+	?GetItemCaptionFromFeatureIdLC@CGSItemTextArray@@SAPAVHBufC16@@KHAAVCCoeEnv@@@Z @ 9 NONAME ; class HBufC16 * CGSItemTextArray::GetItemCaptionFromFeatureIdLC(unsigned long, int, class CCoeEnv &)
+	?IndexForFeatureIdL@CGSItemTextArray@@QBEHH@Z @ 10 NONAME ; int CGSItemTextArray::IndexForFeatureIdL(int) const
+	?MdcaCount@CGSItemTextArray@@UBEHXZ @ 11 NONAME ; int CGSItemTextArray::MdcaCount(void) const
+	?MdcaPoint@CGSItemTextArray@@UBE?AVTPtrC16@@H@Z @ 12 NONAME ; class TPtrC16 CGSItemTextArray::MdcaPoint(int) const
+	?NewL@CGSItemTextArray@@SAPAV1@KAAVCCoeEnv@@@Z @ 13 NONAME ; class CGSItemTextArray * CGSItemTextArray::NewL(unsigned long, class CCoeEnv &)
+	?NewL@CGSListBoxItemTextArray@@SAPAV1@KAAVCEikListBox@@AAVCCoeEnv@@@Z @ 14 NONAME ; class CGSListBoxItemTextArray * CGSListBoxItemTextArray::NewL(unsigned long, class CEikListBox &, class CCoeEnv &)
+	?NewL@CGSRadioButtonSettingPageItemTextArray@@SAPAV1@KAAVCCoeEnv@@PAVCAknRadioButtonSettingPage@@@Z @ 15 NONAME ; class CGSRadioButtonSettingPageItemTextArray * CGSRadioButtonSettingPageItemTextArray::NewL(unsigned long, class CCoeEnv &, class CAknRadioButtonSettingPage *)
+	?NewLC@CGSListboxEntry@@SAPAV1@AAVTResourceReader@@@Z @ 16 NONAME ; class CGSListboxEntry * CGSListboxEntry::NewLC(class TResourceReader &)
+	?NewLC@CGSListboxEntry@@SAPAV1@H@Z @ 17 NONAME ; class CGSListboxEntry * CGSListboxEntry::NewLC(int)
+	?SetDynamicTextL@CGSItemTextArray@@QAEXHABVTDesC16@@@Z @ 18 NONAME ; void CGSItemTextArray::SetDynamicTextL(int, class TDesC16 const &)
+	?SetDynamicTextL@CGSListboxEntry@@QAEXABVTDesC16@@@Z @ 19 NONAME ; void CGSListboxEntry::SetDynamicTextL(class TDesC16 const &)
+	?SetItemVisibilityL@CGSItemTextArray@@QAEXHW4TVisibility@1@@Z @ 20 NONAME ; void CGSItemTextArray::SetItemVisibilityL(int, enum CGSItemTextArray::TVisibility)
+	?SetRadioButtonSettingPage@CGSRadioButtonSettingPageItemTextArray@@QAEXAAVCAknRadioButtonSettingPage@@@Z @ 21 NONAME ; void CGSRadioButtonSettingPageItemTextArray::SetRadioButtonSettingPage(class CAknRadioButtonSettingPage &)
+	?Type@CGSListboxEntry@@QBEHXZ @ 22 NONAME ; int CGSListboxEntry::Type(void) const
+	?NewL@CGSListBoxItemTextArray@@SAPAV1@KAAVCEikListBox@@AAVCCoeEnv@@H@Z @ 23 NONAME ; class CGSListBoxItemTextArray * CGSListBoxItemTextArray::NewL(unsigned long, class CEikListBox &, class CCoeEnv &, int)
+	?NewLC@CGSListboxEntry@@SAPAV1@KAAVCCoeEnv@@H@Z @ 24 NONAME ; class CGSListboxEntry * CGSListboxEntry::NewLC(unsigned long, class CCoeEnv &, int)
+	?SetDynamicTextDoublePaneL@CGSItemTextArray@@QAEXHABVTDesC16@@@Z @ 25 NONAME ; void CGSItemTextArray::SetDynamicTextDoublePaneL(int, class TDesC16 const &)
+	?SetDynamicTextDoublePaneL@CGSListboxEntry@@QAEXABVTDesC16@@@Z @ 26 NONAME ; void CGSListboxEntry::SetDynamicTextDoublePaneL(class TDesC16 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/BWINS/GSServerEngineU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,17 @@
+EXPORTS
+	??0RGSServerClient@@QAE@XZ @ 1 NONAME ; RGSServerClient::RGSServerClient(void)
+	??1CGSServerEngine@@UAE@XZ @ 2 NONAME ; CGSServerEngine::~CGSServerEngine(void)
+	?AspectRatioL@CGSServerEngine@@QAEHXZ @ 3 NONAME ; int CGSServerEngine::AspectRatioL(void)
+	?BootConfigL@CGSServerEngine@@QAEXH@Z @ 4 NONAME ; void CGSServerEngine::BootConfigL(int)
+	?Close@RGSServerClient@@QAEXXZ @ 5 NONAME ; void RGSServerClient::Close(void)
+	?Connect@RGSServerClient@@QAEHXZ @ 6 NONAME ; int RGSServerClient::Connect(void)
+	?DisableDriver@CGSServerEngine@@QAEXXZ @ 7 NONAME ; void CGSServerEngine::DisableDriver(void)
+	?FlickerFilterL@CGSServerEngine@@QAEHXZ @ 8 NONAME ; int CGSServerEngine::FlickerFilterL(void)
+	?NewL@CGSServerEngine@@SAPAV1@XZ @ 9 NONAME ; class CGSServerEngine * CGSServerEngine::NewL(void)
+	?NewLC@CGSServerEngine@@SAPAV1@XZ @ 10 NONAME ; class CGSServerEngine * CGSServerEngine::NewLC(void)
+	?SetAspectRatioL@CGSServerEngine@@QAEXH@Z @ 11 NONAME ; void CGSServerEngine::SetAspectRatioL(int)
+	?SetFlickerFilterL@CGSServerEngine@@QAEXH@Z @ 12 NONAME ; void CGSServerEngine::SetFlickerFilterL(int)
+	?SetTvSystemL@CGSServerEngine@@QAEXH@Z @ 13 NONAME ; void CGSServerEngine::SetTvSystemL(int)
+	?TvSystemL@CGSServerEngine@@QAEHXZ @ 14 NONAME ; int CGSServerEngine::TvSystemL(void)
+	?ListenForTvCableEventsL@CGSServerEngine@@QAEXH@Z @ 15 NONAME ; void CGSServerEngine::ListenForTvCableEventsL(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/Cenrep/SettingsPrivateCRKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Settings UIs private Central Repository keys.
+*
+*/
+
+
+#ifndef SETTINGSPRIVATECRKEYS_H
+#define SETTINGSPRIVATECRKEYS_H
+
+// INCLUDES
+#include <e32def.h>
+
+// CONSTANTS
+
+// ---------------------------------------------------------------------------
+/** Following keys belong to category KCRUidMiscSettings  */
+
+/**
+*
+* String value.
+*/
+const TUint32 KWatchDogQuarantine               = 0x00000001;
+
+/**
+*
+* String value.
+*/
+const TUint32 KWatchDogBlackList                = 0x00000002;
+const TUint32 KWatchDogGSRunning                = 0x00000003;
+const TUint32 KWatchDogCrashCounter             = 0x00000004;
+const TUint32 KWatchdogActivationLimit          = 0x00000005;
+const TUint32 KWatchdogMaxPluginBlackListedRuns = 0x00000006;
+
+
+// ---------------------------------------------------------------------------
+/** Following keys belong to category KCRUidNetworkSettings  */
+
+/**
+* This key is required for the programs to control if the "network mode"
+* item should be available in the UI.
+*
+* Possible integer values:
+* 0 = "network mode" item hidden
+* 1 = "network mode" item visible in GS
+*/
+const TUint32 KSettingsNetworkMode  = 0x00000001;
+
+/**
+* This key is required for the programs to list the supported
+* network mode UI list items that will be visible from GS setting page.
+*/
+const TUint32 KSettingsNetworkModeList = 0x00000002;
+
+/**
+* This key is required for the programs to set a default value to the
+* network mode UI list item visible from GS.
+* This value is used to display the selected item from associated setting page.
+*
+* Possible integer values:
+* 0 = Dual mode
+* 1 = UMTS
+* 2 = GSM
+*/
+const TUint32 KSettingsNetworkModeValue = 0x00000003;
+
+/**
+* HSDPA Visibility
+*
+* Possible values:
+* 0 = Hide
+* 1 = Show
+*/
+const TUint32 KSettingsHSDPAVisbility = 0x00000007;
+
+/**
+* HSDPA Value
+*
+* Possible values:
+* 0 = Disable
+* 1 = Enable
+*/
+const TUint32 KSettingsHSDPAValue = 0x00000008;
+
+
+// ---------------------------------------------------------------------------
+/** Following keys belong to category KCRUidPersonalizationSettings */
+
+/**
+* Background image.
+* Possible values are:
+* 0 = No image
+* 1 = Image used
+*/
+const TUint32 KSettingsBackgroundImage = 0x00000001;
+
+/**
+* Background image path.
+* The value is a string which length can vary from 0 to maximum length.
+*/
+const TUint32 KSettingsBackgroundImagePath = 0x00000002;
+
+/**
+* Hide/Unhide user welcome note item in UI.
+* 0 = Hide
+* 1 = Show
+*/
+const TUint32 KSettingsWelcomeNoteSupported = 0x00000005;
+
+
+// ---------------------------------------------------------------------------
+/** Following keys belong to category KCRUidCdmaTelephonySettings  */
+
+/**
+* This key indicates whether the call guard is activated
+* for MO and MT calls.
+*
+* 0 = Disabled
+* 1 = Enabled
+*/
+const TUint32 KSettingsCallGuard = 0x00000001;
+
+
+/**
+* This key indicates whether voice privacy settings
+* needs to be included and voice privacy status.
+*
+* Possible integer values:
+* 0 = Option 1 - {VP Menu excluded, VP Off}
+* 1 = Option 2 - {VP Menu excluded, VP On}
+* 2 = Option 3 - {VP Menu included, VP Off}
+* 3 = Option 4 - {VP Menu included, VP On}
+*/
+const TUint32 KSettingsVoicePrivacy = 0x00000002;
+
+
+/**
+* This key indicates whether the distinctive ring tone
+* is enabled while roaming.
+*
+* 0 = Disabled
+* 1 = Enabled
+*/
+const TUint32 KSettingsRoamingRingingTone = 0x00000003;
+
+
+// ---------------------------------------------------------------------------
+/** Following keys belong to category KCRUidSettingsVariation  */
+
+/**
+* Settings Variation API
+* Keys under this category are used in defining settings variation.
+*/
+const TUid KCRUidSettingsVariation = {0x1020720A};
+
+/**
+* Settings Local Variation Flags. Values are defined in GeneralSettingsVariant.hrh.
+*/
+const TUint32 KSettingsVariationFlags = 0x00000001;
+
+ 
+#endif      // SETTINGSPRIVATECRKEYS_H
+
+// End of file
\ No newline at end of file
Binary file gssettingsuis/Gs/Cenrep/keys_s60settingsuis.xls has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/Data/GSCommonResources.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Common resources for internal GS plugins. This .rss is
+*                 included by other .rss files. This should not be compiled
+                  alone.
+*
+*/
+
+//  RESOURCE IDENTIFIER
+//NAME    GSCR // 4 letter ID
+
+//  INCLUDES
+#include    <gs.loc> // Common localized GS strings
+#include    <gscommon.rh> // Common GS resource structures
+
+#include    <bldvariant.hrh>
+#include    <eikon.rh>
+#include    <eikon.rsg>
+#include    <avkon.rh>
+#include    <avkon.loc>
+
+// CONSTANTS
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menubar_change_exit
+// GS menu with 'change' and 'exit' items.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_gs_menubar_change_exit
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_exit;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_help;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_change;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menubar_open_exit
+// GS menu with 'Open' and 'Exit' items.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_gs_menubar_open_exit
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_exit;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_help;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_open;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+// r_gs_menu_item_open
+// Open item.
+//
+//----------------------------------------------------
+
+RESOURCE MENU_PANE r_gs_menu_item_open
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknSoftkeyOpen;
+            txt = qtn_set_options_open;
+            flags = EEikMenuItemAction; // action command
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_exit
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_menu_item_exit
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_change
+// Change item.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_menu_item_change
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EGSCmdAppChange;
+            txt = qtn_set_options_change;
+            flags = EEikMenuItemAction; // action command
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_help
+// Change item.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_menu_item_help
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknCmdHelp;
+            txt = qtn_options_help;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_setting_listbox
+// Common listbox editor resource for setting pages.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_setting_listbox
+    {
+    flags = EEikListBoxMultipleSelection;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_cba_exit
+// Exit text for RSK
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_gs_cba_exit { buf = text_softkey_exit; }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/Data/SoftReject.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Resource file for Soft Reject
+*
+*/
+
+//  RESOURCE IDENTIFIER
+NAME    PHSR // 4 letter ID
+
+//  INCLUDES
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+#include <eikcore.rsg>
+#include <eikon.rsg>
+#include "SoftReject.loc"
+//#include "Phone.hrh"
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_on
+//    Soft reject: "On"
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_on
+    {
+    buf = qtn_gs_soft_on;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_off
+//    Soft reject: "Off"
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_off
+    {
+    buf = qtn_gs_soft_off;
+    }
+
+//----------------------------------------------------
+//   
+//    qtn_gs_soft_reject_text_title
+//    Soft Reject Text setting page resources
+//    "Soft Reject"
+//----------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_text
+    {
+    buf = qtn_gs_soft_reject_text_title;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_default_txt
+//    Default text for Soft reject.
+//    "Hi, I’m busy at the moment, but I contact you a bit later."
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_default_txt
+    {
+    buf = qtn_gs_soft_default_text;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_txt_title
+//    Default text title.
+//    "Text for Soft reject"
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_txt_title
+    {
+    buf = qtn_gs_soft_reject_text;
+    }
+
+//----------------------------------------------------
+//    
+//    r_setting_app_edwin    
+//    Text editor for Soft Reject text.
+//
+//----------------------------------------------------
+//
+RESOURCE EDWIN r_setting_app_edwin 
+    {
+    flags = 0;
+    width = 9;
+    lines = 5;
+    maxlength = 160;
+    numeric_keymap = EAknEditorStandardNumberModeKeymap;
+    allowed_input_modes = EAknEditorAllInputModes;
+    default_input_mode = EAknEditorTextInputMode;
+    }
+
+//----------------------------------------------------
+//    
+//    r_text_setting_page    
+//    Setting page for Soft Reject text.
+//    "Text for Soft reject"
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_text_setting_page
+    {    
+    label= qtn_gs_soft_reject_text_title;
+    type = EEikCtEdwin;
+    editor_resource_id = r_setting_app_edwin;
+    }
+
+//----------------------------------------------------
+//   
+//    qtn_mocal_sett_softrej_title
+//    Soft Reject setting page resources
+//    "Soft reject"
+//----------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject
+    {
+    buf = qtn_mocal_sett_softrej_title;
+    }
+
+/*
+// -----------------------------------------------------------------------------
+//   
+//    r_phone_softkeys_options_softreject
+//    It is softkeys for soft reject.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phone_softkeys_options_softreject
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdSoftReject;
+            txt = qtn_softkey_soft_reject;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phone_softkeys_options_softreject_slider
+//    It is softkeys for soft reject with slider devices.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phone_softkeys_options_softreject_slider
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdAnswer;
+            txt = text_softkey_answer;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCallComingCmdSoftReject;
+            txt = qtn_softkey_soft_reject;
+            }
+        };
+    }
+*/
+
+//End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/Data/backup_registration.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration version="1.0">
+    <passive_backup>
+      <include_file name = "welcomeimage.mbm"/>    
+    </passive_backup>
+    <proxy_data_manager sid = "0x10202BE9" />
+    <restore requires_reboot = "no"/>
+</backup_registration>
+  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/EABI/BackgroundImageU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+EXPORTS
+	_ZN18CGSBackgroundImage12DeleteImageLERK7TDesC16 @ 1 NONAME
+	_ZN18CGSBackgroundImage13GetPlnsStatusEv @ 2 NONAME
+	_ZN18CGSBackgroundImage16BackgroundImageLEv @ 3 NONAME
+	_ZN18CGSBackgroundImage19SetBackgroundImageLEi @ 4 NONAME
+	_ZN18CGSBackgroundImage20SetVTStillImagePathLERK7TDesC16R21CGSAsyncImageHandling @ 5 NONAME
+	_ZN18CGSBackgroundImage20SetWelcomeNoteImageLERK7TDesC16R21CGSAsyncImageHandling @ 6 NONAME
+	_ZN18CGSBackgroundImage23SetBackgroundImagePathLERK7TDesC16 @ 7 NONAME
+	_ZN18CGSBackgroundImage23SetBackgroundImagePathLERK7TDesC16R6TDes16 @ 8 NONAME
+	_ZN18CGSBackgroundImage23SetBackgroundImagePathLERK7TDesC16R6TDes1616TGSWallpaperType @ 9 NONAME
+	_ZN18CGSBackgroundImage29IsPersonalisationApplicationLEv @ 10 NONAME
+	_ZN18CGSBackgroundImage4NewLEv @ 11 NONAME
+	_ZN21CGSAsyncImageHandling4NewLER3RFsP29MGSAsyncImageHandlingObserverRK7TDesC16 @ 12 NONAME
+	_ZTI18CGSBackgroundImage @ 13 NONAME ; #<TI>#
+	_ZTI21CGSAsyncImageHandling @ 14 NONAME ; #<TI>#
+	_ZTV18CGSBackgroundImage @ 15 NONAME ; #<VT>#
+	_ZTV21CGSAsyncImageHandling @ 16 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/EABI/GSEcomPluginU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,20 @@
+EXPORTS
+	_ZN18CGSPluginInterface11CreateIconLE4TUid @ 1 NONAME
+	_ZN18CGSPluginInterface15HandleSelectionE17TGSSelectionTypes @ 2 NONAME
+	_ZN18CGSPluginInterface16CustomOperationLEPvS0_ @ 3 NONAME
+	_ZN18CGSPluginInterface4NewLE4TUidPv @ 4 NONAME
+	_ZN18CGSPluginInterface8GetValueE18TGSPluginValueKeysR6TDes16 @ 5 NONAME
+	_ZN18CGSPluginInterface8ItemTypeEv @ 6 NONAME
+	_ZN18CGSPluginInterfaceC2Ev @ 7 NONAME
+	_ZN18CGSPluginInterfaceD0Ev @ 8 NONAME
+	_ZN18CGSPluginInterfaceD1Ev @ 9 NONAME
+	_ZN18CGSPluginInterfaceD2Ev @ 10 NONAME
+	_ZNK18CGSPluginInterface22PluginProviderCategoryEv @ 11 NONAME
+	_ZNK18CGSPluginInterface7VisibleEv @ 12 NONAME
+	_ZTI18CGSPluginInterface @ 13 NONAME ; #<TI>#
+	_ZTV18CGSPluginInterface @ 14 NONAME ; #<VT>#
+	_ZN18CGSPluginInterface22ResetSelectedItemIndexEv @ 15 NONAME
+	_ZN18CGSPluginInterface18MenuActivationItemEv @ 16 NONAME
+	_ZN18CGSPluginInterface8SetOrderEi @ 17 NONAME
+	_ZN18CGSPluginInterface20GetEcomDestructorKeyEv @ 18 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/EABI/GSFrameworkU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,122 @@
+EXPORTS
+	_ZN11CGSBaseView11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 1 NONAME
+	_ZN11CGSBaseView12DoDeactivateEv @ 2 NONAME
+	_ZN11CGSBaseView12SetNaviPaneLEv @ 3 NONAME
+	_ZN11CGSBaseView14SetCurrentItemEi @ 4 NONAME
+	_ZN11CGSBaseView16CreateContainerLEv @ 5 NONAME
+	_ZN11CGSBaseView19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 6 NONAME
+	_ZN11CGSBaseView22CreateNaviPaneContextLEi @ 7 NONAME
+	_ZN11CGSBaseView26OpenLocalizedResourceFileLERK7TDesC16R19RConeResourceLoader @ 8 NONAME
+	_ZN11CGSBaseView9ContainerEv @ 9 NONAME
+	_ZN11CGSBaseViewC2Ev @ 10 NONAME
+	_ZN11CGSBaseViewD0Ev @ 11 NONAME
+	_ZN11CGSBaseViewD1Ev @ 12 NONAME
+	_ZN11CGSBaseViewD2Ev @ 13 NONAME
+	_ZN12CGSTabHelper11TabChangedLEi @ 14 NONAME
+	_ZN12CGSTabHelper14RemoveTabGroupEv @ 15 NONAME
+	_ZN12CGSTabHelper15CreateTabGroupLE4TUidP13CArrayPtrFlatI13MGSTabbedViewE @ 16 NONAME
+	_ZN12CGSTabHelper15CreateTabGroupLE4TUidP13CArrayPtrFlatI18CGSPluginInterfaceE @ 17 NONAME
+	_ZN12CGSTabHelper15CreateTabGroupLE4TUidP18MGSTabbedViewOwner @ 18 NONAME
+	_ZN12CGSTabHelper4NewLEv @ 19 NONAME
+	_ZN12CGSTabHelper5NewLCEv @ 20 NONAME
+	_ZN12CGSTabHelperD0Ev @ 21 NONAME
+	_ZN12CGSTabHelperD1Ev @ 22 NONAME
+	_ZN12CGSTabHelperD2Ev @ 23 NONAME
+	_ZN15CGSParentPlugin10UpdateViewEv @ 24 NONAME
+	_ZN15CGSParentPlugin11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 25 NONAME
+	_ZN15CGSParentPlugin11ListBoxTypeEv @ 26 NONAME
+	_ZN15CGSParentPlugin12DoDeactivateEv @ 27 NONAME
+	_ZN15CGSParentPlugin14BaseConstructLEii @ 28 NONAME
+	_ZN15CGSParentPlugin14HandleCommandLEi @ 29 NONAME
+	_ZN15CGSParentPlugin17UpperLevelViewUidEv @ 30 NONAME
+	_ZN15CGSParentPlugin18HandlePluginLoadedEN21MGSPluginLoadObserver21KGSPluginLoaderStatusE @ 31 NONAME
+	_ZN15CGSParentPlugin22ResetSelectedItemIndexEv @ 32 NONAME
+	_ZN15CGSParentPlugin26OpenLocalizedResourceFileLERK7TDesC16R19RConeResourceLoader @ 33 NONAME
+	_ZN15CGSParentPluginC2Ev @ 34 NONAME
+	_ZN15CGSParentPluginD0Ev @ 35 NONAME
+	_ZN15CGSParentPluginD1Ev @ 36 NONAME
+	_ZN15CGSParentPluginD2Ev @ 37 NONAME
+	_ZN15CGSPluginLoader10ConstructLEP13CAknViewAppUi @ 38 NONAME
+	_ZN15CGSPluginLoader10LoadAsyncLE4TUidS0_P13CArrayPtrFlatI18CGSPluginInterfaceE @ 39 NONAME
+	_ZN15CGSPluginLoader11SetObserverEP21MGSPluginLoadObserver @ 40 NONAME
+	_ZN15CGSPluginLoader14AbortAsyncLoadEv @ 41 NONAME
+	_ZN15CGSPluginLoader15LoadNextPluginLEv @ 42 NONAME
+	_ZN15CGSPluginLoader4NewLEP13CAknViewAppUi @ 43 NONAME
+	_ZN15CGSPluginLoaderD0Ev @ 44 NONAME
+	_ZN15CGSPluginLoaderD1Ev @ 45 NONAME
+	_ZN15CGSPluginLoaderD2Ev @ 46 NONAME
+	_ZN16CGSBaseContainer11SizeChangedEv @ 47 NONAME
+	_ZN16CGSBaseContainer14BaseConstructLERK5TRectii @ 48 NONAME
+	_ZN16CGSBaseContainer14OfferKeyEventLERK9TKeyEvent10TEventCode @ 49 NONAME
+	_ZN16CGSBaseContainer20HandleResourceChangeEi @ 50 NONAME
+	_ZN16CGSBaseContainerC2Ev @ 51 NONAME
+	_ZN16CGSBaseContainerD0Ev @ 52 NONAME
+	_ZN16CGSBaseContainerD1Ev @ 53 NONAME
+	_ZN16CGSBaseContainerD2Ev @ 54 NONAME
+	_ZNK16CGSBaseContainer16ComponentControlEi @ 55 NONAME
+	_ZNK16CGSBaseContainer22CountComponentControlsEv @ 56 NONAME
+	_ZTI11CGSBaseView @ 57 NONAME ; #<TI>#
+	_ZTI12CGSTabHelper @ 58 NONAME ; #<TI>#
+	_ZTI15CGSParentPlugin @ 59 NONAME ; #<TI>#
+	_ZTI15CGSPluginLoader @ 60 NONAME ; #<TI>#
+	_ZTI16CGSBaseContainer @ 61 NONAME ; #<TI>#
+	_ZTI18CGSParentContainer @ 62 NONAME ; #<TI>#
+	_ZTV11CGSBaseView @ 63 NONAME ; #<VT>#
+	_ZTV12CGSTabHelper @ 64 NONAME ; #<VT>#
+	_ZTV15CGSParentPlugin @ 65 NONAME ; #<VT>#
+	_ZTV15CGSPluginLoader @ 66 NONAME ; #<VT>#
+	_ZTV16CGSBaseContainer @ 67 NONAME ; #<VT>#
+	_ZTV18CGSParentContainer @ 68 NONAME ; #<VT>#
+	_ZThn4_N12CGSTabHelper11TabChangedLEi @ 69 NONAME ; #<thunk>#
+	_ZThn88_N11CGSBaseView19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 70 NONAME ; #<thunk>#
+	_ZThn88_N15CGSParentPlugin18HandlePluginLoadedEN21MGSPluginLoadObserver21KGSPluginLoaderStatusE @ 71 NONAME ; #<thunk>#
+	_ZN11CGSBaseView22ResetSelectedItemIndexEv @ 72 NONAME
+	_ZN16CGSBaseContainer12SelectedItemEv @ 73 NONAME
+	_ZN16CGSBaseContainer15SetSelectedItemEi @ 74 NONAME
+	_ZN15CGSParentPlugin14GetHelpContextER15TCoeHelpContext @ 75 NONAME
+	_ZN15CGSParentPlugin14SetOptionFlagsER10TBitFlagsTImE @ 76 NONAME
+	_ZN15CGSParentPlugin16DynInitMenuPaneLEiP12CEikMenuPane @ 77 NONAME
+	_ZNK15CGSParentPlugin11OptionFlagsEv @ 78 NONAME
+	_ZThn12_N15CGSParentPlugin16DynInitMenuPaneLEiP12CEikMenuPane @ 79 NONAME ; #<thunk>#
+	_ZN16CGSBaseContainer12FocusChangedE8TDrawNow @ 80 NONAME
+	_ZN18CGSParentContainer12FocusChangedE8TDrawNow @ 81 NONAME
+	_ZN15CGSBaseDocument10ConstructLEv @ 82 NONAME
+	_ZN15CGSBaseDocument24NewPluginUnloadWrapperLCEv @ 83 NONAME
+	_ZN15CGSBaseDocumentC2ER15CEikApplication @ 84 NONAME
+	_ZN15CGSBaseDocumentD0Ev @ 85 NONAME
+	_ZN15CGSBaseDocumentD1Ev @ 86 NONAME
+	_ZN15CGSBaseDocumentD2Ev @ 87 NONAME
+	_ZN16CGSPluginWrapper10SetDetailsE4TUid @ 88 NONAME
+	_ZN16CGSPluginWrapperD0Ev @ 89 NONAME
+	_ZN16CGSPluginWrapperD1Ev @ 90 NONAME
+	_ZN16CGSPluginWrapperD2Ev @ 91 NONAME
+	_ZTI15CGSBaseDocument @ 92 NONAME ; #<TI>#
+	_ZTV15CGSBaseDocument @ 93 NONAME ; #<VT>#
+	_ZN15CGSParentPlugin22TransferDynamicPluginLEP18CGSPluginInterface @ 94 NONAME
+	_ZN15CGSPluginLoader12SortPluginsLEP13CArrayPtrFlatI18CGSPluginInterfaceE @ 95 NONAME
+	_ZThn92_N15CGSParentPlugin22TransferDynamicPluginLEP18CGSPluginInterface @ 96 NONAME ; #<thunk>#
+	_ZN18CGSPubSubsListener3GetER5TDes8 @ 97 NONAME
+	_ZN18CGSPubSubsListener3GetER6TDes16 @ 98 NONAME
+	_ZN18CGSPubSubsListener3GetERi @ 99 NONAME
+	_ZN18CGSPubSubsListener4NewLE4TUidiP20MGSSettingPSObserver @ 100 NONAME
+	_ZN18CGSPubSubsListenerD0Ev @ 101 NONAME
+	_ZN18CGSPubSubsListenerD1Ev @ 102 NONAME
+	_ZN18CGSPubSubsListenerD2Ev @ 103 NONAME
+	_ZN15CGSBaseDocument19PreparePluginCacheLER9CEikAppUi @ 104 NONAME
+	_ZN15CGSBaseDocument23PrepareForUIDestructionEv @ 105 NONAME
+	_ZTI14CGSShimmedView @ 106 NONAME ; #<TI>#
+	_ZTI18CGSPlaceholderView @ 107 NONAME ; #<TI>#
+	_ZTI23CGSPluginAndViewIdCache @ 108 NONAME ; #<TI>#
+	_ZTV14CGSShimmedView @ 109 NONAME ; #<VT>#
+	_ZTV18CGSPlaceholderView @ 110 NONAME ; #<VT>#
+	_ZTV23CGSPluginAndViewIdCache @ 111 NONAME ; #<VT>#
+	_ZN15CGSParentPlugin14SelectedPluginEv @ 112 NONAME
+	_ZN15CGSBaseDocument8WatchDogEv @ 113 NONAME
+	_ZN15CGSBaseDocument11GetImplInfoEv @ 114 NONAME
+	_ZN15CGSEComNotifier4NewLEP15MGSEComObserver13RPointerArrayI26CImplementationInformationE @ 115 NONAME
+	_ZN15CGSEComNotifierD0Ev @ 116 NONAME
+	_ZN15CGSEComNotifierD1Ev @ 117 NONAME
+	_ZN15CGSEComNotifierD2Ev @ 118 NONAME
+	_ZN15CGSPluginLoader15RequestPriorityEN7CActive9TPriorityE @ 119 NONAME
+	_ZN15CGSBaseDocument18CreateShimmedViewLE4TUid @ 120 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/EABI/GSListBoxU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,40 @@
+EXPORTS
+	_ZN15CGSListboxEntry15SetDynamicTextLERK7TDesC16 @ 1 NONAME
+	_ZN15CGSListboxEntry5NewLCER15TResourceReader @ 2 NONAME
+	_ZN15CGSListboxEntry5NewLCEi @ 3 NONAME
+	_ZN15CGSListboxEntryD0Ev @ 4 NONAME
+	_ZN15CGSListboxEntryD1Ev @ 5 NONAME
+	_ZN15CGSListboxEntryD2Ev @ 6 NONAME
+	_ZN16CGSItemTextArray15SetDynamicTextLEiRK7TDesC16 @ 7 NONAME
+	_ZN16CGSItemTextArray18SetItemVisibilityLEiNS_11TVisibilityE @ 8 NONAME
+	_ZN16CGSItemTextArray29GetItemCaptionFromFeatureIdLCEmiR7CCoeEnv @ 9 NONAME
+	_ZN16CGSItemTextArray4NewLEmR7CCoeEnv @ 10 NONAME
+	_ZN23CGSListBoxItemTextArray4NewLEmR11CEikListBoxR7CCoeEnv @ 11 NONAME
+	_ZN38CGSRadioButtonSettingPageItemTextArray25SetRadioButtonSettingPageER26CAknRadioButtonSettingPage @ 12 NONAME
+	_ZN38CGSRadioButtonSettingPageItemTextArray4NewLEmR7CCoeEnvP26CAknRadioButtonSettingPage @ 13 NONAME
+	_ZNK15CGSListboxEntry4TypeEv @ 14 NONAME
+	_ZNK15CGSListboxEntry7CaptionEv @ 15 NONAME
+	_ZNK15CGSListboxEntry9FeatureIdEv @ 16 NONAME
+	_ZNK16CGSItemTextArray12FeatureByIdLEi @ 17 NONAME
+	_ZNK16CGSItemTextArray14CurrentFeatureEv @ 18 NONAME
+	_ZNK16CGSItemTextArray16FeatureIdByIndexEi @ 19 NONAME
+	_ZNK16CGSItemTextArray18IndexForFeatureIdLEi @ 20 NONAME
+	_ZNK16CGSItemTextArray9MdcaCountEv @ 21 NONAME
+	_ZNK16CGSItemTextArray9MdcaPointEi @ 22 NONAME
+	_ZNK23CGSListBoxItemTextArray14CurrentFeatureEv @ 23 NONAME
+	_ZNK38CGSRadioButtonSettingPageItemTextArray14CurrentFeatureEv @ 24 NONAME
+	_ZTI15CGSListboxEntry @ 25 NONAME ; #<TI>#
+	_ZTI16CGSItemTextArray @ 26 NONAME ; #<TI>#
+	_ZTI23CGSListBoxItemTextArray @ 27 NONAME ; #<TI>#
+	_ZTI38CGSRadioButtonSettingPageItemTextArray @ 28 NONAME ; #<TI>#
+	_ZTV15CGSListboxEntry @ 29 NONAME ; #<VT>#
+	_ZTV16CGSItemTextArray @ 30 NONAME ; #<VT>#
+	_ZTV23CGSListBoxItemTextArray @ 31 NONAME ; #<VT>#
+	_ZTV38CGSRadioButtonSettingPageItemTextArray @ 32 NONAME ; #<VT>#
+	_ZThn4_NK16CGSItemTextArray9MdcaCountEv @ 33 NONAME ; #<thunk>#
+	_ZThn4_NK16CGSItemTextArray9MdcaPointEi @ 34 NONAME ; #<thunk>#
+	_ZN15CGSListboxEntry5NewLCEmR7CCoeEnvi @ 35 NONAME
+	_ZN23CGSListBoxItemTextArray4NewLEmR11CEikListBoxR7CCoeEnvi @ 36 NONAME
+	_ZN15CGSListboxEntry25SetDynamicTextDoublePaneLERK7TDesC16 @ 37 NONAME
+	_ZN16CGSItemTextArray25SetDynamicTextDoublePaneLEiRK7TDesC16 @ 38 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/EABI/GSServerEngineU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,24 @@
+EXPORTS
+	0 @ 1 ABSENT
+	_ZN15CGSServerEngine12AspectRatioLEv @ 2 NONAME
+	_ZN15CGSServerEngine12SetTvSystemLEi @ 3 NONAME
+	0 @ 4 ABSENT
+	_ZN15CGSServerEngine14FlickerFilterLEv @ 5 NONAME
+	_ZN15CGSServerEngine15SetAspectRatioLEi @ 6 NONAME
+	_ZN15CGSServerEngine17SetFlickerFilterLEi @ 7 NONAME
+	_ZN15CGSServerEngine4NewLEv @ 8 NONAME
+	_ZN15CGSServerEngine5NewLCEv @ 9 NONAME
+	_ZN15CGSServerEngine9TvSystemLEv @ 10 NONAME
+	_ZN15CGSServerEngineD0Ev @ 11 NONAME
+	_ZN15CGSServerEngineD1Ev @ 12 NONAME
+	_ZN15CGSServerEngineD2Ev @ 13 NONAME
+	_ZN15RGSServerClient5CloseEv @ 14 NONAME
+	_ZN15RGSServerClient7ConnectEv @ 15 NONAME
+	_ZN15RGSServerClientC1Ev @ 16 NONAME
+	_ZN15RGSServerClientC2Ev @ 17 NONAME
+	0 @ 18 ABSENT
+	0 @ 19 ABSENT
+	0 @ 20 ABSENT
+	0 @ 21 ABSENT
+	0 @ 22 ABSENT
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/GSAdminPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Resource file for plugin.
+*
+*/
+
+
+#include            <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsadminplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10283340
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSAdminPluginImplementationTable.cpp
+SOURCE              GSAdminPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         loc
+USERINCLUDE         ../Logger
+USERINCLUDE         ../Data
+
+SYSTEMINCLUDE       /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+START RESOURCE      10283340.rss
+TARGET              gsadminplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSAdminPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+LIBRARY             euser.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib 
+LIBRARY             cone.lib 
+LIBRARY             eikcoctl.lib 
+LIBRARY             eikcore.lib 
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             flogger.lib // For GSLogger
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10283340.rss
+DOCUMENT            GSAdminPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSAdminPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSAdminPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsadminplugin.iby )
+../rom/GSAdminPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsadminpluginresources.iby )
+
+loc/GSAdminPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsadminplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsadminplugin.mif
+  OPTION HEADERFILE gsadminplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_conn_admin
+END
+
+
+PRJ_MMPFILES
+GSAdminPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSAdminPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/data/10283340.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    ECOM resource file for plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10283340;
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10283341;
+					version_no          = 1;
+					display_name        = "Admininstration Settings Plugin"; // Debug name
+					default_data        = "0x10207250";// Parent UID
+					opaque_data         = "110";// Order number
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/data/GSAdminPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Resource file for plugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    ADMN // 4 letter ID
+
+//  INCLUDES
+#include    <gsadminplugin.loc>
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <GSApp.rsg>
+#include    <uikon.rh>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_Admin_view
+//    Personalisation Settings view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_admin_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_Admin_view_title
+//    Personalisation Settings view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_admin_view_title
+    {
+    txt = qtn_cp_title_adminstrative_settings;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_Admin_view_caption
+//    Personalisation View caption for plugin
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_admin_view_caption
+    {
+    buf = qtn_cp_folder_administrative_settings;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/inc/GSAdminPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header file for plugin.
+*
+*/
+
+
+#ifndef GSADMINPLUGIN_H
+#define GSADMINPLUGIN_H
+
+// Includes
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+#include <aknview.h>
+#include <eikclb.h>
+
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+
+// Constants
+_LIT( KGSAdminPluginResourceFileName, "z:GSAdminPluginRsc.rsc" );
+_LIT( KGSAdminPluginIconDirAndName, "z:gsadminplugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+* CGSAdminPlugin view class.
+*
+* @since Series60_3.1
+*/
+class CGSAdminPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSAdminPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSAdminPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        TGSListboxTypes ListBoxType();
+        
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSAdminPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+    };
+
+
+#endif // GSADMINPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/loc/GSAdminPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Localization strings for GSAdminPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Plugin title.
+//d:Long string.
+//l:title_pane_t2/opt9
+//w:
+//r:5.0
+//
+#define qtn_cp_title_adminstrative_settings "Administrative settings"
+
+//d:Plugin caption.
+//d:Used by GS FW.
+//l:list_single_large_graphic_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_cp_folder_administrative_settings "Administrative settings"
+
+// **OPTIONS MENU
+
+//d:Command in Options list.
+//d:Opens the highlighted item.
+//l:list_single_pane_t1_cp2
+//w:
+//r:3.1
+//
+#define qtn_set_options_open "Open"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,258 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Cpp file for plugin.
+*
+*/
+
+
+// Includes
+#include "GSAdminPlugin.h"
+#include "GsLogger.h"
+
+#include <GSAdminPluginRsc.rsg>
+#include <gsadminplugin.mbg>
+
+// Includes from GS framework:
+#include <gsfwviewuids.h>
+#include <gsprivatepluginproviderids.h>
+#include <gstabhelper.h>
+#include <gsmainview.h>
+#include <csxhelp/cp.hlp.hrh>
+
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <barsread.h> // For TResourceReader
+#include <StringLoader.h>
+
+// Constants
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::CGSAdminPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSAdminPlugin::CGSAdminPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSAdminPlugin] CGSAdminPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::~CGSAdminPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSAdminPlugin::~CGSAdminPlugin()
+    {
+    iResourceLoader.Close();
+    __GSLOGSTRING( "[CGSAdminPlugin] ~CGSAdminPlugin()" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAdminPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSAdminPlugin] ConstructL()" );
+    OpenLocalizedResourceFileL( KGSAdminPluginResourceFileName,
+                                iResourceLoader );
+    
+    // Do not load content of this view untill/unless this view is activated.
+    // This will save memory as well as optimize loading performance for other 
+    // plugins.
+    TBitFlags flags;
+    flags.Set( EGSLoadChildrenOnActivation );
+    SetOptionFlags( flags );
+    
+    BaseConstructL( R_GS_ADMIN_VIEW, R_GS_ADMIN_VIEW_TITLE );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSAdminPlugin* CGSAdminPlugin::NewL( TAny* /*aInitParams*/ )
+	{
+	__GSLOGSTRING( "[CGSAdminPlugin] NewL()" );
+	CGSAdminPlugin* self = new(ELeave) CGSAdminPlugin();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSAdminPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSAdminPlugin] Id():0x%X", KGSAdminPluginUid.iUid );
+    return KGSAdminPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAdminPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAdminPlugin::DoDeactivate()
+    {
+    CGSParentPlugin::DoDeactivate();
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSAdminPlugin::UpperLevelViewUid()
+    {
+    return KGSConPluginUid;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAdminPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSAdminPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_ADMINISTRATIVE_SETTINGS;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAdminPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_ADMIN_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::CreateIconL
+//
+// Return the icon, if has one.
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CGSAdminPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSAdminPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpConnAdmin,
+        fp->FullName(),
+        EMbmGsadminpluginQgn_prop_cp_conn_admin,
+        EMbmGsadminpluginQgn_prop_cp_conn_admin_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSAdminPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAdminPlugin::ListBoxType()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TGSListboxTypes CGSAdminPlugin::ListBoxType()
+    {
+    return EGSListBoxTypeSettings;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    ECOM prxy table for plugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSAdminPlugin.h"
+
+// Constants
+const TImplementationProxy KGSAdminPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10283341, CGSAdminPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSAdminPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSAdminPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Data/GSApp.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,461 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Resource file for main view.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    GSMV // 4 letter ID
+
+//  INCLUDES
+#include    <data_caging_paths_strings.hrh>
+
+#include    <bldvariant.hrh>
+#include    <eikon.rh>
+#include    <eikon.rsg>
+#include    <avkon.rh>
+#include    <avkon.rsg>
+#include    <avkon.mbg>
+#include    <avkon.loc>
+
+#include    <eikcore.rsg>
+#include    <AvkonIcons.hrh>
+#include    <appinfo.rh>
+#include    <gsapp.loc>
+
+// Common resources among GS
+#include    <gscommon.hrh>
+
+// CONSTANTS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+
+RESOURCE TBUF
+    {
+    buf="GSApp";
+    }
+
+//----------------------------------------------------
+//   
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+    
+    
+//----------------------------------------------------
+//   
+//    r_gs_main_view
+//    Main view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_main_view 
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = r_gs_softkeys_options_exit_open;
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_main_view_title
+//    Main view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_main_view_title
+    {
+#ifdef RD_CONTROL_PANEL
+    txt = qtn_cp_title_control_panel;
+#else
+    txt = qtn_set_title_settings;        
+#endif //RD_CONTROL_PANEL
+    }
+
+
+RESOURCE LISTBOX r_mainview_lbx
+    {
+    flags = EEikListBoxMultipleSelection;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menubar_open_exit
+// GS menu with 'Open' and 'Exit' items.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_gs_menubar_open_exit
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_exit;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_help;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_open;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+// r_gs_menu_item_open
+// Open item.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_menu_item_open
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknSoftkeyOpen;
+            txt = qtn_set_options_open;
+            flags = EEikMenuItemAction; // action command
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_exit
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_menu_item_exit
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_help
+// Help item.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_menu_item_help
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknCmdHelp;
+            txt = qtn_options_help;
+            }
+        };
+    }
+
+
+
+// SVG changes
+RESOURCE LOCALISABLE_APP_INFO r_gsapp_localisable_app_info
+    {
+#ifdef RD_CONTROL_PANEL
+    short_caption = qtn_apps_controlpanel_grid;
+#else
+    short_caption = qtn_apps_settings_grid;
+#endif //RD_CONTROL_PANEL
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+#ifdef RD_CONTROL_PANEL
+        caption = qtn_apps_controlpanel_list;
+#else
+        caption = qtn_apps_settings_list;
+#endif //RD_CONTROL_PANEL
+        number_of_icons = 1;
+        icon_file = "Z:"APP_BITMAP_DIR"\\GSApp_aif.mif";
+
+        };
+    }
+
+//----------------------------------------------------
+//
+// String for GS Cannot be opened during backup restore
+// r_confirm_note_gs_exit_backup_restore_string
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_confirm_note_gs_exit_backup_restore_string 
+              { buf = qtn_cp_error_open_during_backuprestore; }
+              
+// MSK Handling
+
+// -----------------------------------------------------------------------------
+//   
+//    r_gs_msk_open
+//    Middle softkey label: open.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_gs_msk_open
+    {
+    buf = qtn_msk_open;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_gs_msk_activate
+//    Middle softkey label: activate.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_gs_msk_activate
+    {
+    buf = qtn_msk_activate;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_gs_msk_select
+//    Middle softkey label: select.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_gs_msk_select
+    {
+    buf = qtn_msk_select;
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_gs_msk_change
+//    Middle softkey label: change.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_gs_msk_change
+    {
+    buf = qtn_msk_change;
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_gs_softkey_option
+//    Middle softkey label: Options.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_gs_softkey_option
+    {
+    buf = text_softkey_option;
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_softkeys_options_back_contextoptions
+//    MSK activates Context Menu
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_softkeys_options_back_contextoptions
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyBack; 
+            txt = text_softkey_back; 
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyContextOptions; 
+            txt = text_softkey_option;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_softkeys_options_back_open
+//    Text association with MSK ( OPEN )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_softkeys_options_back_open
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyBack; 
+            txt = text_softkey_back; 
+            },
+        CBA_BUTTON 
+            {
+            id=EGSCmdAppOpen; 
+            txt = qtn_msk_open;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_softkeys_options_exit_open
+//    Text association with MSK ( OPEN )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_softkeys_options_exit_open
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyExit; 
+            txt = text_softkey_exit; 
+            },
+        CBA_BUTTON 
+            {
+            id=EGSCmdAppOpen; 
+            txt = qtn_msk_open;
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_gs_softkeys_options_back_change
+//    Text association with MSK ( CHANGE )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_softkeys_options_back_change
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyBack; 
+            txt = text_softkey_back; 
+            },
+        CBA_BUTTON 
+            {
+            id=EGSMSKCmdAppChange; 
+            txt = qtn_msk_change;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_softkeys_options_exit_change
+//    Text association with MSK ( CHANGE )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_softkeys_options_exit_change
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyExit; 
+            txt = text_softkey_exit; 
+            },
+        CBA_BUTTON 
+            {
+            id=EGSMSKCmdAppChange; 
+            txt = qtn_msk_change;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_softkeys_options_exit_change
+//    Text association with MSK ( CHANGE )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_softkeys_options_back_empty
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyBack; 
+            txt = text_softkey_back; 
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOk; 
+            txt = "";
+            }
+        };
+    }
+
+//End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Data/GSApp_reg.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#include <appinfo.rh>
+#include <GSApp.rsg>
+#include <data_caging_paths_strings.hrh>
+
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x100058EC
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "GSApp";
+    localisable_resource_file = APP_RESOURCE_DIR"\\GSApp";
+    localisable_resource_id = R_GSAPP_LOCALISABLE_APP_INFO;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/GSApplication.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        This is project specification file for General Settings. 
+*
+*/
+
+#include "../Logger/GsLoggingConfiguration.h"
+#include <data_caging_paths.hrh>
+
+#include <platform_paths.hrh>
+
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+CAPABILITY      ALL -TCB
+VENDORID        VID_DEFAULT
+TARGET          gsapp.exe
+EPOCSTACKSIZE   0x10000
+EPOCHEAPSIZE    0x1000  0x1000000
+TARGETTYPE      exe
+UID             0x100039CE  0x100058EC
+
+SYSTEMINCLUDE       /epoc32/include/connect
+
+// Source files
+SOURCEPATH      Src
+SOURCE          GSApp.cpp
+SOURCE          GSUi.cpp
+SOURCE          GSMainView.cpp
+SOURCE          GSMainContainer.cpp
+SOURCE          GSDocument.cpp
+
+SOURCEPATH      Data
+
+START RESOURCE  GSApp.rss
+HEADER
+TARGETPATH      APP_RESOURCE_DIR
+LANGUAGE_IDS
+END  // GSApp.rss
+
+START RESOURCE  GSApp_reg.rss
+DEPENDS gsapp.rsg
+TARGETPATH      /private/10003a3f/apps
+LANGUAGE_IDS
+END
+
+// User include paths
+USERINCLUDE     Inc
+USERINCLUDE     loc
+USERINCLUDE     ../Logger
+USERINCLUDE     ../GSFramework/inc
+
+// Libraries required by framework
+LIBRARY apparc.lib 
+LIBRARY avkon.lib 
+LIBRARY bafl.lib 
+LIBRARY cone.lib 
+LIBRARY eikcoctl.lib 
+LIBRARY eikcore.lib 
+LIBRARY eikctl.lib                  // CEikColumnListBox
+LIBRARY euser.lib 
+LIBRARY ecom.lib
+LIBRARY commonengine.lib            // Shareddata
+LIBRARY egul.lib                    // CGulIcon
+LIBRARY ws32.lib
+LIBRARY apgrfx.lib                  // For RApaLsSession
+LIBRARY efsrv.lib
+LIBRARY aknskinsrv.lib              // For enhanced skinning
+LIBRARY aknskins.lib                // For enhanced skinning
+LIBRARY featmgr.lib                 // Feature manager 
+LIBRARY hlplch.lib                  // For "Help" options menu
+LIBRARY flogger.lib                 // Logging
+LIBRARY gslistbox.lib
+LIBRARY charconv.lib                // For CnvUtfConverter used in CGSPluginLoader
+LIBRARY gsframework.lib
+LIBRARY fbscli.lib                  // For CFbsBitmap
+LIBRARY gsecomplugin.lib
+LIBRARY estor.lib 
+LIBRARY gfxtrans.lib
+LIBRARY CdlEngine.lib
+//End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Inc/GSApp.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CGSApp is an application class required by Symbian OS architecture.
+*
+*/
+
+
+#ifndef GSAPP_H
+#define GSAPP_H
+
+// INCLUDES
+#include <aknapp.h>
+#include <e32std.h>
+
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* CGSApp application class.
+* @since Series60_3.1
+*/
+class CGSApp : public CAknApplication
+{
+    private: // from CApaApplication
+
+        /**
+        * Create CGSDocument document object.
+        */
+        CApaDocument* CreateDocumentL();
+
+        /**
+        * Returns application UID.
+        * @return KUidGS.
+        */
+        TUid AppDllUid() const;
+};
+
+
+#endif // GSAPP_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Inc/GSDocument.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Document class required by Symbian OS architecture.
+*
+*/
+
+
+#ifndef GSDOCUMENT_H
+#define GSDOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+#include "GSBaseDocument.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class  CEikAppUi;
+class  CGSModelCdma;
+
+// CLASS DECLARATION
+
+/**
+*  CGSDocument application class.
+*  @since Series60_3.1
+*/
+class CGSDocument : public CGSBaseDocument
+    {
+    public: // Constructor and destructor
+        /**
+        * Two-phased constructor
+        * @param aApp Application.
+        * @return GS document.
+        */
+        static CGSDocument* NewL(CEikApplication& aApp);
+
+        ~CGSDocument();
+
+    public: // New
+
+        /**
+        * Returns pointer to GS's CDMA model which is owned by the document.
+        * @return GS CDMA model.
+        */
+        CGSModelCdma* ModelCdma();
+
+    private:
+
+        /**
+        * C++ constructor
+        */
+        inline CGSDocument( CEikApplication& aApp ) : CGSBaseDocument( aApp ) { }
+
+        /**
+        * Symbian OS default constructor.
+        *
+        */
+        void ConstructL();
+
+    private: // From CEikDocument
+
+        /**
+        * Create CGSUi "App UI" object.
+        * @return Eikon application UI.
+        */
+        CEikAppUi* CreateAppUiL();
+
+    private: // Data
+
+        // CDMA model
+        CGSModelCdma* iModelCdma;
+    };
+
+#endif // GSDOCUMENT_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Inc/GSEngineInterface.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GS engine interface.
+*
+*/
+
+
+#ifndef GS_ENGINE_INTERFACE_H
+#define GS_ENGINE_INTERFACE_H
+
+// INCLUDES
+#include <e32base.h>
+
+/**
+* Interface to GS engine. Provides functions for creating, deleting, getting 
+* and setting settings data. Supported data types are Tint, Treal, TDesC8 and 
+* TDesC16.
+*/
+class MGSEngine
+    {
+public:
+
+    virtual void MGSEngine() = 0;
+    
+    /**
+    * Adds an observer. Does not take the ownership of the observer. The 
+    * observer will get notification whenever the observed data is changed.
+    */
+    virtual void AddObserverL(MGSEngineObserver* aObserver, TUnt32 aObservedId) = 0;
+    
+    /**
+    * Removes an observer.
+    */
+    virtual void RemoveObserver(MGSEngineObserver* aObserver) = 0;
+    
+    virtual TInt Create(TUint32 aId, TInt aVal) = 0;
+	virtual TInt Create(TUint32 aId, const TReal& aVal) = 0;
+	virtual TInt Create(TUint32 aId, const TDesC8& aVal) = 0;
+	virtual TInt Create(TUint32 aId, const TDesC16& aVal) = 0;
+	
+	virtual TInt Delete(TUint32 aId) = 0;
+
+    virtual TInt Get(TUint32 aId, TInt& aVal) = 0;
+	virtual TInt Set(TUint32 aId, TInt aVal) = 0;
+	
+	virtual TInt Get(TUint32 aId, TReal& aVal) = 0;
+	virtual TInt Set(TUint32 aId, const TReal& aVal) = 0;
+
+	virtual TInt Get(TUint32 aId, TDes8& aVal) = 0;
+	virtual TInt Set(TUint32 aId, const TDesC8& aVal) = 0;
+
+	virtual TInt Get(TUint32 aId, TDes16& aVal) = 0;
+	virtual TInt Set(TUint32 aId, const TDesC16& aVal) = 0;
+    
+    
+    };
+
+/**
+* Observer for GS engine. 
+*/
+class MGSEngineObserver
+    {
+    virtual void ValueChanged(TUint32 aId) = 0;
+    };
+
+#endif //GS_ENGINE_INTERFACE_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Inc/GSMainContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container class for main view.
+*
+*/
+
+#ifndef GSCONTAINER_H
+#define GSCONTAINER_H
+
+#include    "gsbasecontainer.h"
+#include    <bldvariant.hrh>
+#include    <AknIconArray.h>
+#include    <AknsUtils.h>     // For loading icons
+
+// CLASS DECLARATION
+class CAknViewAppUi;
+class CAknSingleLargeStyleListBox;
+class CGSPluginInterface;
+
+/**
+* Container class for the GS Main view.
+* @since Series60_3.1
+*/
+class CGSMainContainer : public CCoeControl, public MEikListBoxObserver
+{
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS constructor.
+        * Required by the base class.
+        *
+        */
+        void ConstructL(
+            const TRect& aRect,
+            CAknViewAppUi* aAppUi,
+            CArrayPtrFlat<CGSPluginInterface>* aPluginArray );
+
+        /**
+        * Destructor.
+        */
+        ~CGSMainContainer();
+
+    public: // New
+
+        /**
+        * Updates listbox.
+        */
+        void UpdateListBoxL();
+
+        /**
+        * @return pointer to owned listbox.
+        */
+        CAknSingleLargeStyleListBox* ListBox();
+
+        /**
+        * @return Plugin which is selected in the lbx.
+        */
+        CGSPluginInterface* SelectedPlugin();
+
+        /**
+        * Sets selected lbx item using the UID of the item. If the item is not
+        * existing or visible anymore, selected item is the first item in the
+        * lbx.
+        */
+        void SetSelectedItem( TUid aSelectedItemUid );
+        
+        /**
+         * Set the empty text of list box.
+         */
+        void SetListBoxEmptyTextL(const TDes& aEmpty);
+
+        /**
+         * @return the exact position of the listbox containing current item index,
+         * iVerticalOffset and  TopItemindex
+         */
+        void GetPositionL(RArray<TInt>& posArray);
+
+        /**
+         * set listbox's exact position.
+         */
+        void SetPosition(const RArray<TInt>& pos, TBool aChangeMode);
+        
+
+    public: // From CCoeControl
+
+        /**
+        * See base class.
+        */
+        void HandleResourceChange( TInt aType );
+
+        /**
+        * Set focus on the selected listbox. For animated skins feature.
+        */
+        void FocusChanged( TDrawNow aDrawNow );
+
+    protected: // New
+
+        /**
+        * Required for help.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    protected: // From MEikListBoxObserver
+        /**
+        * Handles listbox events.
+        * @param aListBox Listbox where the event occurred.
+        * @param aEventType Event type.
+        */
+        void HandleListBoxEventL( CEikListBox* aListBox,
+                                  TListBoxEvent aEventType );
+    private: // New
+
+        /**
+        * Adds plugin data to listbox.
+        * @param aPlugin A plugin whose data is to be used.
+        * @param aIndex Index of the plugin in the listbox.
+        * @param aItemTextArray Array for plugin texts and format strings used
+        *        by lbx.
+        * @param aIconArray Array for icons used in lbx.
+        */
+        void AddPluginDataToLbxL( CGSPluginInterface* aPlugin,
+                                  TInt aIndex,
+                                  CDesCArray* aItemTextArray,
+                                  CAknIconArray* aIconArray );
+
+    private: // From CCoeControl
+
+        /**
+        * See base class.
+        */
+        void SizeChanged();
+
+        /**
+        * See base class.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * See base class.
+        */
+        CCoeControl* ComponentControl( TInt /*aIndex*/ ) const;
+
+        /**
+        * See base class.
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                     TEventCode aType );
+
+    private: // Data
+
+        // Owned listbox.
+        CAknSingleLargeStyleListBox* iListBox;
+
+        // Pointer to Application UI. Not owned.
+        CAknViewAppUi* iAppUi;
+
+        /**
+        * Pointer to listbox model's item texts. Note that the indexes of
+        * listbox items are mapped directly to the indexes in plugin array.
+        * Plugin which maps to selected listbox item index in plugin array is
+        * activated when item is selected in listbox.
+        *
+        * Owned by iListBox.
+        */
+        CDesCArray* iItemTextArray;
+
+        // Given from CGSMainView - not owned
+        CArrayPtrFlat<CGSPluginInterface>* iPluginArray;
+
+        // Array of pointers to iPluginArray plugins which are visible.
+        // This is the actual array which is displayed by the listbox.
+        // It is needed because iPluginArray also contains non-visible plugins
+        // and therefore the indexes do not match to lbx items.
+        CArrayPtrFlat<CGSPluginInterface>* iVisiblePlugins;
+};
+
+
+#endif // GSCONTAINER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Inc/GSUi.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GS Application UI.
+*
+*/
+
+
+#ifndef GSUI_H
+#define GSUI_H
+
+// INCLUDES
+#include <aknViewAppUi.h>
+#include <aknsettingpage.h>
+//#include <ecom/ecom.h>
+#include <apgnotif.h>
+#include "GSEComNotifier.h"
+#include <apadoc.h>
+
+
+// CLASS DECLARATION
+class CAknWaitDialog;
+class CGSDocument;
+
+//For embedding CC in CS
+class TAppInfo
+  {
+    public:
+      TAppInfo( TUid aUid, const TDesC& aFile )
+        : iUid( aUid ), iFile( aFile )
+        {}
+      TUid iUid;
+      TFileName iFile;
+  };
+
+
+/**
+* UI class for General Settings application.
+* @since Series60_3.1
+*/
+class CGSUi : public CAknViewAppUi, MGSEComObserver
+    {
+
+    public: // Constructors and destructor
+
+        /**
+        * C++ default constructor
+        */
+        CGSUi();
+
+        /**
+        * Symbian OS default constructor.
+        *
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CGSUi();
+
+    public: // New
+
+        /**
+        * After successfully selecting a manual network, Phone is activated in
+        * Idle state.
+        */
+        void PhoneIdle();
+
+    /**
+    * For embedding CC in CS
+    */
+    virtual void EmbedAppL( const TAppInfo& aApp );
+
+    /**
+    * Get document object
+    */
+    CGSDocument& GSDocument() const;
+
+    public: // From CEikAppUi
+        /**
+        * Takes care of command handling.
+        * @param aCommand command to be handled
+        */
+        void HandleCommandL( TInt aCommand );
+
+
+    protected:  // From CEikAppUi
+
+        /**
+        * Message handling from CEikAppUi. See CEikAppUi.
+        */
+        MCoeMessageObserver::TMessageResponse HandleMessageL(
+            TUint32 aClientHandleOfTargetWindowGroup,
+            TUid aMessageUid,
+            const TDesC8 &aMessageParameters );
+
+    protected: // From MGSEComObserver
+
+        /**
+        *  See Base class.
+        */
+        void HandleEComEvent( TEComEvent aEvent );
+
+    private: // From CEikAppUi
+
+        /**
+        * handles key events
+        * @param aKeyEvent
+        * @param aType type of the key event
+        * @return TKeyResponse
+        */
+        virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent,
+                                              TEventCode aType );
+
+    private: // New
+
+        /**
+        * Construct views.
+        */
+        void ConstructViewsL();
+
+        /**
+        * @return void
+        */
+        void ShowNoteGsNotOpenedDuringBackupRestoreL();
+
+        /**
+        * Closes embedded application if any exist.
+        * @return KErrNone if succeeds.
+        */
+        TInt FindAndKillEmbeddedAppL();
+
+    private: // From CEikAppUi
+
+        /**
+        * Handles resource change.
+        */
+        void HandleResourceChangeL( TInt aType );
+
+    protected: // Data
+
+        // Pointer to wait dialog.
+        CAknWaitDialog* iWaitDialog;
+
+    // Embedding.
+        CApaDocument* iEmbedded;
+        CAknView* iMainView;
+
+        // Notifies if plugins are installed/uninstalled.
+        CGSEComNotifier* iEComNotifier;
+
+    };
+
+#endif // GSUI_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Src/GSApp.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  General Settings Application
+*
+*/
+
+
+// INCLUDE FILES
+#include    <eikstart.h>
+#include    "GSApp.h"
+#include    "GSDocument.h"
+#include    <gsfwviewuids.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSApp::AppDllUid()
+// Returns application UID
+//
+// ---------------------------------------------------------------------------
+TUid CGSApp::AppDllUid() const
+    {
+    return KUidGS;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSApp::CreateDocumentL()
+// Creates CGSDocument object
+//
+// ---------------------------------------------------------------------------
+CApaDocument* CGSApp::CreateDocumentL()
+    {
+    return CGSDocument::NewL(*this);
+    }
+
+
+// ===================== OTHER EXPORTED FUNCTIONS ============================
+//
+
+
+// ---------------------------------------------------------------------------
+// NewApplication()
+// constructs CGSApp
+// Returns: CApaDocument*: created application object
+//
+// ---------------------------------------------------------------------------
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CGSApp;
+    }
+
+
+// ---------------------------------------------------------------------------
+// E32Main()
+//
+// ---------------------------------------------------------------------------
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Src/GSDocument.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Document for the General Settings Application
+*
+*/
+
+
+// INCLUDE FILES
+#include    <bldvariant.hrh>
+
+#include    "GSDocument.h"
+#include    "GSUi.h"
+#include    "gsplugininterface.h"
+#include    "gspluginloader.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------
+// CGSDocument::ConstructL()
+// Symbian OS default constructor can leave.
+//
+// ----------------------------------------------------
+//
+void CGSDocument::ConstructL()
+    {
+    CGSBaseDocument::ConstructL();
+    }
+
+
+// ----------------------------------------------------
+// CGSDocument::~CGSDocument
+// Symbian OS destructor
+//
+// ----------------------------------------------------
+//
+CGSDocument::~CGSDocument()
+    {
+    }
+
+
+// ----------------------------------------------------
+// CGSDocument::NewL()
+// Two-phased constructor.
+//
+// ----------------------------------------------------
+//
+CGSDocument* CGSDocument::NewL( CEikApplication& aApp )
+    {
+    CGSDocument* self = new( ELeave ) CGSDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------
+// CGSDocument::ModelCdma()
+// Returns the CDMA model.
+//
+// ----------------------------------------------------
+//
+CGSModelCdma* CGSDocument::ModelCdma()
+    {
+    // CDMA engine is not supported by this variant.
+    return NULL;
+    }
+
+
+// ----------------------------------------------------
+// CGSDocument::CreateAppUiL()
+// constructs CGSUi
+//
+// ----------------------------------------------------
+//
+CEikAppUi* CGSDocument::CreateAppUiL()
+    {
+    CGSUi* appUi = new(ELeave) CGSUi();
+    return appUi;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,523 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the main view of General Settings
+*
+*/
+
+
+// INCLUDE FILES
+#include    <bldvariant.hrh>
+
+#include    "GSUi.h"
+#include    "gsmainview.h"
+#include    "GSMainContainer.h"
+#include    "gsplugininterface.h"
+#include    "GsLogger.h"
+#include    <GSApp.rsg>         // Resources for mainview
+
+#include    <aknlists.h>
+#include    <calslbs.h>
+#include    <eikclbd.h>
+#include    <AknIconArray.h>    // For loading icons
+#include    <AknsUtils.h>       // For loading icons
+#include    <aknViewAppUi.h>
+#include    <akntitle.h>
+#include    <barsread.h>
+#include    <gulicon.h>         // For CGulIcon
+#include    <csxhelp/cp.hlp.hrh>
+#include    <gsfwviewuids.h>    // for KUidGS
+
+//CONSTANTS
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::ConstructL(const TRect& aRect)
+// Symbian OS two phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainContainer::ConstructL(
+    const TRect& aRect,
+    CAknViewAppUi* aAppUi,
+    CArrayPtrFlat<CGSPluginInterface>* aPluginArray )
+    {
+    iAppUi = aAppUi;
+    iPluginArray = aPluginArray;
+
+    // Initialize the array containing pointers to plugins that are actually
+    // displayed in lbx.
+    iVisiblePlugins = new CArrayPtrFlat<CGSPluginInterface>( 10 );
+
+    CEikStatusPane* sp = iAppUi->StatusPane();
+    CAknTitlePane* title = static_cast<CAknTitlePane*>
+        ( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+
+    // Set view title from resource:
+    TResourceReader rReader;
+    iCoeEnv->CreateResourceReaderLC( rReader, R_GS_MAIN_VIEW_TITLE );
+    title->SetFromResourceL( rReader );
+    CleanupStack::PopAndDestroy(); //rReader
+
+    CreateWindowL(); // Makes this control a window-owning control
+
+    // Create listbox:
+    iListBox = new( ELeave ) CAknSingleLargeStyleListBox;
+    iListBox->ConstructL( this );
+    iListBox->SetContainerWindowL( *this );
+    iListBox->SetListBoxObserver( this );
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+
+    // Obtain reference to listbox's item text array:
+    iItemTextArray
+        = STATIC_CAST( CDesCArray*, iListBox->Model()->ItemTextArray() );
+
+    SetRect( aRect );
+    ActivateL();
+    __GSLOGSTRING( "[CGSMainContainer] ConstructL()" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::~CGSMainContainer()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSMainContainer::~CGSMainContainer()
+    {
+    if  ( iVisiblePlugins )
+        {
+        iVisiblePlugins->Reset();
+        }
+    delete iVisiblePlugins;
+
+    if  ( iItemTextArray )
+        {
+        iItemTextArray->Reset();
+        }
+
+    if ( iListBox )
+        {
+        delete iListBox;
+        }
+    __GSLOGSTRING( "[CGSMainContainer] ~CGSMainContainer" );
+  }
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::UpdateListbox
+//
+// Updates listbox from iPluginArray.
+// ---------------------------------------------------------------------------
+//
+void CGSMainContainer::UpdateListBoxL()
+    {
+    __GSLOGSTRING( "[CGSMainContainer::UpdateListBoxL]" );
+    
+    // Empty item array because it will be reoccupied.
+    iItemTextArray->Reset();
+
+    // Empty the array because it will be updated.
+    iVisiblePlugins->Reset();
+
+    // Array for icons in the listbox. Owns the icons.
+    CAknIconArray* icons = new (ELeave) CAknIconArray( 10 );
+    CleanupStack::PushL( icons );
+
+    // Index of the plugin inserted into lbx item array.
+    TInt pluginIndex = 0;
+
+    // 1) Add each plugin's data to listbox if the plugin is visible.
+    for( TInt i = 0; i < iPluginArray->Count(); i++ )
+        {
+        CGSPluginInterface* plugin = iPluginArray->operator[]( i );
+        if( plugin->Visible() )
+            {
+            AddPluginDataToLbxL( plugin, pluginIndex, iItemTextArray, icons );
+            pluginIndex++;
+            }
+        }
+
+    // Destroy the old icons because SetIconArray() does not destroy them.
+    CArrayPtr<CGulIcon>* oldIcons
+        = iListBox->ItemDrawer()->ColumnData()->IconArray();
+    if( oldIcons )
+        {
+        oldIcons->ResetAndDestroy();
+        delete oldIcons;
+        }
+
+    // Transfer ownership of icon array to the lbx.
+    // SetIconArray() does not delete the old icon array
+    iListBox->ItemDrawer()->ColumnData()->SetIconArray( icons );
+    CleanupStack::Pop( icons );
+
+    // Draws listbox again
+    iListBox->HandleItemAdditionL();
+    }
+
+
+//Disabling warning caused by err variable used inside macros
+#pragma diag_suppress 550
+// -----------------------------------------------------------------------------
+// CGSMainContainer::AddPluginDataToLbxL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSMainContainer::AddPluginDataToLbxL( CGSPluginInterface* aPlugin,
+                                              TInt aIndex,
+                                              CDesCArray* aItemTextArray,
+                                              CAknIconArray* aIconArray )
+    {
+    // Add the plugin to visible plugins array:
+    iVisiblePlugins->AppendL( aPlugin );
+
+    // 1.1) Read item descriptor from plugin:
+    TBuf<256> buf;
+    _LIT( KTab, "\t" );
+
+    TRAPD
+        (
+        captionErr,
+        aPlugin->GetCaptionL( buf );
+        )
+
+    // If plugin caption fails, set caption to error string.
+    if( captionErr != KErrNone )
+        {
+        _LIT( KGSParentPluginCaptionErrorTxt, "Error" );
+        buf.Append( KGSParentPluginCaptionErrorTxt );
+        }
+       else
+        {
+        __GSLOGSTRING2( "[CGSMainContainer] 0x%X::GetCaptionL Error: %d",
+        aPlugin->Id().iUid, captionErr );
+        }
+
+    /**
+    * 1.2) Create formatted item string.
+    * list_single_large_pane:
+    * list item string format: "1\tTextLabel\t0\t0"
+    * where 0 is an index to icon array
+    */
+    TBuf<256> item;
+    item.AppendNum( aIndex );
+    item.Append( KTab );
+    item.Append( buf );
+
+    aItemTextArray->AppendL( item );
+
+    // 1.3) Add icons if listbox uses them:
+    CGulIcon* icon;
+    TRAPD
+        (
+        iconErr,
+        icon = aPlugin->CreateIconL( KGSIconTypeLbxItem );
+        )
+
+    __GSLOGSTRING2(
+        "[CGSMainContainer] CreateIconL result for 0x%X: %d",
+        aPlugin->Id().iUid, iconErr );
+    TSize size = icon->Bitmap()->SizeInPixels();
+    CleanupStack::PushL( icon );
+    aIconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+    }
+//Enabling warnings
+#pragma diag_default 550
+    
+    
+// ---------------------------------------------------------------------------
+// CGSMainContainer::GetHelpContext(TCoeHelpContext& aContext) const
+// Gets Help
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_MAIN_VIEW;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::SizeChanged
+// called by framwork when the view size is changed
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainContainer::SizeChanged()
+    {
+    if ( iListBox )
+        {
+        iListBox->SetRect( Rect() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::CountComponentControls
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSMainContainer::CountComponentControls() const
+    {
+    return 1;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::ComponentControl
+//
+//
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CGSMainContainer::ComponentControl(TInt /*aIndex*/) const
+    {
+    return iListBox;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::TKeyResponse OfferKeyEventL
+// Called when a key is pressed.
+//
+// ---------------------------------------------------------------------------
+//
+TKeyResponse  CGSMainContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,
+                                               TEventCode aType)
+    {
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+            // Listbox takes all event even if it doesn't use them
+            return EKeyWasNotConsumed;
+        default:
+            break;
+        }
+    // now it's iListBox's job to process the key event
+    return iListBox->OfferKeyEventL(aKeyEvent, aType);
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::HandleListBoxEventL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSMainContainer::HandleListBoxEventL(
+    CEikListBox* aListBox,
+    TListBoxEvent aEventType )
+    {
+    __GSLOGSTRING1(
+        "[CGSMainContainer] HandleListBoxEventL aEventType:%d",
+        aEventType);
+    switch ( aEventType )
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemSingleClicked:
+            {
+            if (aListBox->CurrentItemIndex() < 0)
+                {
+                // Negative listbox value -> no item selected? 
+                break;
+                }
+
+            CGSPluginInterface* selectedPlugin = iVisiblePlugins->operator[](
+                    aListBox->CurrentItemIndex());
+
+            // Different command is used depending on the plugin type.
+            switch (selectedPlugin->ItemType())
+                {
+                // In these cases the plugin is a view:
+                case EGSItemTypeSingleLarge:
+                case EGSItemTypeSetting:
+                case EGSItemTypeSettingIcon:
+                    iAppUi->ActivateLocalViewL(selectedPlugin->Id());
+                    break;
+                    // In these cases the plugin is a dialog:
+                case EGSItemTypeSettingDialog:
+                case EGSItemTypeSingleLargeDialog:
+                    selectedPlugin->HandleSelection(
+                            EGSSelectionBySelectionKey);
+                    UpdateListBoxL(); // Refrest the listbox if value changed.
+                    break;
+                }
+            }
+            break;
+        default:
+           break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::ListBox()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CAknSingleLargeStyleListBox* CGSMainContainer::ListBox()
+    {
+    return iListBox;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::HandleResourceChange()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainContainer::HandleResourceChange( TInt aType )
+    {
+    //Handle layout orientation or skin change
+    CCoeControl::HandleResourceChange( aType );
+    if ( aType == KAknsMessageSkinChange )
+        {
+        TRAP_IGNORE( UpdateListBoxL() );
+        }
+    else if ( aType == KEikDynamicLayoutVariantSwitch  )
+	    {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
+                                           mainPaneRect);
+        SetRect( mainPaneRect );
+	    }
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CGSMainContainer::SelectedPlugin()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGSPluginInterface* CGSMainContainer::SelectedPlugin()
+    {
+    CGSPluginInterface* plugin = NULL;
+    const TInt index = iListBox->CurrentItemIndex();
+    if ( index >= 0 && index <= iVisiblePlugins->Count() )
+        {
+        plugin = iVisiblePlugins->operator[]( index );
+    __GSLOGSTRING2( "[CGSMainContainer] SelectedPlugin 0x%X in index %d",
+        plugin->Id().iUid, index );
+        }
+    return plugin;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSMainContainer::SetSelectedItem()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSMainContainer::SetSelectedItem( TUid aSelectedItemUid )
+    {
+    __GSLOGSTRING1( "[CGSMainContainer] SetSelectedItem(0x%X)",
+        aSelectedItemUid.iUid );
+
+    TInt selectedItemIndex  = 0;
+    for( TInt i = 0; i < iVisiblePlugins->Count(); i++ )
+        {
+        CGSPluginInterface* plugin = iVisiblePlugins->operator[]( i );
+
+        __GSLOGSTRING2( "[CGSMainContainer] Checking [%d] 0x%X)",
+            i, plugin->Id().iUid );
+
+        // If plugin is found, select it:
+        if( plugin->Id() == aSelectedItemUid )
+            {
+            __GSLOGSTRING2( "[CGSMainContainer] Match 0x%X in index %d",
+                plugin->Id().iUid, i );
+            selectedItemIndex = i;
+            break;
+            }
+        }
+    iListBox->SetCurrentItemIndexAndDraw( selectedItemIndex );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::FocusChanged
+//
+// Set focus on the selected listbox. For animated skins feature.
+// ---------------------------------------------------------------------------
+void CGSMainContainer::FocusChanged( TDrawNow /*aDrawNow*/ )
+    {
+    if( iListBox )
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSMainContainer::SetListBoxEmptyTextL()
+//
+//Set the empty text of list box.
+// -----------------------------------------------------------------------------
+//
+void CGSMainContainer::SetListBoxEmptyTextL(const TDes& aEmpty )
+    {
+    if( iListBox )
+        {
+        iListBox->View()->SetListEmptyTextL( aEmpty );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::GetPositionL()
+//
+//Get the exact position of listbox.
+// -----------------------------------------------------------------------------
+//
+void CGSMainContainer::GetPositionL(RArray<TInt>& posArray)
+	{
+	posArray.AppendL(iListBox->CurrentItemIndex());
+	posArray.AppendL(iListBox->View()->ItemOffsetInPixels());
+	posArray.AppendL(iListBox->View()->TopItemIndex());
+	return;
+	}
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::GetPositionL()
+//
+//Get the exact position of listbox.
+// -----------------------------------------------------------------------------
+//
+void CGSMainContainer::SetPosition(const RArray<TInt>& pos, TBool aChangeMode)
+	{
+	iListBox->SetCurrentItemIndex(pos.operator[](0));
+
+	if (aChangeMode)
+		{
+		iListBox->View()->VerticalMoveToItemL(pos.operator[](0),
+				CListBoxView::ESingleSelection);
+		}
+	else
+		{
+		iListBox->View()->SetItemOffsetInPixels(pos.operator[](1));
+		iListBox->View()->SetTopItemIndex(pos.operator[](2));
+		}	
+	}
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,454 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main View.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <gsmainview.h>
+#include    "GSMainContainer.h"
+#include    "GsLogger.h"
+#include    "gsplugininterface.h"
+#include    "GSDocument.h"
+#include    "GSUi.h"
+#include    <GSApp.rsg>
+#include    <gsfwviewuids.h>
+
+#include    <aknlists.h>
+#include    <ConeResLoader.h>
+#include    <featmgr.h>
+#include    <akntitle.h>
+#include    <bautils.h> // Localization
+#include    <hlplch.h>
+#include    <gscommon.hrh>
+#include    <gfxtranseffect/gfxtranseffect.h>
+#include	<LayoutMetaData.cdl.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSMainView::CGSMainView
+// C++ constructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSMainView::CGSMainView()
+    : iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::NewL()
+// Symbian OS two-phased constructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSMainView* CGSMainView::NewL()
+    {
+    CGSMainView* self = NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::NewLC()
+// Symbian OS two-phased constructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSMainView* CGSMainView::NewLC()
+    {
+    CGSMainView* self = new( ELeave ) CGSMainView();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::ConstructL(const TRect& aRect)
+// Symbian OS default constuctor.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSMainView] ConstructL()" );
+    iAppUi = AppUi();
+
+    OpenLocalizedResourceFileL( KGSMainViewResourceFileName );
+    BaseConstructL( R_GS_MAIN_VIEW );
+
+    iPluginArray = new CArrayPtrFlat<CGSPluginInterface>( 10 );
+
+    iPluginLoader = CGSPluginLoader::NewL( iAppUi );
+    iPluginLoader->SetObserver( this );
+    iPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, KGSMainViewUid,
+        iPluginArray );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::~CGSMainView()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSMainView::~CGSMainView()
+    {
+    __GSLOGSTRING( "[CGSMainView] ~CGSMainView" );
+    if ( iPluginLoader )
+        {
+        delete iPluginLoader;
+        }
+
+    if ( iPluginArray )
+        {
+        // Since the plugins are actually avkon views, avkon is responsible
+        // for owning the plugins. This means we do not reset and destroy
+        // the contents of the array in which the plugins reside. We have to
+        // leave it up to avkon to tidy up.
+        delete iPluginArray;
+        }
+
+    iResourceLoader.Close();
+
+    if( iContainer && iAppUi )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSMainView::OpenLocalizedResourceFileL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::OpenLocalizedResourceFileL( const TDesC& aResourceFileName )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+    CleanupClosePushL( fsSession );
+
+    // Find the resource file
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_APP_RESOURCE_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file
+    iResourceLoader.OpenL( fileName );
+
+    CleanupStack::PopAndDestroy( &fsSession );
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSMainView::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSMainView::Id() const
+    {
+    return KGSMainViewUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                               TUid /*aCustomMessageId*/,
+                               const TDesC8& /*aCustomMessage*/ )
+    {
+    __GSLOGSTRING( "[CGSMainView] DoActivateL()" );
+    
+    iPluginLoader->RequestPriority( CActive::EPriorityHigh );
+    
+    if( iContainer )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    NewContainerL();
+    
+    // Set the empty text of list box
+    _LIT( KEmptyText, "" );
+    TBuf<1> empty( KEmptyText );
+    iContainer->SetListBoxEmptyTextL( empty );
+    
+    // Do this to update listbox from already existing iPluginArray.
+    iContainer->UpdateListBoxL();
+    if (position.Count() > 0)
+		{
+		if (iScreenMode == Layout_Meta_Data::IsLandscapeOrientation())
+			{
+			iContainer->SetPosition(position, EFalse);
+			}
+		else
+			{
+			iContainer->SetPosition(position, ETrue);
+			}
+		}
+    iAppUi->AddToViewStackL( *this, iContainer );
+    // Navigating to main view will reset all child plugin selected indexes:
+    for( TInt i = 0; i < iPluginArray->Count(); i++ )
+        {
+        CGSPluginInterface* plugin = iPluginArray->operator[]( i );
+        plugin->ResetSelectedItemIndex();
+        }
+    GfxTransEffect::EndFullScreen();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSMainView] DoDeactivate()" );
+    
+    iPluginLoader->RequestPriority( CActive::EPriorityLow );
+    
+    if ( iContainer )
+        {
+		if (position.Count() > 0)
+			{
+			position.Reset();
+			}
+		TRAPD(err, iContainer->GetPositionL(position));
+		iScreenMode = Layout_Meta_Data::IsLandscapeOrientation();
+		iAppUi->RemoveFromViewStack(*this, iContainer);
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::NewContainerL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::NewContainerL()
+    {
+    iContainer = new( ELeave ) CGSMainContainer;
+    iContainer->SetMopParent( this );
+
+    TRAPD(
+        error,
+        iContainer->ConstructL( ClientRect() , AppUi(), iPluginArray ) );
+
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSMainView::HandleCommandL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::HandleCommandL( TInt aCommand )
+    {
+    __GSLOGSTRING1( "[CGSMainView] HandleCommandL(%d)", aCommand );
+
+    switch ( aCommand )
+        {
+        case EGSCmdAppOpen:
+        case EAknSoftkeyOpen:
+            if( iContainer )
+                {
+                CGSPluginInterface* plugin = iContainer->SelectedPlugin();
+                if ( plugin )
+                	{
+                    switch (plugin->ItemType())
+                        {
+                        // In these cases the plugin is a view:
+                        case EGSItemTypeSingleLarge:
+                        case EGSItemTypeSetting:
+                        case EGSItemTypeSettingIcon:
+                            iAppUi->ActivateLocalViewL(plugin->Id());
+                            break;
+                            // In these cases the plugin is a dialog:
+                        case EGSItemTypeSettingDialog:
+                        case EGSItemTypeSingleLargeDialog:
+                            plugin->HandleSelection(EGSSelectionByMenu);
+                            break;
+                        }
+                	}
+                }
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSMainView::HandlePluginLoaded()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::HandlePluginLoaded( KGSPluginLoaderStatus aStatus )
+    {
+    __GSLOGSTRING1( "[CGSMainView::HandlePluginLoaded] aStatus:%d", aStatus );
+    
+    switch( aStatus )
+        {
+        case MGSPluginLoadObserver::EGSSuccess:
+            // Should not update each time when plugin is loaded, only when 
+            // finished loading spesific view plugins?
+            break;
+        case MGSPluginLoadObserver::EGSFinished:
+            if( iContainer )
+                {
+                TRAPD( err,
+                       iContainer->UpdateListBoxL(); )
+                if( err != KErrNone )
+                    {
+                    __GSLOGSTRING1(
+                        "[CGSMainView] Error updating listbox: %d", 
+                        err );
+                    }
+                }
+            break;
+        default:
+            break;
+        }
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainView::TransferDynamicPluginL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSMainView::TransferDynamicPluginL( CGSPluginInterface* aPlugin )
+    {
+    __GSLOGSTRING1( "[CGSMainView] CGSMainView::TransferDynamicPluginL() - plugin id: 0x%x added to appUi.", aPlugin->Id() );
+
+    CleanupStack::PushL( aPlugin );
+    iAppUi->AddViewL( aPlugin );
+    CleanupStack::Pop( aPlugin );
+    
+    // Add to the overall plugin array for this parent plugin
+    iPluginArray->AppendL( aPlugin );
+    
+    // Resort the plugins so that they are in order
+    iPluginLoader->SortPluginsL( iPluginArray );
+    
+    // Update the listbox with the new information
+    HandlePluginLoaded( MGSPluginLoadObserver::EGSSuccess );
+    }
+
+
+// -------------------------------------------------    --------------------------
+// TUid CGSMainView::TabbedViews()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CArrayPtrFlat<CGSPluginInterface>* CGSMainView::TabbedViews()
+    {
+    return iPluginArray;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSMainView::TabChangedL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSMainView::TabChangedL( TUid selectedTabUid )
+    {
+    // Update selected item because changing tab in main view's children
+    // affects also main view's selected item:
+    iSelectedPluginUid = selectedTabUid;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSMainView::UpdateView()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSMainView::UpdateView()
+    {
+    TRAP_IGNORE( iContainer->UpdateListBoxL() );
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CGSMainView::DynInitMenuPaneL()
+//
+// dynamically handle help item if not supported
+// -----------------------------------------------------------------------------
+//
+void CGSMainView::DynInitMenuPaneL( TInt aResourceId, 
+                                    CEikMenuPane* aMenuPane )
+    {   
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+        
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ))
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/Src/GSUi.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,438 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  General Settings User Interface
+*
+*/
+
+
+// INCLUDE FILES
+#include    <bldvariant.hrh>
+#include    <eikapp.h>
+#include    <avkon.hrh>
+#include    <akncontext.h>
+#include    <aknnotewrappers.h>
+#include    <aknnavi.h>
+#include    <aknnavide.h>
+#include    <akntabgrp.h>
+#include    <akntitle.h>
+#include    <AknUtils.h>
+#include    <AknsConstants.h> // For determining skin change
+#include    <barsread.h>
+#include    <StringLoader.h>
+#include    <GSApp.rsg>
+#include    <eikenv.h>
+#include    <ConeResLoader.h>
+#include    <apgcli.h>
+#include    <f32file.h>
+#include    <hlplch.h> // For HlpLauncher
+#include    <w32std.h>
+#include    <eikproc.h> // Embedding CC in GS
+#include    <aknclearer.h> // Embedding CC in GS
+#include    <apacln.h> // Embedding CC in GS
+#include    <PSVariables.h>
+#include    <e32std.h> // The USER class
+#include    <featmgr.h>
+#include    <s32mem.h>
+
+#include    <gsplugininterface.h>
+#include    <gsbaseview.h>
+#include    <gsfwviewuids.h>
+
+#include  <apgwgnam.h>
+#include    "GsLogger.h"
+#include    "GSUi.h"
+#include    <gsmainview.h>
+#include    "GSDocument.h"
+#include    "gssettingid.h"
+#include    <mgswatchdog.h>
+
+// System Includes
+#include  <e32property.h>
+#include <sbdefs.h>
+using namespace conn;
+
+//CONSTANTS
+
+const TInt KGSPhoneAppID = 0x100058b3;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ----------------------------------------------------
+// CGSUi::CGSUi()
+//
+// Default constructor.
+// ----------------------------------------------------
+CGSUi::CGSUi()
+    {
+    }
+
+
+// ----------------------------------------------------
+// CGSUi::~CGSUi()
+// destructor
+//
+// ----------------------------------------------------
+CGSUi::~CGSUi()
+    {
+    GSDocument().PrepareForUIDestruction();
+
+    FeatureManager::UnInitializeLib();
+
+    //Embedding - removing created document
+    if ( iEmbedded )
+        {
+        iEikonEnv->Process()->DestroyDocument( iEmbedded );
+        }
+    if( iEComNotifier )
+        {
+        delete iEComNotifier;
+        }
+    }
+
+
+// ----------------------------------------------------
+// CGSUi::ConstructL()
+//
+// Symbian OS two-phased constructor
+// ----------------------------------------------------
+void CGSUi::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSUi] ConstructL()" );
+    FeatureManager::InitializeLibL();
+    BaseConstructL( EAknEnableSkin | EAknEnableMSK |EAknSingleClickCompatible );
+    TInt backupInfo = 0;
+  const TInt error = RProperty::Get( TUid::Uid( KUidSystemCategoryValue ),
+                             KUidBackupRestoreKey,
+                             backupInfo );
+  // We check if the backup/restore process is underway
+  if  ( error == KErrNone )
+    {
+        // Work out what kind of operation is underway:
+    if ( ( backupInfo & KBURPartTypeMask ) == EBURNormal ||
+         ( backupInfo & KBURPartTypeMask ) == EBURUnset )
+      {
+      ConstructViewsL();
+      //Activate the main view to be the first view when
+      // application is opened.
+      SetDefaultViewL( *iMainView );
+      }
+    else
+      {
+      if ( ( backupInfo & KBURPartTypeMask) == EBURBackupFull ||
+           ( backupInfo & KBURPartTypeMask) == EBURBackupPartial )
+        {
+            // Backup In Progress.. show a Note and Dont Launch GS
+            ShowNoteGsNotOpenedDuringBackupRestoreL();
+        }
+      else if ( ( backupInfo & KBURPartTypeMask) == EBURRestoreFull ||
+                ( backupInfo & KBURPartTypeMask) == EBURRestorePartial )
+        {
+            // Restore In Progress.. show a Note and Dont Launch GS
+                    ShowNoteGsNotOpenedDuringBackupRestoreL();
+        }
+      }
+    }
+
+    GSDocument().PreparePluginCacheL( *this );
+
+    // This will observe plugin install events.
+    iEComNotifier = CGSEComNotifier::NewL( this, GSDocument().GetImplInfo() );
+    }
+
+
+// ----------------------------------------------------
+// CGSUi::ConstructViewsL()
+//
+// ----------------------------------------------------
+void CGSUi::ConstructViewsL()
+    {
+    __GSLOGSTRING( "[CGSUi] Constructing views..." );
+
+    iMainView = CGSMainView::NewL();
+    AddViewL( iMainView );         // transfer ownership to CAknViewAppUi
+
+    __GSLOGSTRING( "[CGSUi] Constructing views done." );
+    }
+
+
+// ----------------------------------------------------
+// CGSUi::HandleCommandL(TInt aCommand)
+//
+//
+// ----------------------------------------------------
+void CGSUi::HandleCommandL( TInt aCommand )
+    {
+    __GSLOGSTRING1( "[CGSUi] HandleCommandL(%d)", aCommand );
+    switch ( aCommand )
+        {
+        case EEikCmdExit:
+            GSDocument().WatchDog()->ReportCleanExitL();
+            Exit();
+            break;
+        case EAknCmdExit:
+            GSDocument().WatchDog()->ReportCleanExitL();
+            Exit();
+            break;
+        case EAknSoftkeyExit:
+            GSDocument().WatchDog()->ReportCleanExitL();
+            Exit();
+            break;
+        default:
+            break;
+        }
+    }
+
+
+// ----------------------------------------------------
+// CGSUi::HandleResourceChangeL()
+//
+//
+// ----------------------------------------------------
+//
+void CGSUi::HandleResourceChangeL( TInt aType )
+    {
+    CAknViewAppUi::HandleResourceChangeL( aType );
+    }
+
+
+// ----------------------------------------------------
+// CGSUi::HandleKeyEventL()
+//
+//
+// ----------------------------------------------------
+TKeyResponse CGSUi::HandleKeyEventL( const TKeyEvent& aKeyEvent,
+                                     TEventCode aType )
+    {
+    __GSLOGSTRING1( "[CGSUi] HandleKeyEventL(code:%d)", aKeyEvent.iCode );
+
+    CAknNavigationControlContainer* naviContainer =
+        static_cast<CAknNavigationControlContainer*>
+        ( StatusPane()->ControlL( TUid::Uid(EEikStatusPaneUidNavi ) ) );
+
+    TKeyResponse response = EKeyWasNotConsumed;
+
+    if( naviContainer )
+        {
+        CAknNavigationDecorator* naviDec = naviContainer->Top();
+        if( naviDec )
+            {
+            CCoeControl* decControl = naviDec->DecoratedControl();
+            if( decControl)
+                {
+                response = decControl->OfferKeyEventL( aKeyEvent, aType );
+                }
+            }
+        }
+
+    return response;
+    }
+
+
+// ----------------------------------------------------
+// CGSUi::PhoneIdle()
+//
+//
+// ----------------------------------------------------
+//
+void CGSUi::PhoneIdle()
+    {
+    TRAP_IGNORE( CreateActivateViewEventL( TVwsViewId( TUid::Uid( KGSPhoneAppID ),
+        TUid::Uid( KGSPhoneAppID ) ), KNullUid, KNullDesC8() ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSUi::EmbedAppL()
+//
+// Launches application as embedded.
+// ---------------------------------------------------------------------------
+//
+void CGSUi::EmbedAppL( const TAppInfo& aApp )
+    {
+    if ( iEmbedded )
+        {
+        iEikonEnv->Process()->DestroyDocument( iEmbedded );
+        iEmbedded = NULL;
+        }
+    CAknLocalScreenClearer* clearer = CAknLocalScreenClearer::NewLC();
+    CEikProcess* process = iEikonEnv->Process();
+    TApaApplicationFactory apaAppFactory( aApp.iUid );
+    iEmbedded = process->AddNewDocumentL( apaAppFactory );
+    TApaDocCleanupItem cleanup( process, iEmbedded );
+    CleanupStack::PushL( cleanup );
+    iEmbedded->NewDocumentL();
+    CleanupStack::Pop();
+    iEmbedded->EditL( NULL );
+    CleanupStack::PopAndDestroy( clearer );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSUi::Document()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSDocument& CGSUi::GSDocument() const
+    {
+    CGSDocument* doc = static_cast< CGSDocument* >( Document() );
+    return *doc;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSUi::ShowNoteGsNotOpenedDuringBackupRestoreL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSUi::ShowNoteGsNotOpenedDuringBackupRestoreL()
+    {
+    HBufC* prompt =
+     StringLoader::LoadL( R_CONFIRM_NOTE_GS_EXIT_BACKUP_RESTORE_STRING );
+    CleanupStack::PushL( prompt );
+    CAknInformationNote* note =
+                new( ELeave ) CAknInformationNote( ETrue );
+    note->ExecuteLD( *prompt );
+    CleanupStack::PopAndDestroy( prompt );
+    GSDocument().WatchDog()->ReportCleanExitL();
+    Exit();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSUi::HandleMessageL
+// Handles messages sent from gslauncher
+//
+// ---------------------------------------------------------------------------
+//
+MCoeMessageObserver::TMessageResponse CGSUi::HandleMessageL(
+    TUint32 /*aClientHandleOfTargetWindowGroup*/,
+    TUid /*aMessageUid*/,
+    const TDesC8 &aMessageParameters )
+  {
+  const TUint8* ptr = aMessageParameters.Ptr();
+  __GSLOGSTRING1( "[CGSUi::HandleMessageL] aMessageParameters: %S", &aMessageParameters );
+
+  FindAndKillEmbeddedAppL();
+
+  TUid viewUid;
+  TUid uid2;
+
+  RDesReadStream str;
+  str.Open(aMessageParameters);
+  str >> viewUid;
+  str >> uid2;
+  HBufC8* msg8 = HBufC8::NewLC(str, 1024);
+  str.Close();
+
+  __GSLOGSTRING1( "[CGSUi::HandleMessageL] Launching  view 0x%x ", viewUid.iUid );
+  TVwsViewId id( KUidGS , viewUid );
+  if ( !View(viewUid) )
+	  {
+	  GSDocument().CreateShimmedViewL(viewUid);
+	  }
+  ActivateViewL( id, uid2, *msg8 );
+  CleanupStack::PopAndDestroy( msg8 );
+  return MCoeMessageObserver::EMessageNotHandled;
+  }
+
+
+// ---------------------------------------------------------------------------
+// CGSUi::FindAndKillEmbeddedAppL()
+// Find possiple child app of GS, and kill it.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSUi::FindAndKillEmbeddedAppL()
+    {
+    RWsSession ws  = CEikonEnv::Static()->WsSession();
+    TApaTaskList taskList( ws );
+    TApaTask gstask = taskList.FindApp( KUidGS  ); // Find GS
+
+    if ( gstask.Exists() ) // Task should exist
+        {
+        TInt gswgid = gstask.WgId();
+        RArray<RWsSession::TWindowGroupChainInfo> wgrp;
+        ws.WindowGroupList( &wgrp );
+        TInt i = 0;
+
+        // Loop window groups, find GS's child app
+        for ( i=0; i < wgrp.Count() ; ++i )
+            {
+            TBuf<100> name;
+            ws.GetWindowGroupNameFromIdentifier( wgrp[i].iId , name );
+            RWsSession::TWindowGroupChainInfo wginfo = wgrp[i];
+            __GSLOGSTRING3( "[CGSUi] wginfo %d (%d) '%S'",  wginfo.iId, wginfo.iParentId, &( name.Left( 20 ) )  );
+            if ( wginfo.iParentId == gswgid ) // Child of GS found
+                {
+                CApaWindowGroupName* windowName1 = CApaWindowGroupName::NewLC( ws, wginfo.iId );
+                TUid embeddeeuid;
+                embeddeeuid = windowName1->AppUid();
+                TApaTask embeddee = taskList.FindApp( embeddeeuid );
+
+                // Kill the child app
+                if ( embeddee.Exists() )
+                    {
+                    __GSLOGSTRING2( "[CGSUi] Embeddee: 0x%x  Embeddee thread=0x%x",
+                                    embeddeeuid.iUid,
+                                    embeddee.ThreadId() );
+                    embeddee.KillTask();
+                    }
+                CleanupStack::PopAndDestroy( windowName1 );  //windowName1
+                }
+            }
+        wgrp.Close();
+        }
+    return KErrNone;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CGSUi::HandleEComEvent( TEComEvent aEvent )
+    {
+    /**
+     * Quietly close GS if GS-plugin is uninstalled. This is a precaution for
+     * scenario where GS-plugin is uninstalled and GS tries to access the
+     * plugin even though plugin's resources do not exist anymore.
+     *
+     * More sophisticated solution would have been to update whole GS plugin
+     * structure but this would have been overkill for this very rare use
+     * scenario and rather impossible due to BC requirements.
+     */
+    __GSLOGSTRING1( "[CGSUi::HandleEComEvent] aEvent:%d", aEvent );
+
+    switch( aEvent )
+        {
+        case MGSEComObserver::EPluginRemoved:
+            __GSLOGSTRING( "[CGSUi::HandleAppListEvent] Closing GS..." );
+            TRAP_IGNORE( GSDocument().WatchDog()->ReportCleanExitL() );
+            Exit();
+            break;
+        default:
+            break;
+        }
+
+    }
+
+
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information required for building GSApplication.
+*
+*/
+
+
+#include <platform_paths.hrh>
+    
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../rom/GSApp.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsapp.iby )
+../rom/GSAppResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsappresources.iby )
+../Data/backup_registration.xml  z:/private/100058ec/backup_registration.xml
+../rom/GsResources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsresources.iby )
+loc/GSApp.loc MW_LAYER_LOC_EXPORT_PATH( gsapp.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsapp_aif.mif
+  OPTION SOURCES -c8,8 qgn_menu_set
+END
+
+PRJ_MMPFILES
+
+GSApplication.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSApplication_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSApplication/loc/GSApp.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*		Localization strings for GS Application
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+
+//d:Text in title pane
+//d:Main view
+//l:title_pane_t2/opt9
+// 
+#define qtn_set_title_settings "General settings"
+
+//d:Text in title pane
+//d:Main view
+//l:title_pane_t2/opt9
+// 
+#define qtn_cp_title_control_panel "Control Panel"
+
+//d:Command in Options list
+//d:Opens the highlighted item
+//l:list_single_pane_t1_cp2
+//
+#define qtn_set_options_open "Open"
+
+//d:Application title for aif caption file
+//d:Long string
+//l:list_single_large_graphic_pane_t1
+//
+#define qtn_apps_settings_list "General settings"
+
+//d:Application title for aif caption file
+//d:Short string
+//l:cell_app_pane_t1
+//
+#define qtn_apps_settings_grid "Settings"
+
+//d:Application title for aif caption file
+//d:Long string
+//l:list_single_large_graphic_pane_t1
+//
+#define qtn_apps_controlpanel_list "Control Panel"
+
+//d:Application title for aif caption file
+//d:Short string
+//l:cell_app_pane_t1
+//
+#define qtn_apps_controlpanel_grid "Control Panel"
+
+//d:Text of a list item in Network setting list view's list
+//d: Confirmation for Network mode selection operation.
+//l: popup_note_window
+//w:
+//r: 3.1
+#define qtn_set_error_open_during_backuprestore "General Settings cannot be opened during backup/restore"
+
+//d:Text of a list item in Network setting list view's list
+//d: Confirmation for Network mode selection operation.
+//l: popup_note_window
+//w:
+//r: 5.0
+#define qtn_cp_error_open_during_backuprestore "Control Panel cannot be opened during backup/restore"
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/GSAppsPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        This is project specification file for GS AppsPlugin.
+*
+*/
+
+#include <data_caging_paths.hrh>    //this is needed for RESOURCE_FILES_DIR
+#include "../Logger/GsLoggingConfiguration.h"
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsappsplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x1020723A
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSAppsPluginImplementationTable.cpp
+SOURCE              GSAppsPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         loc
+USERINCLUDE         ../Logger
+USERINCLUDE         ../Data
+
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+//ECOM resource definition
+START RESOURCE      1020723A.rss
+TARGET              gsappsplugin.rsc
+END //  ECOM resource definition
+
+//View resources
+START RESOURCE      GSAppsPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // AppsPlugin resources
+
+
+LIBRARY             euser.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib 
+LIBRARY             cone.lib 
+LIBRARY             eikcoctl.lib 
+LIBRARY             eikcore.lib 
+LIBRARY             commonengine.lib//For RConeResourceLoader
+LIBRARY             gsframework.lib
+LIBRARY             egul.lib // CGulIcon
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             flogger.lib
+LIBRARY             gsecomplugin.lib
+LIBRARY             featmgr.lib  // feature manager
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+DOCUMENT 1020723A.rss
+DOCUMENT GSAppsPluginRsc.rss
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSAppsPlugin.
+*
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSAppsPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsappsplugin.iby )
+../rom/GSAppsPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsappspluginresources.iby )
+loc/GSAppsPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsappsplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsappsplugin.mif
+  OPTION HEADERFILE gsappsplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_apps_sub -c8,8 qgn_prop_set_apps_tab4
+END
+
+
+PRJ_MMPFILES
+GSAppsPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GS_Data /s /q
+rd GSAppsPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/data/1020723A.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        ECOM plugin resource file for Applications plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x1020723A;
+    interfaces  = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x10207239;
+                    version_no          = 1;
+                    display_name        = "Applications Plugin";
+                    #ifdef RD_CONTROL_PANEL
+                        default_data        = "0x1020723B";//Parent UID
+                        opaque_data         = "60";//Order number
+                    #else //RD_CONTROL_PANEL
+                        default_data        = "0x1020723B";//Parent UID
+                        opaque_data         = "3";//Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/data/GSAppsPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource GSAppsPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    GSAP // 4 letter ID
+
+//  INCLUDES
+#include    <gsappsplugin.loc>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_applications_view
+//    Applications view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_applications_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_apps_view_title
+//    Application view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_apps_view_title
+    {
+    #ifdef RD_CONTROL_PANEL
+        txt = qtn_cp_title_application_settings;
+    #else //RD_CONTROL_PANEL
+        txt = qtn_set_title_settings_applications;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+//----------------------------------------------------
+//  r_gs_apps_view_caption
+//
+// Applications view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_apps_view_caption
+    {
+    #ifdef RD_CONTROL_PANEL
+        buf = qtn_cp_folder_application_settings;
+    #else //RD_CONTROL_PANEL
+        buf = qtn_set_folder_applications;
+    #endif //RD_CONTROL_PANEL
+    }
+
+// ******  PDATA RESOURCES END     ******
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/inc/GSAppsPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAppsPlugin header file.
+*
+*/
+
+
+#ifndef GSAPPSPLUGIN_H
+#define GSAPPSPLUGIN_H
+
+// Includes
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+#include <aknview.h>
+#include <eikclb.h>
+#include <eikmenup.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+class CGSTabHelper;
+
+// Constants
+_LIT( KGSAppsPluginResourceFileName, "z:GSAppsPluginRsc.rsc" );
+_LIT( KGSAppsPluginIconDirAndName, "z:gsappsplugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+*  Applications Plugin. Displays plugins owned by applications view.
+*
+*  @since Series60_3.1
+*/
+class CGSAppsPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSAppsPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSAppsPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+        
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSAppsPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+
+        // Tab helper.
+        CGSTabHelper* iTabHelper;
+    };
+
+
+#endif // GSAPPSPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/loc/GSAppsPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSAppsPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+
+//d:Text in title pane
+//d:Application plugin
+//l:title_pane_t2/opt9
+//w:
+//r:3.1
+//
+#define qtn_set_title_settings_applications "Applications"
+
+//d:Command in Options list
+//d:Opens the highlighted item
+//l:list_single_pane_t1_cp2
+//w:
+//r:3.1
+//
+#define qtn_set_options_open "Open"
+ 
+
+//d:Text of a list item in main view list
+//d:Item opens Applications folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_folder_applications "Applications"
+
+
+//CONTROL PANEL
+
+//d:Text in title pane
+//d:Application plugin
+//l:title_pane_t2/opt9
+//w:
+//r:5.0
+//
+#define qtn_cp_title_application_settings "Application settings"
+
+//d:Text of a list item in main view list
+//d:Item opens Applications folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 5.0
+#define qtn_cp_folder_application_settings "Application settings"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAppsPlugin source code.
+*
+*/
+
+
+// Includes
+#include "GSAppsPlugin.h"
+#include "GsLogger.h"
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <GSAppsPluginRsc.rsg>
+#include <gsfwviewuids.h>
+#include <gsmainview.h>
+#include <gsprivatepluginproviderids.h>
+#include <StringLoader.h>
+#include <barsread.h> // For TResourceReader
+#include <gsappsplugin.mbg> // Icons
+#include <csxhelp/cp.hlp.hrh>
+#include <featmgr.h>
+
+#ifndef RD_CONTROL_PANEL
+    #include <GSTabHelper.h>
+    #include <GSTabbedViewOwner.h>
+#endif //RD_CONTROL_PANEL
+
+// Constants
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSAppsPlugin::CGSAppsPlugin()
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSAppsPlugin::CGSAppsPlugin()
+    : CGSParentPlugin(), iResources( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSAppsPlugin] CGSAppsPlugin()" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAppsPlugin::~CGSAppsPlugin()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSAppsPlugin::~CGSAppsPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    iResources.Close();
+    
+    #ifndef RD_CONTROL_PANEL
+        delete iTabHelper;
+    #endif //RD_CONTROL_PANEL
+    
+    __GSLOGSTRING( "[CGSAppsPlugin] ~CGSAppsPlugin()" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAppsPlugin::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAppsPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    OpenLocalizedResourceFileL( KGSAppsPluginResourceFileName, iResources );
+    
+    // Do not load content of this view untill/unless this view is activated.
+    // This will save memory as well as optimize loading performance for other 
+    // plugins.
+    TBitFlags flags;
+    flags.Set( EGSLoadChildrenOnActivation );
+    SetOptionFlags( flags );
+    
+    BaseConstructL( R_GS_APPLICATIONS_VIEW, R_GS_APPS_VIEW_TITLE );
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper = CGSTabHelper::NewL();
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAppsPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSAppsPlugin* CGSAppsPlugin::NewL( TAny* /*aInitParams*/ )
+	{
+	CGSAppsPlugin* self = new(ELeave) CGSAppsPlugin();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::Id()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSAppsPlugin::Id() const
+    {
+    return KGSAppsPluginUid;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::DoActivateL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSAppsPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                 TUid aCustomMessageId,
+                                 const TDesC8& aCustomMessage )
+    {
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+
+    // Create tab group for this view (do only if casting succeeds):
+    #ifndef RD_CONTROL_PANEL
+        if( parent )
+            {
+            iTabHelper->CreateTabGroupL( Id(), parent );
+            }
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::DoDeactivate()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSAppsPlugin::DoDeactivate()
+    {
+    CGSParentPlugin::DoDeactivate();
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper->RemoveTabGroup();
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::UpperLevelViewUid()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSAppsPlugin::UpperLevelViewUid()
+    {
+    return KGSMainViewUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::GetCaptionL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSAppsPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // The resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_APPS_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::PluginProviderCategory()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSAppsPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSAppsPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_APPILICATION_SETTINGS;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAppsPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSAppsPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSAppsPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetAppsSub,
+        fp->FullName(),
+        EMbmGsappspluginQgn_prop_set_apps_sub,
+        EMbmGsappspluginQgn_prop_set_apps_sub_mask );
+        }
+    else if( aIconType == KGSIconTypeTab )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetAppsTab4,
+        fp->FullName(),
+        EMbmGsappspluginQgn_prop_set_apps_tab4,
+        EMbmGsappspluginQgn_prop_set_apps_tab4_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSAppsPlugin::DynInitMenuPaneL()
+// 
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSAppsPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                      CEikMenuPane* aMenuPane )
+    {
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSAppsPlugin.h"
+
+// Constants
+const TImplementationProxy KAppsPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10207239,	CGSAppsPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KAppsPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KAppsPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/200110f0.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Automatic Keyguard plugin.
+*
+*/
+
+// INCLUDES
+#include <ecom/registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x200110f0;
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x20011143;
+					version_no          = 1;
+					display_name        = "Automatic Keyguard Plugin"; //Debug name
+					default_data        = "0x10283317"; //Parent plugin Implementation UID (Device Management)
+					opaque_data         = "5";//Order number
+					}
+				};
+			}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/GSAutoKeyguardPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,392 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for General Settings
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    AKGP // 4 letter ID
+
+//  INCLUDES
+#include <gsautokeyguardplugin.loc>
+#include "GSAutoKeyguardPlugin.hrh"
+
+#include <avkon.loc> // Avkon localized strings
+#include <avkon.mbg>
+#include <avkon.rsg>
+#include <eikcore.rsg>
+#include <uikon.rh>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//  r_gs_auto_keyguard_view_caption
+// 
+// Autokeyguard view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_auto_keyguard_view_caption
+    {
+    buf = qtn_set_auto_keyguard_title;
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_gs_sim_security_view_title
+//    Security view title
+//
+//----------------------------------------------------
+//
+
+RESOURCE TITLE_PANE r_gs_auto_keyguard_view_title
+    {
+    txt = qtn_set_auto_keyguard_title;        
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_sim_security_softkeys_options_back__change
+//    SIM security view's CBA resource
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_auto_keyguard_softkeys_options_back__change
+    {
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyBack; txt = text_softkey_back; },
+        CBA_BUTTON {id=EAknSoftkeyChange; txt= qtn_msk_change; }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_sim_security_view
+//    SIM security view's menu
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_auto_keyguard_view
+    {
+    menubar = r_gs_auto_keyguard_menubar_change_exit;  
+    cba = r_gs_auto_keyguard_softkeys_options_back__change;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menubar_change_exit
+// GS menu with 'change' and 'exit' items.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_gs_auto_keyguard_menubar_change_exit
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_gs_auto_keyguard_menu_item_exit;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_auto_keyguard_menu_item_help;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_auto_keyguard_menu_item_change;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_exit
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_auto_keyguard_menu_item_exit
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_change
+// Change item.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_auto_keyguard_menu_item_change
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EGSCmdAppChange;
+            txt = qtn_options_change;
+            flags = EEikMenuItemAction; // action command
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_menu_item_help
+// Change item.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_auto_keyguard_menu_item_help
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknCmdHelp;
+            txt = qtn_options_help;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_auto_keyguard_lbx
+//    SIM security view's list box items
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_auto_keyguard_lbx
+    {
+    items =
+        {       
+	GS_FEATURE
+            {
+            txt = " \t"qtn_set_auto_keyguard"\t\t";
+            item = EGSSettIdAutoKeyguard;
+	    type = EGSListBoxItemTypeIsDynamic;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_auto_keyguard_lbx
+//    Autokeyguard's listbox item when Touch UI supported
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_touch_auto_keyguard_lbx
+    {
+    items =
+        {       
+	GS_FEATURE
+            {
+            txt = " \t"qtn_set_auto_display_lock"\t\t";
+            item = EGSSettIdAutoKeyguard;
+	    type = EGSListBoxItemTypeIsDynamic;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_autokeyguard_array
+//    Autokeyguard array items
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_autokeyguard_array
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_auto_keyguard_none;
+            },
+	LBUF
+            {
+            txt = qtn_set_auto_keyguard_sec;
+            },
+        LBUF
+            {
+            txt = qtn_set_auto_keyguard_one_min;
+            },
+	LBUF
+            {
+            txt = qtn_set_auto_keyguard_min;
+            }
+       
+        };    
+    }
+//----------------------------------------------------
+//   
+//    r_autokeyguard_setting_page
+//    Autokeyguard setting page for the radio button dialog
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_autokeyguard_setting_page
+    { 
+    label= qtn_set_auto_keyguard;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type =  EAknSetListBox;
+    editor_resource_id= r_autokeyguard_listbox;
+    }
+
+//----------------------------------------------------
+//   
+//    r_autokeyguard_listbox
+//    Autokeyguard listbox
+//
+//----------------------------------------------------
+//
+RESOURCE LISTBOX r_autokeyguard_listbox
+    {
+    array_id = r_autokeyguard_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+
+//----------------------------------------------------
+//   
+//    r_autokeyguard_lbx
+//    Autolock array items
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_autokeyguard_lbx
+        {
+        items =
+            {
+            LBUF
+                {//autokeyguard off
+                txt = qtn_set_auto_keyguard_none;
+                },
+            LBUF
+                {//user defined
+                txt = qtn_set_auto_keyguard_userdefined;
+                }
+            };      
+    }
+
+//----------------------------------------------------
+//  r_auto_keyguard_minsec
+// 
+// Autokeyguard resource string for minutes and seconds
+//----------------------------------------------------
+//
+RESOURCE TBUF r_auto_keyguard_minsec
+    {
+    buf = qtn_set_auto_keyguard_minsec;
+    }
+
+//----------------------------------------------------
+//  r_auto_keyguard_one_min_sec
+// 
+// Autokeyguard resource string for minutes and seconds
+//----------------------------------------------------
+//
+RESOURCE TBUF r_auto_keyguard_one_min_sec
+    {
+    buf = qtn_set_auto_keyguard_one_min_sec;
+    }
+
+//----------------------------------------------------
+//   
+//    r_autokeyguard_time_setting_query
+//    Autokeyguard period query
+//
+//----------------------------------------------------
+//  
+RESOURCE DIALOG r_autokeyguard_time_setting_query
+    {
+    flags=EGeneralQueryFlags;
+    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                { 
+                    layout = ETimeLayout;
+                    label = qtn_set_auto_keyguard_query;
+                    control = TIME_EDITOR
+                    {
+                    minTime= TIME {second=5;minute=0;hour=0;};
+                    maxTime= TIME {second=59;minute=59;};
+                    flags= EEikTimeWithoutHoursField | EEikTimeForce24HourFormat;
+                    };  
+                };
+            }
+        };
+
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_autokeyguard_touch_time_setting_query
+//    Autokeyguard period query
+//
+//----------------------------------------------------
+//  
+RESOURCE DIALOG r_autokeyguard_touch_time_setting_query
+    {
+    flags=EGeneralQueryFlags;
+    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                { 
+                    layout = ETimeLayout;
+                    label = qtn_set_auto_display_lock_query;
+                    control = TIME_EDITOR
+                    {
+                    minTime= TIME {second=5;minute=0;hour=0;};
+                    maxTime= TIME {second=59;minute=59;};
+                    flags= EEikTimeWithoutHoursField | EEikTimeForce24HourFormat;
+                    };  
+                };
+            }
+        };
+
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/GSAutoKeyguardPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file.
+*
+*/
+
+#include <platform_paths.hrh>
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsautokeyguardplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x200110f0
+VENDORID            VID_DEFAULT
+
+
+SOURCEPATH  Src
+SOURCE   GSAutoKeyguardPluginImplementationTable.cpp
+SOURCE   GSAutoKeyguardPlugin.cpp
+SOURCE   GSAutoKeyguardPluginContainer.cpp
+SOURCE   GSAutoKeyguardPluginModel.cpp
+SOURCE   GSPubSubsListener.cpp
+SOURCE   GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp
+SOURCE   GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp
+
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+
+USERINCLUDE     ../Data
+
+//System include paths
+APP_LAYER_SYSTEMINCLUDE
+
+
+SOURCEPATH      Data
+
+START RESOURCE  200110f0.rss
+TARGET          gsautokeyguardplugin.rsc
+END
+
+START RESOURCE  GSAutoKeyguardPluginRsc.rss
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib 
+LIBRARY   cone.lib 
+LIBRARY   eikcoctl.lib 
+LIBRARY   eikcore.lib 
+LIBRARY   egul.lib
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   flogger.lib           // File logging
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager 
+LIBRARY   centralrepository.lib
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   secui.lib             // security
+LIBRARY   etelmm.lib            // security
+LIBRARY   sssettings.lib        // ss settings
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsecomplugin.lib
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Device & SIM security plug-in.
+*
+*/
+
+
+#ifndef GSAUTOKEYGUARDPLUGIN_H
+#define GSAUTOKEYGUARDPLUGIN_H
+
+// INCLUDES
+#include "GSAutoKeyguardPluginContainer.h"
+#include "GSAutoKeyguardPluginModel.h"
+#include "MGSSettingPSObserver.h"
+#include "GSPubSubsListener.h"
+
+#include <aknsettingpage.h>
+#include <ConeResLoader.h>
+#include <gsplugininterface.h>
+#include <gsfwviewuids.h>
+#include <gsbaseview.h>
+#include <SecUiSecuritySettings.h>
+#include <RSSSettings.h>
+
+// CONSTANTS
+const TInt KMaxStringLength = 80;
+const TUid KGSAutoKeyguardPluginUid = { 0x200110f0 };
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CAknViewAppUi;
+class CGSAutoKeyguardPluginContainer;
+
+
+// CLASS DECLARATION
+
+/**
+*  CGSAutoKeyguardPlugin view class
+*
+*  View class for Sim Security sub-folder
+*/
+class CGSAutoKeyguardPlugin : public CGSBaseView,
+                        private MGSSettingPSObserver
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS sim & device security view.
+        */
+        static CGSAutoKeyguardPlugin* NewL( TAny* aInitParams );
+        
+        /**
+        * C++ default constructor.
+        */
+        CGSAutoKeyguardPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CGSAutoKeyguardPlugin();
+
+    public: // Functions from base classes
+        
+       /**
+        * Returns view id.
+        * @return TUid.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles commands.
+        * @param aCommand Command to be handled.
+        * 
+        */
+        void HandleCommandL( TInt aCommand );
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aItemId An item which is updated.
+        * 
+        */
+        void UpdateListBoxL( TInt aItemId );
+        
+        //From CGSBaseView
+        void HandleResourceChangeL( TInt aType );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    private: // from CAknView
+        /**
+        * Activates the view.
+        * @param aPrevViewId ID of previous view
+        * @param aCustomMessageId customized message ID
+        * @param aCustomMessage sutomized message payload
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+    private: // from CGSBaseView
+       
+        void NewContainerL();
+       
+        /**
+        * From CGSBaseView, handles list box selections.
+        * 
+        */
+        void HandleListBoxSelectionL();
+ 
+    private:
+        /**
+        * Callback from MGSSettingPSObserver
+        */
+        void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
+                                      const TRequestStatus& aStatus );
+      
+    private: //new
+    	/**
+        * Sets Autokeyguard period
+        * 
+        */
+        void SetAutoKeyguardTimeL( TInt aPeriod, TInt aMaxPeriod );
+
+        /**
+        * Get CGSAutoKeyguardPlugin's ccontainer.
+        */
+        CGSAutoKeyguardPluginContainer* Container();
+        
+    private: // Data
+        //plugin model.
+        CGSAutoKeyguardPluginModel* iModel;
+        //resource loader
+        RConeResourceLoader iResourceLoader;
+        //PubSub object for BT SAP state
+        CGSPubSubsListener* iBtSapListener;
+
+    };
+
+#endif //GSAUTOKEYGUARDPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002 - 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  contains common definitions for menu id:s
+*
+*/
+
+
+#ifndef GSAUTOKEYGUARDPLUGIN_HRH
+#define GSAUTOKEYGUARDPLUGIN_HRH
+
+// Data query max length
+#define KGSMaxDataLength 21
+
+enum TAutoKeyguardMenuCommands
+    {
+    EGSCmdAppOpen = 1,
+    EGSCmdAppHelp,
+    EGSCmdAppChange,
+    EAppCmdChange
+    };
+
+
+// Automatic Keyguard
+enum
+    {
+    EGSSettIdAutoKeyguard
+    };
+
+enum TGSListBoxItemVisibility
+    {
+    EGSListBoxItemTypeIsAlwaysVisible = 0,
+    EGSListBoxItemTypeIsDynamic
+    };
+#endif  //GSAUTOKEYGUARDPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardSettingPage.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*		Autokeyguard period settingpage     
+*
+*
+*/
+
+
+#ifndef     __CAUTOKEYGUARDSETTINGPAGE_H
+#define     __CAUTOKEYGUARDSETTINGPAGE_H
+
+#include    <aknradiobuttonsettingpage.h>
+#include    <eikmobs.h>
+
+class CAutoKeyguardSettingPage : public CAknRadioButtonSettingPage
+	{
+	public:
+		/**
+		* C++ default constructor.
+		*/
+		CAutoKeyguardSettingPage(TInt aResourceId, TInt& aCurrentSelectionItem, CDesCArrayFlat* aItemArray, TTime* aAutoKeyguardValue, TTime aMaxPeriod);
+		/**
+		* Symbian OS constructor.
+		*/
+		void ConstructL();
+	protected:
+		/**
+		* Process ui commands
+		* from CAknRadioButtonSettingPage
+		* @param aCommandId TInt 
+		*/
+		void ProcessCommandL(TInt aCommandId);
+		
+		/** 
+		 * From CAknRadioButtonSettingPage
+		 * @param	listbox generating the event
+		 * @param	type of listbox event
+		 */
+		void HandleListBoxEventL(CEikListBox* aListBox,
+				MEikListBoxObserver::TListBoxEvent aEventType);
+	private:
+		/** 
+		 * Handle GSAutoKeyguard settings
+		 */
+		void ExecuteAutoKeyguardSettingsL();
+		
+	private: // data
+		CEikButtonGroupContainer* iPopoutCba;
+		//Not owned!
+		TTime* iAutoKeyguardValue;
+		TTime iMaxPeriod;
+	};
+
+#endif // CAUTOKEYGUARDSETTINGPAGE_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardTimeQuery.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Time query for setting Autokeyguard period.
+*           
+*           
+*          
+*
+*/
+
+
+#ifndef AUTOKEYGUARDTIMEQUERYDIALOG_H
+#define AUTOKEYGUARDTIMEQUERYDIALOG_H
+
+// INCLUDES
+#include <AknQueryDialog.h>       //used for Time and Date query
+
+//  FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* CAutoKeyguardTimeQuery class.
+*/
+class CAutoKeyguardTimeQuery : public CAknTimeQueryDialog
+    {
+    public://construction and destruction
+        /**
+         * C++ Constructor.
+         */
+        CAutoKeyguardTimeQuery(TTime& aTime,const TTone aTone = ENoTone);
+        
+        /**
+         * C++ Destructor.
+         */
+        virtual ~CAutoKeyguardTimeQuery();
+        
+    public:// from CCoeControl
+
+        /**
+        * From CCoeControl  Handle key events. When a key event occurs, 
+        *                   CONE calls this function for each control on the control stack, 
+        *                   until one of them returns EKeyWasConsumed to indicate that it processed the key event.  
+        * @param aKeyEvent  The key event.
+        * @param aType      The type of the event: EEventKey, EEventKeyUp or EEventKeyDown.
+        * @return           Indicates whether or not the key event was used by this control.
+        */
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+    public://from MAknQueryControlObeserver
+
+		/**
+		* Called by OfferkeyEventL(), gives a change to dismiss the query with
+		* send/answer key.
+		*/
+		virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
+		
+		/**
+		* Called by NeedToDismissQueryL(), gives a change to either accept or reject
+		* the query. Default implementation is to accept the query if the Left soft
+		* key is displayed and reject it otherwise. Left softkey is only displayed if
+		* the query has valid data into it.
+		*/
+		virtual void DismissQueryL();
+
+        /**
+        * Returns whether the left softkey is visible
+        * @return ETrue is the left softkey is visible
+        */
+        TBool IsLeftSoftkeyVisible();
+    private: //data
+        TInt iMaximumValue;
+    };
+
+#endif // AUTOKEYGUARDTIMEQUERYDIALOG_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Display sub-folder
+*
+*/
+
+
+
+#ifndef GSAUTOKEYGUARDCONTAINER_H
+#define GSAUTOKEYGUARDCONTAINER_H
+
+// INCLUDES
+#include <bldvariant.hrh>
+#include <e32property.h>
+
+#include <gsbasecontainer.h>
+
+
+// FORWARD DECLARATION
+class CGSListBoxItemTextArray;
+class CGSAutoKeyguardPluginModel;
+
+// CLASS DECLARATION
+
+/**
+*  CGSAutoKeyguardPluginContainer container class
+*
+*  Container class for SIM security view
+*  @lib GSAutoKeyguardPlugin.lib
+*  @since Series 60_3.1
+*/
+class CGSAutoKeyguardPluginContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS constructor.
+        * @param aRect Listbox's rect.
+        * 
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CGSAutoKeyguardPluginContainer();
+        
+        /**
+        * Constructor
+        */
+        CGSAutoKeyguardPluginContainer( CGSAutoKeyguardPluginModel* aModel );
+
+   public: // new
+        /**
+        * Updates the listbox items
+        * @param aFeatureId: selected listbox item ID
+        */
+        void UpdateListBoxL( TInt aFeatureId );
+		
+        /**
+        * Retrieves the feature id for the selected item in the listbox
+        * @return listbox item array's current feature.
+        */
+        TInt CurrentFeatureId() const;
+        
+        void HandleResourceChangeL( TInt aType );
+
+   protected: // from CGSBaseContainer
+       /**
+        * Constructs listbox.
+        * @param aResLbxId Resource id for listbox.
+        * 
+        */
+       void ConstructListBoxL( TInt aResLbxId );
+
+   private: //new
+        /**
+        * Creates list box items
+        */   
+        void CreateListBoxItemsL();
+        /**
+        * Creates autokeyguard list box item
+        */
+        void MakeAutoKeyguardItemL();
+    private:
+        /**
+        * Required for help.
+        * 
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+   
+	private: //data
+        //items from resource 
+        CDesCArray* iItemArray;
+        //GS listbox model
+		CGSListBoxItemTextArray* iListboxItemArray;
+        //Model pointer. Does not own it, so do not delete this pointer.
+        CGSAutoKeyguardPluginModel* iModel;
+        //Automatic Keyguard item's text
+        CDesCArrayFlat* iAutoKeyguardItems;
+
+    };
+
+#endif //GSAUTOKEYGUARDCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for Device & SIM security plug-in.
+*
+*/
+
+
+#ifndef GSAUTOKEYGUARDPLUGINMODEL_H
+#define GSAUTOKEYGUARDPLUGINMODEL_H
+
+// INCLUDES
+#include <e32base.h>
+#include <centralrepository.h>
+
+// CONSTANTS
+const TInt KGSBufSize128 = 128;
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DEFINITION
+/**
+*  CGSAutoKeyguardPluginModel is the model class of device & sim security plugin.
+*  It provides functions to get and set setting values.
+*  @lib GSAutoKeyguardPlugin.lib
+*  @since Series 60_5.0
+
+*/
+class CGSAutoKeyguardPluginModel : public CBase
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CGSAutoKeyguardPluginModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSAutoKeyguardPluginModel();
+        
+    public:
+        /**
+        * Returns the autokeyguard period time (minutes). 
+        *
+        * @return TInt: period
+        */
+        TInt AutoKeyguardPeriod();
+        /**
+        * Returns the autokeyguard maximum period time (minutes). 
+        *
+        * @return TInt: period
+        */
+        TInt AutoKeyguardMaxPeriod();
+        /**
+        * Sets the autokeyguard period. After this period the keyguard is activated.
+        * @param aNewPeriod TInt (minutes)
+        *
+        * @return ETrue: no errors
+        *         EFalse: an error has occurred
+        */
+        TBool SetAutoKeyguardPeriod(const TInt newPeriod);
+
+    private: // Private constructors
+        /**
+        * Default C++ contructor
+        */
+        CGSAutoKeyguardPluginModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+        
+    private: // data
+        CRepository* iSecurityRepository;
+    
+    };
+
+
+#endif //GSAUTOKEYGUARDPLUGINMODEL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSPubSubsListener.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Listener for Publish and subscribe data.
+*
+*/
+
+
+#ifndef GSPUBSUBSLISTENER_H
+#define GSPUBSUBSLISTENER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class MGSSettingPSObserver;
+
+// CLASS DECLARATION
+
+/**
+*  RProperty poller.
+*
+*  @lib gs.lib
+*  @since Series 60 3.0
+*/
+NONSHARABLE_CLASS( CGSPubSubsListener ) : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aUid the Uid to use
+        * @param aKey item's key
+        * @param aObserver callback interface for notification
+        * @return instance of CGSPubSubsListener
+        */
+        static CGSPubSubsListener* NewL( const TUid aUid, const TInt aKey, 
+                                         MGSSettingPSObserver* aObserver );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CGSPubSubsListener();
+        
+    public: // New functions.
+
+        /**
+        * Gets integer value from P & S.
+        * @param aVal a value in return
+        * @return error code
+        */       
+        TInt Get( TInt& aVal );
+
+        /**
+        * Gets 8 bit string value from P&S.
+        * @param aVal a value in return
+        * @return error code
+        */
+        TInt Get( TDes8& aVal );
+        
+        /**
+        * Gets 16 bit descriptor value from P&S.
+        * @param aVal a value in return
+        * @return error code
+        */
+        TInt Get( TDes16& aVal );
+        
+    private: // From CActive.
+
+        /** @see CActive::RunL */
+        virtual void RunL();
+
+        /** @see CActive::Cancel */
+        virtual void DoCancel();
+
+        /** @see CActive::RunError */
+        virtual TInt RunError( TInt aError );
+
+        /**
+        * Starts the listening (RunL).
+        */
+        void StartListening();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        * @param aUid the Uid to use
+        * @param aKey item's key
+        * @param aObserver callback interface for notification
+        */
+        CGSPubSubsListener( const TUid aUid,  TInt aKey, 
+                            MGSSettingPSObserver* aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    private:    // Data
+    
+        // UID of the monitored item.
+        TUid        iUid;
+        
+        // ID of the monitored item.
+        TInt        iId;
+        
+        // Property to subscribe to.
+        RProperty   iProperty;
+        
+        // The notification interface.
+        MGSSettingPSObserver* iCallback;
+    };
+
+#endif // GSPUBSUBSLISTENER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/MGSSettingPSObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer interface for indicating publish and subscribe 
+*				 setting changes
+*
+*/
+
+
+
+#ifndef MGSSETTINGPSOBSERVER_H
+#define MGSSETTINGPSOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Observer interface for indicating setting changes
+*
+*  @lib GSSimSecPlugin
+*  @since 3.1
+*/
+class MGSSettingPSObserver
+    {
+    public:  // New functions
+
+        /**
+        * Handler for setting changed event
+        * @param aUid uid of setting        
+        * @param aId id of setting
+        * @param aStatus status of completed AO operation
+        */
+        virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
+                                      const TRequestStatus& aStatus ) = 0;
+    };
+
+#endif // MGSSETTINGPSOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,471 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Autokeyguard sub-folder
+*
+*/
+
+
+// INCLUDE FILES
+#include <coeaui.h>
+#include <hlplch.h>             // For HlpLauncher
+#include <bautils.h>
+#include <gulicon.h>
+#include <eikfrlbd.h>
+#include <eiktxlbx.h>
+#include <aknradiobuttonsettingpage.h>
+#include <aknPopup.h>
+#include <aknlists.h>
+#include <RSSSettings.h>
+#include <AknQueryDialog.h>
+#include <aknnotedialog.h>
+#include <aknViewAppUi.h>
+#include <bldvariant.hrh>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <BTSapDomainPSKeys.h>
+#include <e32property.h>
+#include <gsautokeyguardplugin.mbg>
+#include <GSAutoKeyguardPluginRsc.rsg>
+#include <gsprivatepluginproviderids.h>
+#include <gsmainview.h>
+#include <gsbasecontainer.h>
+
+#include "GSAutoKeyguardPlugin.h"
+#include "GSAutoKeyguardPluginContainer.h"
+#include "GSAutoKeyguardPlugin.hrh"
+#include <centralrepository.h> 
+#include "GSAutoKeyguardPluginAutoKeyguardSettingPage.h"
+#include "GSAutoKeyguardPluginAutoKeyguardTimeQuery.h"
+
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+_LIT( KGSAutoKeyguardPluginResourceFileName, "z:GSAutoKeyguardPluginRsc.rsc" );
+_LIT( KGSAutoKeyguardPluginIconDirAndName, "z:GSAutoKeyguardPlugin.mbm");
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+/**
+* CCugQuery
+* It defines CCugQuery used in closed user group settings
+*/
+class CCugQuery
+    : public CAknNumberQueryDialog
+    {
+    public: // Constructors and destructors
+        /**
+        * C++ constructor.
+        */
+        CCugQuery( TInt& aNumber,const TTone aTone = ENoTone );
+    protected: // From base classes
+        /**
+        * From CCAknNumberQueryDialog Left softkey is allways OK.
+        */
+        void  UpdateLeftSoftKeyL();
+    };
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS =================================
+
+// ---------------------------------------------------------------------------
+// GSAutoKeyguardPlugin::NewL()
+// 
+// ---------------------------------------------------------------------------
+CGSAutoKeyguardPlugin* CGSAutoKeyguardPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSAutoKeyguardPlugin* self = new( ELeave ) CGSAutoKeyguardPlugin();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();    
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// GSAutoKeyguardPlugin::CGSAutoKeyguardPlugin()
+// 
+// ---------------------------------------------------------------------------
+CGSAutoKeyguardPlugin::CGSAutoKeyguardPlugin()
+    : iResourceLoader( *iCoeEnv )
+    {    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::ConstructL()
+// 
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------------------------
+void CGSAutoKeyguardPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+
+    iModel = CGSAutoKeyguardPluginModel::NewL();
+    //PS listener initialization
+    iBtSapListener = CGSPubSubsListener::NewL( 
+                     KPSUidBluetoothSapConnectionState,
+                     KBTSapConnectionState, this );
+
+    // Find the resource file
+    TParse parse;
+    parse.Set( KGSAutoKeyguardPluginResourceFileName, 
+               &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+    
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+
+    // Open resource file
+    iResourceLoader.OpenL( fileName );
+    
+    BaseConstructL( R_GS_AUTO_KEYGUARD_VIEW );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::~CGSAutoKeyguardPlugin()
+// 
+// 
+// ---------------------------------------------------------------------------
+CGSAutoKeyguardPlugin::~CGSAutoKeyguardPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    // close resource loader
+    iResourceLoader.Close();
+    
+    if ( iModel )
+        {
+            delete iModel;
+        }
+        
+    if(iBtSapListener)
+        {
+            delete iBtSapListener;
+        }
+ 
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSAutoKeyguardPlugin::Id()
+// 
+// 
+// ---------------------------------------------------------------------------
+TUid CGSAutoKeyguardPlugin::Id() const
+    {
+    return KGSAutoKeyguardPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::HandleCommandL()
+// 
+// 
+// ---------------------------------------------------------------------------
+void CGSAutoKeyguardPlugin::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EGSCmdAppChange:
+        case EAknSoftkeyChange:
+            {           
+             HandleListBoxSelectionL();
+            }
+            break;
+        case EAknSoftkeyBack:
+            iAppUi->ActivateLocalViewL( KGSDeviceManagementPluginUid );  
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            }
+            break;
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::UpdateListBoxL
+// 
+// Update the current item in the listbox.
+// ---------------------------------------------------------------------------
+void CGSAutoKeyguardPlugin::UpdateListBoxL( TInt aItemId )
+    {
+    Container()->UpdateListBoxL( aItemId );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::DoActivateL(...)
+// 
+// 
+// ---------------------------------------------------------------------------
+void CGSAutoKeyguardPlugin::DoActivateL( const TVwsViewId& aPrevViewId, 
+                                   TUid aCustomMessageId, 
+                                   const TDesC8& aCustomMessage )
+    {
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );    
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::Container
+// 
+// Return handle to container class.
+// ----------------------------------------------------------------------------
+//
+CGSAutoKeyguardPluginContainer* CGSAutoKeyguardPlugin::Container()
+    {
+    return static_cast<CGSAutoKeyguardPluginContainer*>( iContainer );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::NewContainerL()
+// 
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPlugin::NewContainerL()
+    {
+    iContainer = new( ELeave ) CGSAutoKeyguardPluginContainer( iModel );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::HandleListBoxSelectionL()
+// 
+// 
+// ---------------------------------------------------------------------------
+void CGSAutoKeyguardPlugin::HandleListBoxSelectionL() 
+    {
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+    TInt maxPeriod(0);
+    switch ( currentFeatureId )
+        {
+        case EGSSettIdAutoKeyguard:
+            maxPeriod = iModel->AutoKeyguardMaxPeriod();
+            SetAutoKeyguardTimeL(iModel->AutoKeyguardPeriod(), maxPeriod);
+        	break;
+        default:
+            break;
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::SetAutoKeyguardTimeL()
+// 
+// 
+// ---------------------------------------------------------------------------
+void CGSAutoKeyguardPlugin::SetAutoKeyguardTimeL(TInt aPeriod, TInt aMaxPeriod)
+    {
+    TInt currentItem = 0; 
+    CDesCArrayFlat* items =  iCoeEnv->ReadDesC16ArrayResourceL( R_AUTOKEYGUARD_LBX );
+    CleanupStack::PushL(items);
+    if (aPeriod == 0)
+        {
+        currentItem = 0;  // autokeyguard off
+        }
+    else
+        {
+        currentItem = 1;  // user defined
+        }
+    TInt64 periodInMicroseconds(aPeriod);
+    periodInMicroseconds *= 1000000;
+	TTime period(periodInMicroseconds);
+	
+	TInt64 maxPeriodInMicroseconds(aMaxPeriod);
+    maxPeriodInMicroseconds *= 1000000;	
+	TTime maximum(maxPeriodInMicroseconds);
+	
+    CAutoKeyguardSettingPage* dlg = new (ELeave)CAutoKeyguardSettingPage(R_AUTOKEYGUARD_SETTING_PAGE, 
+                                                                            currentItem, items, &period, maxPeriodInMicroseconds);
+    if (!dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
+        {
+        CleanupStack::PopAndDestroy();    // items       
+        return;
+        }
+    CleanupStack::PopAndDestroy();    // items
+    TDateTime keyGuardTime = period.DateTime();
+    //convert the period to seconds
+    TInt newPeriod = (keyGuardTime.Minute() * 60) + keyGuardTime.Second();
+    iModel->SetAutoKeyguardPeriod(newPeriod);
+    UpdateListBoxL( EGSSettIdAutoKeyguard );
+    }
+    
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::HandleResourceChangeL( TInt aType )
+// Updates view layout
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPlugin::HandleResourceChangeL( TInt aType )
+    {
+    if( aType == KAknsMessageSkinChange ||
+        aType == KEikDynamicLayoutVariantSwitch )
+        {
+        //iContainer->HandleResourceChangeL( aType );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::HandleNotifyPSL
+//
+// Handling PS keys change
+// ---------------------------------------------------------------------------
+//  
+void CGSAutoKeyguardPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey,
+                                       const TRequestStatus& /* aStatus */ )
+    {
+    if ( aUid == KPSUidBluetoothSapConnectionState && 
+         aKey == KBTSapConnectionState )
+        {
+        Visible();
+        }
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::GetCaption
+// 
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_AUTO_KEYGUARD_VIEW_CAPTION );
+    
+    aCaption.Copy( *result );
+    delete result;
+    }
+    
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::PluginProviderCategory
+// 
+// A means to identify the location of this plug-in in the framework.
+// ----------------------------------------------------------------------------
+//
+TInt CGSAutoKeyguardPlugin::PluginProviderCategory() const
+    {
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+    
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::Visible
+// 
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//    
+TBool CGSAutoKeyguardPlugin::Visible() const
+    {
+    TInt btSapConnectionState;
+    TBool visible = ETrue;
+
+    iBtSapListener->Get( btSapConnectionState );
+
+    if ( btSapConnectionState == EBTSapConnected )
+        {
+        visible = EFalse;
+        }
+    
+    return visible;
+    }    
+    
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPlugin::DynInitMenuPaneL()
+// 
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSAutoKeyguardPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                          CEikMenuPane* aMenuPane )
+    {
+
+	// show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_AUTO_KEYGUARD_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );    
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+
+    }
+// -----------------------------------------------------------------------------
+// CGSCallDivertPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSAutoKeyguardPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSAutoKeyguardPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpDevKeyguard,
+        fp->FullName(),
+        EMbmGsautokeyguardpluginQgn_prop_cp_dev_keyguard, 
+        EMbmGsautokeyguardpluginQgn_prop_cp_dev_keyguard_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    } 
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2006 - 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*		Autokeyguard period settingpage
+*
+*
+*/
+
+#include <eikmenub.h>
+#include <GSAutoKeyguardPluginRsc.rsg>
+#include <e32base.h>
+#include <AknQueryDialog.h>
+#include "GSAutoKeyguardPluginAutoKeyguardTimeQuery.h"
+#include "GSAutoKeyguardPluginAutoKeyguardSettingPage.h"
+
+const TInt64 minPeriodInMicroseconds(5000000);
+
+//
+// ----------------------------------------------------------
+// CAutoKeyguardSettingPage::CAutoKeyguardSettingPage()
+// C++ default constructor
+// ----------------------------------------------------------
+// 
+CAutoKeyguardSettingPage::CAutoKeyguardSettingPage(TInt aResourceId, 
+                                                    TInt& aCurrentSelectionItem, 
+                                                    CDesCArrayFlat* aItemArray, 
+                                                    TTime* aAutoKeyguardValue,
+                                                    TTime aMaxPeriod) : CAknRadioButtonSettingPage(aResourceId, aCurrentSelectionItem, aItemArray)					
+
+	{	//c++ constructor may not contain any code which might leave
+		iAutoKeyguardValue = aAutoKeyguardValue;
+		iMaxPeriod = aMaxPeriod;
+	}
+
+//
+// ----------------------------------------------------------
+// CAutoKeyguardSettingPage::ConstructL()
+// Symbian OS default constructor
+// ----------------------------------------------------------
+// 
+void CAutoKeyguardSettingPage::ConstructL()
+	{
+	CAknRadioButtonSettingPage::ConstructL();
+	const TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
+	}
+
+
+//
+// ----------------------------------------------------------
+// CAutoKeyguardSettingPage::ProcessCommandL()
+// 
+// ----------------------------------------------------------
+// 
+void CAutoKeyguardSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+	// Respond to softkey events
+
+	switch (aCommandId)
+		{
+		case EAknSoftkeySelect:
+		case EAknSoftkeyOk:
+			ExecuteAutoKeyguardSettingsL();
+			break;
+
+		default:
+			CAknSettingPage::ProcessCommandL(aCommandId);
+			break;
+		}
+
+	}
+
+//---------------------------------------------------------------------------------------
+// CAutoKeyguardSettingPage::HandleListBoxEventL()
+// 
+//---------------------------------------------------------------------------------------
+//
+void CAutoKeyguardSettingPage::HandleListBoxEventL(CEikListBox* aListBox,
+		MEikListBoxObserver::TListBoxEvent aEventType)
+	{
+	// Respond to double click events
+	if ( aEventType == EEventEnterKeyPressed || aEventType == EEventItemSingleClicked )
+		{
+		ExecuteAutoKeyguardSettingsL();
+		}
+	}
+
+//---------------------------------------------------------------------------------------
+// CAutoKeyguardSettingPage::ExecuteAutoKeyguardSettingsL()
+// 
+//---------------------------------------------------------------------------------------
+//
+void CAutoKeyguardSettingPage::ExecuteAutoKeyguardSettingsL()
+	{
+	TInt cur = ListBoxControl()->CurrentItemIndex();
+	
+	// autoKeyguard off
+	if (cur == 0)
+		{
+		*iAutoKeyguardValue = 0;
+		AttemptExitL(ETrue);
+		}
+	// user defined
+	if (cur == 1)
+		{
+
+		CAutoKeyguardTimeQuery* dlg = new (ELeave) CAutoKeyguardTimeQuery(*iAutoKeyguardValue, CAknQueryDialog::ENoTone);
+
+		if(AknLayoutUtils::PenEnabled()) 
+			{
+			dlg->PrepareLC(R_AUTOKEYGUARD_TOUCH_TIME_SETTING_QUERY);
+			}
+		else
+			{
+			dlg->PrepareLC(R_AUTOKEYGUARD_TIME_SETTING_QUERY);
+			}
+
+		if(iMaxPeriod > 0)
+			{
+			TTime minimum(minPeriodInMicroseconds);
+			dlg->SetMinimumAndMaximum(minimum, iMaxPeriod);
+			}
+
+		if(dlg->RunLD())
+			{
+			AttemptExitL(ETrue);
+			}
+		else
+			AttemptExitL(EFalse);
+		}
+	}
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Time query for setting Autokeyguard period.
+*           
+*           
+*           
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "GSAutoKeyguardPluginAutoKeyguardTimeQuery.h"
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// -----------------------------------------------------------------------------
+// CAutoKeyguardTimeQuery::CAutoKeyguardTimeQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CAutoKeyguardTimeQuery::CAutoKeyguardTimeQuery( TTime& aTime, const TTone aTone ) :
+    CAknTimeQueryDialog( aTime, aTone )
+    {
+    }
+
+// Destructor
+CAutoKeyguardTimeQuery::~CAutoKeyguardTimeQuery()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CAutoKeyguardTimeQuery::OfferKeyEventL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CAutoKeyguardTimeQuery::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                            TEventCode aType)
+    {
+    if( aType != EEventKey )
+        return EKeyWasNotConsumed;
+
+    if( NeedToDismissQueryL( aKeyEvent ) )
+            return EKeyWasConsumed;
+    return CAknDialog::OfferKeyEventL(aKeyEvent,aType);
+    }
+
+// -----------------------------------------------------------------------------
+// CAutoKeyguardTimeQuery::NeedToDismissQueryL
+// Allows user to acknowledge time and date queries with the send key.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CAutoKeyguardTimeQuery::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
+    {
+    if (aKeyEvent.iCode == EKeyPhoneSend)
+        {
+        DismissQueryL();
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CAutoKeyguardTimeQuery::DismissQueryL
+// Query is accepted if the left softkey is displayed 
+// (left softkey is displayed only if there is valid data in the query).
+// Query is discarded if the left softkey is not displayed.
+// Clients can override this and implement something different.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CAutoKeyguardTimeQuery::DismissQueryL()
+    {
+    if (IsLeftSoftkeyVisible())
+        {
+        TryExitL(EEikBidOk);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CAutoKeyguardTimeQuery::IsLeftSoftkeyVisible
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CAutoKeyguardTimeQuery::IsLeftSoftkeyVisible()
+    {
+    return ButtonGroupContainer().ButtonGroup()->IsCommandVisible(
+                      ButtonGroupContainer().ButtonGroup()->CommandId(0));
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Device & SIM security sub-folder
+*
+*/
+
+
+#include "GSAutoKeyguardPluginContainer.h"
+#include "GSAutoKeyguardPluginModel.h"
+#include "GSAutoKeyguardPlugin.hrh"
+
+#include <bldvariant.hrh>
+#include <aknlists.h>
+#include <etelmm.h>
+#include <RSSSettings.h>
+#include <StringLoader.h>
+#include <featmgr.h>
+#include <csxhelp/cp.hlp.hrh>
+#include <gsfwviewuids.h>
+#include <GSAutoKeyguardPluginRsc.rsg>
+#include <gslistbox.h>
+#include <AknsConstants.h>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::ConstructL()
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginContainer::ConstructL( const TRect& aRect )
+    { 
+    iListBox = new( ELeave ) CAknSettingStyleListBox;
+    if(AknLayoutUtils::PenEnabled())
+        {
+            BaseConstructL( aRect, R_GS_AUTO_KEYGUARD_VIEW_TITLE, R_TOUCH_AUTO_KEYGUARD_LBX );
+        }
+    else
+        {
+            BaseConstructL( aRect, R_GS_AUTO_KEYGUARD_VIEW_TITLE, R_AUTO_KEYGUARD_LBX );
+        }
+        
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::~CGSSettListSecurityContainer()
+// 
+// Destructor 
+// ---------------------------------------------------------------------------
+//
+
+CGSAutoKeyguardPluginContainer::~CGSAutoKeyguardPluginContainer()
+    {
+    if(iAutoKeyguardItems)
+        {
+            delete iAutoKeyguardItems;
+        }
+	
+	if(iListboxItemArray)
+        {
+           delete iListboxItemArray; 
+        }
+      
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::CGSAutoKeyguardPluginContainer()
+// 
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CGSAutoKeyguardPluginContainer::CGSAutoKeyguardPluginContainer(
+                          CGSAutoKeyguardPluginModel* aModel )
+    : iModel ( aModel )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::ConstructListBoxL()
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, 
+                        *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+	iAutoKeyguardItems = iCoeEnv->ReadDesC16ArrayResourceL( R_AUTOKEYGUARD_ARRAY );
+    CreateListBoxItemsL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSettListIdleContainer::CreateListBoxItemsL()
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginContainer::CreateListBoxItemsL()
+    {
+	MakeAutoKeyguardItemL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListIdleContainer::UpdateListBoxL( TInt aFeatureId )
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginContainer::UpdateListBoxL( TInt aFeatureId )
+    {
+    switch( aFeatureId )
+        {
+        case EGSSettIdAutoKeyguard:
+        	MakeAutoKeyguardItemL();
+        	break;
+        default:
+            return;
+        }
+    
+    iListBox->HandleItemAdditionL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::MakeAutoKeyguardItemL()
+// 
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginContainer::MakeAutoKeyguardItemL()
+    {
+    #ifdef RD_AUTO_KEYGUARD
+    
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    TInt period = iModel->AutoKeyguardPeriod();
+    
+    //calculate minutes and seconds
+    TInt minutes = 0;
+    TInt sec = 0;
+    if(period >= 60)
+    {
+    	minutes = period / 60;	
+    }    
+    sec = period - minutes * 60;
+    
+    if((minutes > 1 ) && (sec > 0))
+    {
+	    CArrayFixFlat<TInt> *minSec=new(ELeave)CArrayFixFlat<TInt>( 2 ); 
+	    CleanupStack::PushL(minSec);
+	    minSec->AppendL(minutes);
+	    minSec->AppendL(sec);
+	    
+	    //Load the resource string; this function replaces the %0N and %1N in the
+        //localisation string with numbers from the array having the same index as the number preceding the N.
+        HBufC* tempDynamicText = StringLoader::LoadL( R_AUTO_KEYGUARD_MINSEC, *minSec, iCoeEnv);
+        ptrBuffer = tempDynamicText->Des();
+        delete tempDynamicText;
+        CleanupStack::PopAndDestroy( minSec );
+    }
+    else if ((minutes == 1 ) && (sec > 0))
+    {
+    	CArrayFixFlat<TInt> *minSec=new(ELeave)CArrayFixFlat<TInt>( 2 ); 
+	    CleanupStack::PushL(minSec);
+	    minSec->AppendL(minutes);
+	    minSec->AppendL(sec);
+	    
+	    //Load the resource string; this function replaces the %0N and %1N in the
+        //localisation string with numbers from the array having the same index as the number preceding the N.
+        HBufC* tempDynamicText = StringLoader::LoadL( R_AUTO_KEYGUARD_ONE_MIN_SEC, *minSec, iCoeEnv); 
+        ptrBuffer = tempDynamicText->Des();
+        delete tempDynamicText;
+        CleanupStack::PopAndDestroy( minSec );
+    }
+    else if ((minutes > 1 ) && (sec == 0))
+    {
+    	TBuf<KGSBufSize128> tempString;
+    	StringLoader::Format( tempString, 
+                         	( ( *iAutoKeyguardItems )[3] ),
+                          		-1, // no index in the key string
+                          		minutes );                
+    	ptrBuffer = tempString;	
+    }
+    else if ((minutes == 1 ) && (sec == 0))
+    {  
+        TBuf<KGSBufSize128> tempString;
+    	StringLoader::Format( tempString, 
+                         	( ( *iAutoKeyguardItems )[2] ),
+                          		-1, // no index in the key string
+                          		minutes );
+    	ptrBuffer = tempString;	
+    }
+    else if ((minutes == 0 ) && (sec > 0))
+    {
+    	TBuf<KGSBufSize128> tempString;
+    	StringLoader::Format( tempString, 
+                         	( ( *iAutoKeyguardItems )[1] ),
+                          		-1, // no index in the key string
+                          		sec );                       
+    	ptrBuffer = tempString;
+    }
+    else //both are 0, period is not user defined
+    {
+    	ptrBuffer = ( *iAutoKeyguardItems )[0];
+    }
+    
+     
+    iListboxItemArray->SetDynamicTextL( EGSSettIdAutoKeyguard, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdAutoKeyguard, 
+                       CGSListBoxItemTextArray::EVisible );
+    #endif //RD_AUTO_KEYGUARD
+    }
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::CurrentFeatureId()
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CGSAutoKeyguardPluginContainer::CurrentFeatureId() const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::GetHelpContext() const
+// Gets Help 
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    // aContext.iContext = KCP_HLP_DEVICE_LOCKING; // This was used before, when keylock and keguard had the same help file
+    _LIT(KCP_HLP_AUTOKEYGUARD_LOCAL, "CP_HLP_AUTOKEYGUARD");	// the global KCP_HLP_AUTOKEYGUARD is defined only on some products but not all.
+    aContext.iContext = KCP_HLP_AUTOKEYGUARD_LOCAL;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSAutoKeyguardPluginContainer::HandleResourceChangeL()
+// 
+// Updates view layout 
+// ---------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginContainer::HandleResourceChangeL( TInt aType )
+    {
+    if( aType == KAknsMessageSkinChange ||
+        aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, 
+                                           mainPaneRect );
+        SetRect( mainPaneRect );
+        DrawNow();
+        }
+    }    
+    
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+// User includes
+#include "GSAutoKeyguardPlugin.h"
+
+// Constants
+const TImplementationProxy KGSAutoKeyguardPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x20011143,	CGSAutoKeyguardPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSAutoKeyguardPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSAutoKeyguardPluginImplementationTable;
+	}
+
+
+// ---------------------------------------------------------------------------
+// E32Dll
+// EKA1 entry point
+//
+// ---------------------------------------------------------------------------
+//
+#ifndef EKA2
+GLDEF_C TInt E32Dll( TDllReason /*aReason*/ )
+	{
+	return( KErrNone );
+	}
+#endif // EKA2
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for Device & SIM security plug-in.
+*
+*/
+
+
+// INCLUDES
+#include "GSAutoKeyguardPluginModel.h"
+
+#include <settingsinternalcrkeys.h>
+
+#include <bldvariant.hrh>
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+const TInt KGSSettingOff = 0;
+const TInt KGSDefaultAutoKeyguardTime = 60;
+const TInt KGSUseDefaultMaxAutoKeyguardTime = 0;
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS =================================
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPluginModel::NewL
+// 
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSAutoKeyguardPluginModel* CGSAutoKeyguardPluginModel::NewL()
+    {
+    CGSAutoKeyguardPluginModel* self = new( ELeave ) CGSAutoKeyguardPluginModel;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPluginModel::CGSAutoKeyguardPluginModel
+// 
+// 
+// C++ default constructor can NOT contain any code, that might leave.
+// ----------------------------------------------------------------------------
+//
+CGSAutoKeyguardPluginModel::CGSAutoKeyguardPluginModel()
+    {
+    
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPluginModel::ConstructL
+// 
+// Symbian OS default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSAutoKeyguardPluginModel::ConstructL()
+    {
+    iSecurityRepository = CRepository::NewL( KCRUidSecuritySettings );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPluginModel::~CGSAutoKeyguardPluginModel
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSAutoKeyguardPluginModel::~CGSAutoKeyguardPluginModel()
+    {
+    if(iSecurityRepository)
+        {
+            delete iSecurityRepository;
+            iSecurityRepository = NULL;
+        }
+    
+    }
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPluginModel::AutoKeyguardPeriod();
+// 
+// Reads Autolock period from .ini file and returns it
+// ----------------------------------------------------------------------------
+//
+TInt CGSAutoKeyguardPluginModel::AutoKeyguardPeriod()
+    {
+    TInt period = KGSSettingOff;
+    
+    if ( iSecurityRepository->
+         Get( KSettingsAutomaticKeyguardTime, period ) != KErrNone )
+            {
+            period = KGSDefaultAutoKeyguardTime;
+            iSecurityRepository->Set( KSettingsAutomaticKeyguardTime, period );
+            }
+    
+    return period;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPluginModel::AutoKeyguardMaxPeriod();
+// 
+// Reads Autokeyguard period maximum allowed value from .ini file and returns it
+// ----------------------------------------------------------------------------
+//
+TInt CGSAutoKeyguardPluginModel::AutoKeyguardMaxPeriod()
+    {
+    TInt maxPeriod(600);
+    
+    if ( iSecurityRepository->
+         Get( KSettingsMaxAutomaticKeyguardTime, maxPeriod ) != KErrNone )
+            {
+            maxPeriod = KGSUseDefaultMaxAutoKeyguardTime;
+            }
+    return maxPeriod;
+    }
+            
+
+// ----------------------------------------------------------------------------
+// CGSAutoKeyguardPluginModel::SetAutoKeyguardPeriod
+// 
+// Writes Autokeyguard period time to Cenrep
+// ----------------------------------------------------------------------------
+//
+TBool CGSAutoKeyguardPluginModel::SetAutoKeyguardPeriod( TInt aLockTime )
+    {
+    TInt ret = iSecurityRepository->Set( KSettingsAutomaticKeyguardTime, aLockTime );    
+    return ret;
+    }
+  
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSPubSubsListener.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Publish and subscribe settings listener.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSPubSubsListener.h"
+#include "MGSSettingPSObserver.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::CGSPubSubsListener
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CGSPubSubsListener::CGSPubSubsListener( const TUid aUid, const TInt aKey, 
+                                       MGSSettingPSObserver* aObserver ) 
+    : CActive( CActive::EPriorityStandard )
+    {
+    iUid = aUid;
+    iId = aKey;
+    iCallback = aObserver;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::~CGSPubSubsListener
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CGSPubSubsListener::~CGSPubSubsListener()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::RunL
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::RunL()
+    {
+    const TRequestStatus status( iStatus );
+    StartListening();
+    iCallback->HandleNotifyPSL( iUid, iId, status );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::DoCancel
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::RunError
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+TInt CGSPubSubsListener::RunError( TInt /*aError*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::NewL
+//
+// Symbian OS two phased constructor
+// -----------------------------------------------------------------------------
+//
+CGSPubSubsListener* CGSPubSubsListener::NewL( const TUid aUid, const TInt aKey,
+                                              MGSSettingPSObserver* aObserver )
+    {
+    CGSPubSubsListener* self = new( ELeave ) 
+        CGSPubSubsListener( aUid, aKey, aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::StartListening
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::StartListening() 
+    {
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::ConstructL
+//
+// Symbian OS default constructor
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+    
+    User::LeaveIfError ( iProperty.Attach( iUid, iId, EOwnerThread ) );
+    StartListening();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::Get
+// Read integer value.
+// -----------------------------------------------------------------------------
+//
+TInt CGSPubSubsListener::Get( TInt& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::Get
+// Read binary value.
+// -----------------------------------------------------------------------------
+//
+TInt CGSPubSubsListener::Get( TDes8& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+  
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::Get
+// Read string value.
+// -----------------------------------------------------------------------------
+//      
+TInt CGSPubSubsListener::Get( TDes16& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSAutoKeyguardPlugin.
+*
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSAutoKeyguardPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsautokeyguardplugin.iby )
+../rom/GSAutoKeyguardPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsautokeyguardpluginresources.iby )
+loc/gsautokeyguardplugin.loc MW_LAYER_LOC_EXPORT_PATH( gsautokeyguardplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsautokeyguardplugin.mif
+  OPTION HEADERFILE gsautokeyguardplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_dev_keyguard
+END
+
+
+PRJ_MMPFILES
+GSAutoKeyguardPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/loc/gsautokeyguardplugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for Automatic keyguard view
+*
+*/
+
+
+//d:Text of a list item in Connection view's folder list
+//d:Item opens Data Call folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 5.0
+//
+#define qtn_set_auto_keyguard_title "Automatic keyguard"
+
+//d: Automatic keyguard setting item in device & sim security settings folder
+//l: list_setting_pane_t1
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard "Autokeyguard period"
+
+//d:List item in automatic keyguard setting page
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard_none "None"
+
+//d:List item in automatic keyguard setting page
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard_userdefined "User defined"
+
+//d:Number query: automatic keyguard period time.
+//l:popup_query_data_window
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard_query "Lock keypad after (minutes:seconds) "
+
+//d:Automatic keyguard period setting item edit - setting selection data
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard_one_min "%N min"
+
+//d:Automatic keyguard period setting item edit - setting selection data, %N is number 0-60
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard_min "%N min"
+
+//d:Automatic keyguard period setting item edit - setting selection data. %1N is a number 0-59.
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard_one_min_sec "%0N min %1N sec"
+
+//d:Automatic keyguard period setting item edit - setting selection data, %0N is number 0-59, %1N is number 0-59
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.0
+#define qtn_set_auto_keyguard_minsec "%0N min %1N sec"
+
+//d:Automatic keyguard period setting item edit - setting selection data, %N is number 0-59
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_set_auto_keyguard_sec "%N sec"
+
+//d: Name of the autokeyguard setting
+//l: list_setting_pane_t1
+//w:
+//r:5.0
+#define qtn_set_auto_display_lock "Display autolock period"
+
+//d:Number query: automatic keyguard period time.
+//l:popup_query_data_window
+//w:
+//r:5.0
+#define qtn_set_auto_display_lock_query "Lock display and keys after (minutes:seconds)"
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSBackgroundImage/GSBackgroundImage.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is project specification for GS Background Image DLL
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL DRM
+
+TARGET          backgroundimage.dll
+TARGETTYPE      DLL
+UID             0x1000008d 0x101FD68C
+
+// This defines that the CGSModel uses IETD to enhance
+// background and welcome note image while loading/processing.
+MACRO        __USE_IETD__
+
+SOURCEPATH      Src
+SOURCE          BackgroundImage.cpp
+SOURCE          GsAsyncImageHandling.cpp
+
+USERINCLUDE     .
+USERINCLUDE     ..
+USERINCLUDE     Inc
+USERINCLUDE     ../Logger
+USERINCLUDE     ../Cenrep
+
+//System include paths
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+// Libraries required by framework
+LIBRARY bafl.lib
+LIBRARY euser.lib
+LIBRARY cone.lib
+LIBRARY apparc.lib
+
+// Libraries for model
+LIBRARY commonengine.lib        // shareddata
+LIBRARY efsrv.lib
+LIBRARY estor.lib
+LIBRARY mediaclientimage.lib    // media server
+LIBRARY sysutil.lib             // memory CL check
+LIBRARY fbscli.lib
+LIBRARY apgrfx.lib              // for Personalization app
+LIBRARY drmcommon.lib
+LIBRARY bitgdi.lib
+LIBRARY cdlengine.lib           //Scalable UI
+LIBRARY imageconversion.lib     //for image handling
+LIBRARY avkon.lib
+LIBRARY eikcore.lib
+LIBRARY centralrepository.lib
+LIBRARY phoneclient.lib
+LIBRARY aknlayout2.lib
+LIBRARY flogger.lib              //tracing
+LIBRARY drmparsers.lib
+LIBRARY bitmaptransforms.lib     //bitmap scaling
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSBackgroundImage/Src/BackgroundImage.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,542 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "backgroundimage.h"
+#include    "GsLogger.h"
+#include    "settingsinternalcrkeys.h"
+#include    "SettingsPrivateCRKeys.h"
+
+#include    <aknappui.h>
+#include    <aknlayoutscalable_apps.cdl.h>
+#include    <AknUtils.h>
+#include    <apgcli.h>
+#include    <applayout.cdl.h>
+#include    <DRMCommon.h>
+#include    <Oma1DcfCreator.h>  //DRM v2 migration
+#include    <s32file.h>
+#include    <startupdomaincrkeys.h>
+#include    <sysutil.h>
+#include    <graphics/bitmapuid.h>
+
+
+
+// CONSTANTS
+// Setting values for Background and Welcome note image
+const   TInt    KGSBackgroundModeImage = 1;
+// estimated image max size in bytes
+const   TInt    KGSMaxBackgroundImgSize = 520000;
+// estimated image max size in bytes
+const   TInt    KGSMaxWelcomeNoteImgSize = 100000;
+const   TInt    KGSVTStillImageWidth = 176;
+const   TInt    KGSVTStillImageHeight = 144;
+
+//Personalisation application is availble on ROM (1) or not (0)
+const   TInt    KGSPlsnOnRom = 1;
+const   TInt    KGSPlsnNotOnRom = 0;
+
+// other constants
+_LIT( KGSBackgroundImgPath, "c:\\resource\\apps\\backgroundimage.mbm");
+_LIT( KGSVTStillImgPath, "c:\\resource\\apps\\vtstillimage.mbm");
+
+
+
+
+// FORWARD DECLARATIONS
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CGSBackgroundImage::CGSBackgroundImage
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CGSBackgroundImage::CGSBackgroundImage()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CGSBackgroundImage::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CGSBackgroundImage::ConstructL()
+    {
+    iPersonalizationRepository =
+        CRepository::NewL( KCRUidPersonalizationSettings );
+    iStartupConfRepository = CRepository::NewL( KCRUidStartupConf );
+    iTelephonyRepository = CRepository::NewL( KCRUidTelephonySettings );
+
+    iDisplayMode = CEikonEnv::Static()->ScreenDevice()->DisplayMode();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSBackgroundImage::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CGSBackgroundImage* CGSBackgroundImage::NewL()
+    {
+    CGSBackgroundImage* self = new( ELeave ) CGSBackgroundImage;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+//-----------------------------------------------------------------------------
+//
+CGSBackgroundImage::~CGSBackgroundImage()
+    {
+    delete iPersonalizationRepository;
+    delete iStartupConfRepository;
+    delete iTelephonyRepository;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::BackgroundImageL
+//
+// Returns background image mode.
+// DEPRECATED
+// ----------------------------------------------------------------------------
+//
+EXPORT_C TInt CGSBackgroundImage::BackgroundImageL()
+    {
+    TInt image;
+    User::LeaveIfError( iPersonalizationRepository->
+        Get( KSettingsBackgroundImage, image ) );
+    return image;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::SetBackgroundImageL
+//
+// Sets background image mode.
+// DEPRECATED
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::SetBackgroundImageL(const TInt aImage)
+    {
+    User::LeaveIfError( iPersonalizationRepository->
+        Set( KSettingsBackgroundImage, aImage ) );
+    if (aImage != KGSBackgroundModeImage)
+        {
+        // It doesn't matter much if the image deletion fails,
+        // so no need to handle the error.
+        TRAP_IGNORE( DeleteImageL( KGSBackgroundImgPath ) );
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::SetBackgroundImagePathL
+//
+// Sets background image.
+// DEPRECATED
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::SetBackgroundImagePathL(
+                                                const TDesC& aImagePath )
+    {
+    // Check if there is enough space in disk to store background image
+    if (SysUtil::FFSSpaceBelowCriticalLevelL(NULL, KGSMaxBackgroundImgSize))
+        {
+        // don't show any own notes here
+        User::Leave(KErrDiskFull);
+        }
+
+    // make sure there is no memory leaks because of iBitmap and iDimmedBmp
+    if (iBitmap)
+        {
+        delete iBitmap;
+        iBitmap = NULL;
+        }
+
+    iBitmap = new(ELeave) CFbsBitmap;
+
+    TRect appRect = iAvkonAppUi->ApplicationRect();
+    TAknLayoutRect layout;
+
+    layout.LayoutRect(appRect, AknLayout::wallpaper_pane());
+    LoadImageL(aImagePath, layout.Rect().Width(), layout.Rect().Height(),
+            ETrue, EGSWallpaperIdle);
+    TBuf<1> KGSNullParam;
+    SaveBitmapsL( KGSNullParam, KGSNullParam );
+
+    delete iBitmap;
+    iBitmap = NULL;
+    User::LeaveIfError( iPersonalizationRepository->
+        Set( KSettingsBackgroundImagePath, KGSBackgroundImgPath ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::SetBackgroundImagePathL
+// Sets background image. Does not store image to SD
+// Overloaded function, takes 2 parameters
+// DEPRECATED
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::SetBackgroundImagePathL(
+    const TDesC& aImagePath,
+    TDes& aBmpFileName )
+    {
+    SetBackgroundImagePathL( aImagePath, aBmpFileName, EGSWallpaperIdle );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::SetBackgroundImagePathL
+// Sets background image. Does not store image to SD
+// Overloaded function, takes 3 parameters
+// DEPRECATED
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::SetBackgroundImagePathL(
+    const TDesC& aImagePath,
+    TDes& aBmpFileName,
+    TGSWallpaperType aWallpaperType )
+    {
+    // Check if there is enough space in disk to store background image
+    if (SysUtil::FFSSpaceBelowCriticalLevelL(NULL, KGSMaxBackgroundImgSize))
+        {
+        // don't show any own notes here
+        User::Leave(KErrDiskFull);
+        }
+
+    // Make sure there is no memory leaks because of iBitmap and iDimmedBmp
+    if (iBitmap)
+        {
+        delete iBitmap;
+        iBitmap = NULL;
+        }
+
+    iBitmap = new(ELeave) CFbsBitmap;
+
+    if( aWallpaperType == EGSWallpaperIdle )
+        {
+        //Reading wallpaper size
+        __GSLOGSTRING(
+            "[CGSBackgroundImage] SetBackgroundImagePathL |->");
+        TRect screenRect( CEikonEnv::Static()->ScreenDevice()->SizeInPixels() );
+        TAknLayoutRect appRect;
+        appRect.LayoutRect(
+            screenRect,
+            AknLayout::application_window( screenRect ) );
+        TAknLayoutRect mainRectSmall;
+        mainRectSmall.LayoutRect(
+            appRect.Rect(),
+            AknLayout::main_pane( appRect.Rect(), 0, 1, 1 ) );
+        TAknLayoutRect layout;
+        layout.LayoutRect( mainRectSmall.Rect(), AknLayout::wallpaper_pane() );
+
+        __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL");
+        LoadImageL(aImagePath, layout.Rect().Width(), layout.Rect().Height(),
+            ETrue, EGSWallpaperIdle);
+        }
+    else if( aWallpaperType == EGSWallpaperPinboard )
+        {
+        //Reading wallpaper size
+        __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL 1");
+
+        TRect screenRect( CEikonEnv::Static()->ScreenDevice()->SizeInPixels() );
+        TAknLayoutRect appRect;
+        appRect.LayoutRect(
+            screenRect,
+            AknLayout::application_window( screenRect ) );
+        TAknLayoutRect mainRectSmall;
+        mainRectSmall.LayoutRect(
+            appRect.Rect(),
+            AknLayout::main_pane( appRect.Rect(), 0, 0, 1 ) );
+        TAknLayoutRect layout;
+
+        layout.LayoutRect(
+            mainRectSmall.Rect(), AknLayoutScalable_Apps::bg_pinb_pane(0) );
+
+        __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL 2");
+        LoadImageL(aImagePath, layout.Rect().Width(), layout.Rect().Height(),
+            ETrue, EGSWallpaperPinboard);
+        __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL -|");
+        }
+
+    SaveBitmapsL( aBmpFileName, aImagePath );
+
+    delete iBitmap;
+    iBitmap = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::SetWelcomeNoteImageL
+//
+// Sets welcome note image's path
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::SetWelcomeNoteImageL(const TDesC& aImagePath,
+                          CGSAsyncImageHandling& aImgHandler )
+    {
+    // Check if there is enough space in disk to store welcome note image
+    if ( SysUtil::FFSSpaceBelowCriticalLevelL( NULL, KGSMaxWelcomeNoteImgSize ) )
+        {
+        // don't show any own notes here
+        User::Leave( KErrDiskFull );
+        }
+
+
+
+    TRect screen = iAvkonAppUi->ApplicationRect();
+    TInt screenWidth = screen.Width() - 2;
+    TInt screenHeight = screen.Height() - 2;
+
+    //rescale
+    aImgHandler.ProcessImageL( aImagePath, screenWidth, screenHeight,
+                                                        EGSWelcomeNoteImage );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::LoadImageL
+// Loads an image to bitmap and scales it if it's too large.
+// Deprecated
+// ----------------------------------------------------------------------------
+//
+void CGSBackgroundImage::LoadImageL(const TDesC& /*aImagePath*/,
+                        TInt /*aWidth*/, TInt /*aHeight*/,
+                        TBool /*aBgImage*/, TGSWallpaperType /*aWallpaperType*/)
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::SaveBitmapsL
+// Stores background image and dimmed image to the same mbm file.
+// ----------------------------------------------------------------------------
+//
+void CGSBackgroundImage::SaveBitmapsL( TDes& aBmpFileName,
+                                            const TDesC& aOriginalFullname )
+    {
+    RFs fs;
+    User::LeaveIfError( fs.Connect() );
+    CleanupClosePushL( fs );
+
+    CDirectFileStore* fileStore;
+    if( aBmpFileName != KNullDesC )
+        {
+        fileStore = CDirectFileStore::ReplaceLC(
+            fs, aBmpFileName, EFileWrite );
+        }
+    else
+        {
+        fileStore = CDirectFileStore::ReplaceLC(
+            fs, KGSBackgroundImgPath, EFileWrite );
+        }
+
+    TUidType uidType( KDirectFileStoreLayoutUid, KMultiBitmapFileImageUid );
+    fileStore->SetTypeL( uidType );
+
+    RStoreWriteStream bmpStream;
+    TStreamId imgId = bmpStream.CreateLC( *fileStore );
+    iBitmap->ExternalizeL( bmpStream );
+
+    CleanupStack::PopAndDestroy(); //bmpStream
+
+    RStoreWriteStream rootStream;
+    // create root stream
+    TStreamId rootStreamId = rootStream.CreateLC( *fileStore );
+    rootStream.WriteInt32L( 1 ); // number of bitmaps
+
+    rootStream << imgId; // stream id of bitmap
+
+    CleanupStack::PopAndDestroy(); //rootStream
+
+    fileStore->SetRootL( rootStreamId );
+    CleanupStack::PopAndDestroy(); // filestore;
+
+    TBool isprotected( EFalse );
+
+    DRMCommon* drmclient = DRMCommon::NewL();
+
+    CleanupStack::PushL( drmclient );
+    TInt error = drmclient->Connect();
+    if ( error != DRMCommon::EOk )
+        {
+        User::Leave( KErrCorrupt );
+        }
+
+    if ( aOriginalFullname != KNullDesC )
+        {
+        error = drmclient->IsProtectedFile( aOriginalFullname, isprotected );
+        if ( error != DRMCommon::EOk )
+            {
+            User::Leave( KErrCorrupt );
+            }
+        }
+
+
+    if ( isprotected )
+        {
+        HBufC8* contenturi = NULL;
+        HBufC8* mimetype = NULL;
+        DRMCommon::TContentProtection contentProtection;
+        TUint datalen( 0 );
+        CDRMRights* rights = NULL;
+
+
+        error = drmclient->GetFileInfo(
+            aOriginalFullname, contentProtection,
+            mimetype, contenturi, datalen );
+        CleanupStack::PushL( mimetype );
+        CleanupStack::PushL( contenturi );
+        if ( error != DRMCommon::EOk )
+            {
+            User::Leave( KErrCorrupt );
+            }
+
+        drmclient->GetActiveRights(
+            *contenturi, DRMCommon::EDisplay, rights );
+        CleanupStack::PushL( rights );
+
+        RFile file;
+        User::LeaveIfError( file.Open( fs, aBmpFileName,
+                                        EFileWrite|EFileShareAny ) );
+        CleanupClosePushL( file );
+
+        TInt filesize( 0 );
+        User::LeaveIfError( file.Size( filesize ) );
+        HBufC8* content = HBufC8::NewL( filesize ); // use actual filesize
+
+        CleanupStack::PushL( content );
+
+        TPtr8 readPtr( content->Des() );
+        User::LeaveIfError( file.Read( readPtr ) );
+
+        CleanupStack::Pop(); // content
+        COma1DcfCreator* dcfCreator = COma1DcfCreator::NewL();
+        dcfCreator->EncryptContentL( content, *mimetype, rights );
+        CleanupStack::PushL( content );
+
+        TInt offset = 0;
+        User::LeaveIfError( file.Seek( ESeekStart,offset ) );
+        TPtr8 writePtr( content->Des() );
+        User::LeaveIfError( file.Write( writePtr ) );
+        User::LeaveIfError( file.Flush() );
+        // mimetype, contenturi, rights, file, content
+        CleanupStack::PopAndDestroy(5);
+        delete dcfCreator;
+        }
+
+    drmclient->Disconnect();
+    CleanupStack::PopAndDestroy(2); // fs & drmclient
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::DeleteImageL
+// Deletes file specified in the parameter.
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::DeleteImageL(const TDesC& aImagePath)
+    {
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+
+    User::LeaveIfError(fs.Delete(aImagePath));
+
+    CleanupStack::PopAndDestroy(); // fs
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::SetVTStillImagePathL
+//
+// Sets VT still image.
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::SetVTStillImagePathL(
+                                           const TDesC& aImagePath,
+                                           CGSAsyncImageHandling& aImgHandler )
+    {
+    // Check if there is enough space in disk to store still image
+    if (SysUtil::FFSSpaceBelowCriticalLevelL(NULL, KGSMaxBackgroundImgSize))
+        {
+        // don't show any own notes here
+        User::Leave(KErrDiskFull);
+        }
+    aImgHandler.ProcessImageL( aImagePath, KGSVTStillImageWidth,
+                    KGSVTStillImageHeight, EGSVtStillImage );
+    User::LeaveIfError( iTelephonyRepository->
+            Set( KSettingsVTStillImagePath, KGSVTStillImgPath ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::GetPlnsStatus
+//
+// Check if Personalisation application is on the device
+// ----------------------------------------------------------------------------
+//
+EXPORT_C TInt CGSBackgroundImage::GetPlnsStatus()
+    {
+    TRAP_IGNORE( IsPersonalisationApplicationL() );
+    return iPlnsInDevice;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSBackgroundImage::IsPersonalisationApplication
+//
+//
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBackgroundImage::IsPersonalisationApplicationL()
+    {
+    RApaLsSession session;
+    User::LeaveIfError( session.Connect() );
+
+    const TUid KUidPsln = { 0x10005A32 };
+    TApaAppInfo appInfo;
+    TInt search = session.GetAppInfo( appInfo, KUidPsln );
+    session.Close();
+
+    if ( search == KErrNone )
+        {
+        TParse fileInfo;
+        fileInfo.Set( appInfo.iFullName, NULL, NULL );
+        TPtrC drive = fileInfo.Drive();
+        _LIT( KZDrive, "Z:" );
+        if ( drive == KZDrive )
+            {
+            iPlnsInDevice = KGSPlsnOnRom;
+            }
+        else
+            {
+            iPlnsInDevice = KGSPlsnNotOnRom;
+            }
+        }
+    else
+        {
+        iPlnsInDevice = KErrNotFound;
+        }
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSBackgroundImage/Src/GsAsyncImageHandling.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,445 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "gsasyncimagehandling.h"
+#include <aknappui.h>
+#include <AknUtils.h>
+#include <applayout.cdl.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <startupdomaincrkeys.h>
+
+#include "mgsasyncimagehandlingobserver.h"
+#include "GsLogger.h"
+
+#include <CPhCltImageHandler.h>
+#include <CPhCltImageParams.h>
+#include <CPhCltBaseImageParams.h>
+
+//_LIT( KGSWelcomeNoteImgPath, "c:\\private\\100058ec\\welcomeimage.mbm");
+
+const   TInt    KGSVTStillImageWidth = 176;
+const   TInt    KGSVTStillImageHeight = 144;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CGSAsyncImageHandling::CGSAsyncImageHandling
+// C++ constructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSAsyncImageHandling::CGSAsyncImageHandling( RFs& aFs,
+                                  MGSAsyncImageHandlingObserver* aObserver,
+                                  const TDesC& aDestinationPath )
+        : CActive( EPriorityNormal ),
+          iObserver( aObserver ),
+          iFs( aFs ),
+          iDestinationPath( aDestinationPath )
+          
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAsyncImageHandling::NewL()
+// C++ constructor.
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSAsyncImageHandling* CGSAsyncImageHandling::NewL( RFs& aFs,
+                                   MGSAsyncImageHandlingObserver* aObserver,
+                                   const TDesC& aDestinationPath )
+    {
+    CGSAsyncImageHandling* self =
+        new( ELeave ) CGSAsyncImageHandling( aFs, aObserver,
+                                                  aDestinationPath );
+    CleanupStack::PushL( self );                                              
+    self->ConstructL();
+    CleanupStack::Pop();
+    
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAsyncImageHandling::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// -----------------------------------------------------------------------------
+//
+void CGSAsyncImageHandling::ConstructL()
+    {
+    iStartupRepository = CRepository::NewL( KCRUidStartupConf );
+    iBitmapScaler = CBitmapScaler::NewL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSAsyncImageHandling::~CGSAsyncImageHandling
+// destructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSAsyncImageHandling::~CGSAsyncImageHandling()
+    {
+    Cancel();
+
+    if ( iStartupRepository )
+        {
+        delete iStartupRepository;
+        }
+
+    if( iDecoder )
+        {
+        delete iDecoder;
+        }
+
+    if ( iBitmapScaler )
+        {
+        delete iBitmapScaler;
+        }
+
+    if ( iBitmap )
+        {
+        delete iBitmap;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSAsyncImageHandling::ProcessImageL
+//
+// Processing the image asynchronously
+// ---------------------------------------------------------------------------
+//
+void CGSAsyncImageHandling::ProcessImageL( const TDesC& aFileName,
+                                           TInt aScreenWidth,
+                                           TInt aScreenHeight,
+                                           TGSBgImageType aBgImageType )
+    {
+__GSLOGSTRING1( "[CGSAsyncImageHandling] process image %S", &aFileName );
+
+    TInt frameNumber = 0; //for JPEG & bmp images
+    iBgImageType = aBgImageType;
+
+    // make sure there is no memory leaks because of iBitmap and iDimmedBmp
+    if (iBitmap)
+        {
+        delete iBitmap;
+        iBitmap = NULL;
+        }
+    iBitmap = new(ELeave) CFbsBitmap;
+
+    // Loading image from file into CFbsBitmap
+    CImageDecoder::GetMimeTypeFileL( iFs, aFileName, iMimeString );
+    iDecoder = CImageDecoder::FileNewL( iFs, aFileName,
+                                        CImageDecoder::EOptionNone );
+
+    TFrameInfo frameInfo = iDecoder->FrameInfo();
+    TSize imgSize = frameInfo.iOverallSizeInPixels;
+
+
+    TDisplayMode displayMode = GetDisplayMode( frameInfo );
+
+    TSize screenSize( aScreenWidth, aScreenHeight );
+    TSize loadSize( CalculateLoadSize( frameInfo, screenSize ) );
+    iScaleSize = loadSize;
+
+    iBitmap->Reset();
+    User::LeaveIfError( iBitmap->Create( imgSize, displayMode ) );
+    iDecoder->Convert( &iStatus, *iBitmap, frameNumber );
+
+    if ( aBgImageType == EGSWelcomeNoteImage )
+      {
+      iState = EGSWelcomeConversion;
+      }
+    else if ( aBgImageType == EGSVtStillImage )
+      {
+      iState = EGSVTConversion;
+      }
+
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSAsyncImageHandling::GetDisplayMode
+//
+// Dithers the image to attain the required dithering according to the display
+// mode settings
+// ---------------------------------------------------------------------------
+//
+TDisplayMode CGSAsyncImageHandling::GetDisplayMode( const TFrameInfo& aFrameInfo )
+    {
+    if( aFrameInfo.iFlags & TFrameInfo::ECanDither )
+        {
+        if( aFrameInfo.iFrameDisplayMode < EColor64K )
+            {
+            return aFrameInfo.iFrameDisplayMode;
+            }
+        else
+            {
+            return EColor64K;
+            }
+        }
+    else
+        {
+        return aFrameInfo.iFrameDisplayMode;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSAsyncImageHandling::RunL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAsyncImageHandling::RunL()
+    {
+    if( iStatus.Int() == KErrNone )
+      {
+      switch( iState )
+        {
+        case EGSWelcomeConversion:
+          iBitmapScaler->Scale(&iStatus, *iBitmap, iScaleSize, ETrue );
+          iState = EGSWelcomeScaling;
+          SetActive();
+          break;
+
+        case EGSWelcomeScaling:
+            {
+            TInt err = iBitmap->Save( iDestinationPath );
+            iStartupRepository->Set( KStartupWelcomeNoteImage,
+                                     iDestinationPath );
+
+            //raising completion event
+            iObserver->ImageHandlingCompleteL( iStatus.Int() );
+            Cancel();
+            }
+          break;
+
+        case EGSVTConversion:
+          iBitmapScaler->Scale(&iStatus, *iBitmap, iScaleSize, ETrue );
+          iState = EGSVTScaling;
+          SetActive();
+          break;
+
+        case EGSVTScaling:
+          SaveVTStillImageL();
+          iObserver->ImageHandlingCompleteL( iStatus.Int() );
+          Cancel();
+          break;
+
+        default:
+          break;
+        }
+      }
+    else
+      {
+      iObserver->ImageHandlingCompleteL( iStatus.Int() );
+      Cancel();
+      }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSAsyncImageHandling::DoCancel
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAsyncImageHandling::DoCancel()
+    {
+    if ( iDecoder )
+        {
+        iDecoder->Cancel();
+        }
+
+    if ( iBitmapScaler )
+        {
+        iBitmapScaler->Cancel();
+        }
+
+    delete iDecoder;
+    iDecoder = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSAsyncImageHandling::RunError
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSAsyncImageHandling::RunError( TInt aError )
+    {
+    TRAP_IGNORE( iObserver->ImageHandlingCompleteL( aError ) );
+    DoCancel();
+    return aError;
+    }
+
+// ----------------------------------------------------------------------------
+// TSize CGSAsyncImageHandling::CalculateLoadSize
+//
+// Calculates the load size
+// ----------------------------------------------------------------------------
+//
+TSize CGSAsyncImageHandling::CalculateLoadSize( TFrameInfo& aFrameInfo,
+                                               const TSize aScreenSize )
+    {
+    TReal perfectAspect = ( TReal )(
+    		( TReal )aScreenSize.iWidth/
+    		( TReal )aScreenSize.iHeight );
+    TReal aspect = ( TReal )(
+        ( TReal )aFrameInfo.iFrameCoordsInPixels.Width()/
+        ( TReal )aFrameInfo.iFrameCoordsInPixels.Height() );
+    TSize size( aScreenSize.iWidth, aScreenSize.iHeight );
+    TSize cropsize( aScreenSize.iWidth, aScreenSize.iHeight );
+
+    TAknWindowLineLayout layout = AknLayout::wallpaper_pane();
+    if( aFrameInfo.iFrameCoordsInPixels.Width() > aScreenSize.iWidth ||
+        aFrameInfo.iFrameCoordsInPixels.Height() > aScreenSize.iHeight )
+        {
+        //calculating dynamically range for image aspect ratio close to screen
+        TReal maxAspect = ((TReal)aScreenSize.iWidth/(TReal)aScreenSize.iHeight) + 0.12;
+        TReal minAspect = ((TReal)aScreenSize.iWidth/(TReal)aScreenSize.iHeight) - 0.12;
+
+        if (aspect >= minAspect && aspect <= maxAspect )
+            {
+            if( aspect < perfectAspect )
+                {
+                size.iWidth = aScreenSize.iWidth;
+                size.iHeight = (TInt)((TReal)aScreenSize.iWidth/
+                    (TReal)aFrameInfo.iFrameCoordsInPixels.Width()*
+                    (TReal)aFrameInfo.iFrameCoordsInPixels.Height());
+                }
+            else
+                {
+                size.iWidth = (TInt)((TReal)aScreenSize.iHeight/
+                    (TReal)aFrameInfo.iFrameCoordsInPixels.Height()*
+                    (TReal)aFrameInfo.iFrameCoordsInPixels.Width());
+                size.iHeight = aScreenSize.iHeight;
+                }
+            if (size.iWidth > aScreenSize.iWidth)
+                {
+                cropsize.iWidth = aScreenSize.iWidth;
+                }
+            else
+                {
+                cropsize.iWidth = size.iWidth;
+                }
+            if (size.iHeight > aScreenSize.iHeight)
+                {
+                cropsize.iHeight = aScreenSize.iHeight;
+                }
+            else
+                {
+                cropsize.iHeight = size.iHeight;
+                }
+            }
+        else
+            {
+            // Scale and maintain aspect ratio
+            if( aspect < perfectAspect )
+                {
+                if (aFrameInfo.iFrameCoordsInPixels.Height() > aScreenSize.iHeight)
+                    {
+                    size.iWidth = (TInt)((TReal)aScreenSize.iHeight/
+                        (TReal)aFrameInfo.iFrameCoordsInPixels.Height()*
+                        (TReal)aFrameInfo.iFrameCoordsInPixels.Width());
+                    size.iHeight = aScreenSize.iHeight;
+                    }
+                }
+            else
+                {
+                if (aFrameInfo.iFrameCoordsInPixels.Width() > aScreenSize.iWidth)
+                    {
+                    size.iWidth = aScreenSize.iWidth;
+                    size.iHeight = (TInt)((TReal)aScreenSize.iWidth/
+                        (TReal)aFrameInfo.iFrameCoordsInPixels.Width()*
+                        (TReal)aFrameInfo.iFrameCoordsInPixels.Height());
+                    }
+                }
+            }
+        }
+
+    return size;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSAsyncImageHandling::SaveVTStillImageL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSAsyncImageHandling::SaveVTStillImageL()
+    {
+    //creating new and merging
+    const TSize KStillImageSize( KGSVTStillImageWidth, KGSVTStillImageHeight );
+
+    CFbsBitmap* newBitmap = new ( ELeave ) CFbsBitmap;
+    CleanupStack::PushL( newBitmap );
+
+    User::LeaveIfError(
+        newBitmap->Create( KStillImageSize, iBitmap->DisplayMode() ) );
+
+    CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( newBitmap );
+    CleanupStack::PushL( device );
+
+    CFbsBitGc* context = NULL;
+    User::LeaveIfError( device->CreateContext( context ) );
+    User::LeaveIfNull( context );
+
+    context->SetPenStyle( CGraphicsContext::ENullPen );
+    context->SetBrushColor( TRgb( 0, 0, 0 ) ); // black color
+    context->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    context->Clear();
+
+    const TSize scaledImageSize( iBitmap->SizeInPixels() );
+
+    TInt xPos = ( KStillImageSize.iWidth - scaledImageSize.iWidth ) / 2;
+    TInt yPos = ( KStillImageSize.iHeight - scaledImageSize.iHeight ) / 2;
+
+    context->BitBlt( TPoint( xPos, yPos ), iBitmap );
+
+    delete context;
+    CleanupStack::PopAndDestroy( device );
+
+    //saving bitmap
+    CPhCltImageHandler* phCltImageHandler = CPhCltImageHandler::NewL();
+    CleanupStack::PushL( phCltImageHandler );
+
+    // Acquires ownership of *imageParams
+    // Bad naming for create-function CPhCltBaseImageParamsL().
+    CPhCltImageParams* imageParams = phCltImageHandler->
+                       CPhCltBaseImageParamsL( EPhCltTypeVTStill );
+    CleanupStack::PushL( imageParams );
+    TInt ret = newBitmap->Handle();
+    imageParams->AddImageL( ret );
+    phCltImageHandler->SaveImages( *imageParams );
+    CleanupStack::PopAndDestroy( imageParams );
+    CleanupStack::PopAndDestroy( phCltImageHandler );
+
+    delete iBitmap;
+    iBitmap = NULL;
+
+    CleanupStack::PopAndDestroy( newBitmap );
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSBackgroundImage/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+                 GSBackgroundImage.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../rom/GSBackgroundImage.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsbackgroundimage.iby )
+
+PRJ_MMPFILES
+GSBackgroundImage.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSBackgroundImage/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSBackgroundImage_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Data/102824A5.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Call Divert settings plugin.
+*
+*/
+
+
+// INCLUDES
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x102824A5;
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x102824A6;
+					version_no          = 1;
+					display_name        = "Call Barring Plugin";
+					default_data        = "0x1020723D";//Parent UID
+					#ifdef RD_CONTROL_PANEL
+					    opaque_data         = "50";//Order number
+					#else
+					    opaque_data         = "30";//Order number
+					#endif //RD_CONTROL_PANEL
+					}
+				};
+			}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Data/GSCallBarringPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,610 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSCallBarringPlugin
+*
+*/
+
+//  RESOURCE IDENTIFIER
+NAME    CBAR // 4 letter ID
+
+//  INCLUDES
+#include     <bldvariant.hrh>
+
+#include    "CallBarringPlugin.hrh"
+
+#include    <callbarringplugin.loc>
+#include    <gs.loc>
+#include    <gscommon.hrh>
+#include    <gscommon.rh>
+#include    <GSApp.rsg>
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <gscallbarringplugin.mbg>
+#include    <uikon.rh>
+
+// CONSTANTS
+
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+RESOURCE TBUF
+    {
+    buf="CBAR";
+    }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+
+//----------------------------------------------------
+//  r_gs_call_barring_caption
+//
+// call barring caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_call_barring_caption
+    {
+    buf = qtn_set_folder_barring;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_barring_view
+//    Barring sub-menu view
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_barring_view
+    {
+    menubar=r_gs_menubar_barring_view;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CONTEXTOPTIONS;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_menubar_barring_view
+//    Barring menubar
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_gs_menubar_barring_view
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_exit;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_help;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_barring_view_menu;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_call_barring_msk_contextmenubar
+//    Barring menubar
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_call_barring_msk_contextmenubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_gs_barring_view_menu;
+            }
+        };
+    }
+//----------------------------------------------------
+//
+//    r_gs_barring_view_menu
+//    Barring menu items
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_barring_view_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EGSCmdBarringActivate;
+            txt = text_activate_barring;
+            },
+        MENU_ITEM
+            {
+            command = EGSCmdBarringCancel;
+            txt = text_cancel_barring;
+            },
+        MENU_ITEM
+            {
+            command = EGSCmdBarringInquiry;
+            txt = text_status_barring;
+#ifndef __RESTRICTED_CALL_BARRING
+            },
+        MENU_ITEM
+            {
+            command = EGSCmdBarringCancelAll;
+            txt = text_cancel_all_barrings;
+            },
+        MENU_ITEM
+            {
+            command = EGSCmdBarringChangePwd;
+            txt = qtn_barr_list_password;
+#endif // __RESTRICTED_CALL_BARRING
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_barring_view_title
+//    Barring sub-menu title
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_barring_view_title
+    {
+    txt = qtn_set_title_restrictions;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_barring_view_title_voip
+//    Barring sub-menu title
+//
+//----------------------------------------------------
+RESOURCE TITLE_PANE r_gs_barring_view_title_voip
+    {
+    txt = qtn_title_cell_call_barring;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_barring_lbx_resource
+//    Barring list box
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_barring_lbx_resource
+    {
+    array_id = r_barring_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_barring_lbx
+//    Barring list box items
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_barring_lbx
+    {
+    items =
+        {
+#ifndef __RESTRICTED_CALL_BARRING
+        LBUF
+            {
+            txt = " \t"text_no_outgoing"\t\t";
+            },
+        LBUF
+            {
+            txt = " \t"text_no_international"\t\t";
+            },
+        LBUF
+            {
+            txt = " \t"text_no_inter_but_home"\t\t";
+            },
+        LBUF
+            {
+            txt = " \t"text_no_incoming"\t\t";
+            },
+#endif // __RESTRICTED_CALL_BARRING
+        LBUF
+            {
+            txt = " \t"text_no_incom_if_roam"\t\t";
+            }
+        };
+    }
+
+
+//-----------------------------------------------------------------------------
+//
+//    r_activate_barring
+//    Popup-menu item for Barring operations
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_activate_barring
+    {
+    buf = text_activate_barring;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_cancel_barring
+//    Popup-menu item for Barring operations
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_cancel_barring
+    {
+    buf = text_cancel_barring;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_status_barring
+//    Popup-menu item for Barring operations
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_status_barring
+    {
+    buf = text_status_barring;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_barring_password
+//    Prompt item for Barring dialog when barring pwd required.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_barring_password
+    {
+    buf = text_password;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_current_barring_password
+//    Prompt item for Barring dialog when barring pwd required.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_current_barring_password
+    {
+    buf = text_old_pass;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_new_barring_password
+//    Prompt item for Barring dialog when barring pwd required.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_new_barring_password
+    {
+    buf = text_new_pass;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_verify_new_barring_password
+//    Prompt item for Barring dialog when barring pwd required.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_verify_new_barring_password
+    {
+    buf = text_verify_pass;
+    }
+
+//----------------------------------------------------
+//
+//    r_barring_password
+//    Dialog for querying Barring password
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_barring_password_dlg
+    {
+    flags = EEikDialogFlagVirtualInput | EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_DATA_QUERY
+                {
+                layout = EPinLayout;
+                label = text_password;
+                control = SECRETED {num_letters = 4;};
+                };
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_barring_main_view
+//    Barring sub-main-menu view
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_barring_main_view
+    {
+    menubar=r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_barring_main_view_title
+//    Barring sub-menu title
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_barring_main_view_title
+    {
+    txt = qtn_set_title_restrictions;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_barring_main_lbx_resource
+//    Barring list box
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_barring_main_lbx_resource
+    {
+    array_id = r_barring_main_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_barring_main_lbx
+//    Barring list box items
+//
+//-----------------------------------------------------------------------------
+//
+
+RESOURCE ARRAY r_barring_main_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_cell_call_barring"\t\t";
+            item = EGSCBCellular;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_voip_call_barring"\t\t";
+            item = EGSCBInternet;
+            type = EGSListBoxItemTypeIsDynamic;
+            }
+        };
+    }
+
+// BARRING sub-menu for internet call
+
+//----------------------------------------------------
+//
+//    r_gs_internet_barring_view
+//    Barring sub-menu view
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_internet_barring_view
+    {
+    menubar=r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_internet_barring_view_title
+//    Internet Barring sub-menu title
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_internet_barring_view_title
+    {
+    txt = qtn_title_voip_call_barring;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_internet_barring_lbx_resource
+//    Internet Barring list box
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_internet_barring_lbx_resource
+    {
+    array_id = r_internet_barring_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_internet_barring_lbx
+//    Internet Barring list box items
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_internet_barring_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_voip_barring_anonymous"\t\t";
+            item = EGSCBAnonymous;
+            type = EGSListBoxItemTypeIsDynamic;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_internet_barring_setting_page
+//    Internet barring setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_internet_barring_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_title_restrictions_int;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_internet_barring_setting_page_lbx
+//    for internet barring popup
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_internet_barring_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_voip_barring_active;
+            },
+        LBUF
+            {
+            txt = qtn_voip_barring_not_active;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_internet_barring_on
+//    anonymous setting value to internet barring setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_internet_barring_on
+    {
+    buf = qtn_voip_barring_active;
+    }
+
+//----------------------------------------------------
+//
+//    r_internet_barring_off
+//    anonymous setting value to internet barring setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_internet_barring_off
+    {
+    buf = qtn_voip_barring_not_active;
+    }
+
+//----------------------------------------------------
+//
+//    r_qtn_voip_sccp_call_barring_note
+//    Note for anonymous call barring
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_qtn_voip_sccp_call_barring_note
+    {
+    buf = qtn_voip_sccp_call_barring_note;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_barr_msk_change
+//    Middle softkey label: change.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_barr_msk_change
+    {
+    buf = qtn_msk_change;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_barr_msk_open
+//    Middle softkey label: open
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_barr_msk_open
+    {
+    buf = qtn_msk_open;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_call_softkey_option
+//    Middle softkey label: Options.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_call_softkey_option
+    {
+    buf = text_softkey_option;
+    }
+
+//----------------------------------------------------
+//  r_gs_tel_view_title
+//
+// Telephony view title
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_barr_view_title
+    {
+    txt = "";
+    }        
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/GSCallBarringPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallBarringPlugin project file.
+*
+*/
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gscallbarringplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x102824A5
+VENDORID            VID_DEFAULT
+
+SOURCEPATH  Src  // /GSCallBarringPlugin
+SOURCE      GSCallBarringPluginImplementationTable.cpp
+SOURCE      GSLocalBaseView.cpp
+SOURCE      GSCallBarringPluginContainer.cpp
+SOURCE      GSCallBarringPlugin.cpp
+SOURCE      GSCellularCallBarringContainer.cpp
+SOURCE      GSCellularCallBarringView.cpp
+SOURCE      GSMainBarringContainer.cpp
+SOURCE      GSMainBarringView.cpp
+SOURCE      GSInternetBarringContainer.cpp
+SOURCE      GSInternetBarringView.cpp
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Data
+USERINCLUDE     ../Logger
+USERINCLUDE     ../GSTelPlugin/Inc
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  102824A5.rss
+TARGET          gscallbarringplugin.rsc
+END
+
+START RESOURCE  GSCallBarringPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   centralrepository.lib
+LIBRARY   cenrepnotifhandler.lib
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   cone.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   eikctl.lib
+LIBRARY   etelmm.lib            // security, network, call
+LIBRARY   euser.lib
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   gsecomplugin.lib
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   phonesettings.lib
+LIBRARY   psui.lib              // phone settings notes UI
+LIBRARY   sssettings.lib        // Supplementary settings
+LIBRARY   numbergrouping.lib
+LIBRARY   flogger.lib           // For GSLogger
+
+LIBRARY   secui.lib             // for CodeQueryDialog
+
+LIBRARY   aknnotify.lib         // for CAknGlobalNote.h
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   apgrfx.lib
+
+
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+LIBRARY serviceprovidersettings.lib
+#endif // __VOIP && RD_VOIP_REL_2_2
+
+SOURCEPATH      Data
+DOCUMENT        102824A5.rss
+DOCUMENT        GSCallBarringPluginRsc.rss
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/CallBarringPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains definition of constants used in CallBarringPlugin.
+*
+*/
+
+#ifndef GSCALLBARRINGPLUGIN_HRH
+#define GSCALLBARRINGPLUGIN_HRH
+
+enum TGSCallBarringNotes
+    {
+    ECBActiveNote,
+    EPasswordErrorNote,
+    EPasswordChangedNote,
+    ECBNotActiveNote
+    };
+
+enum TGSCBMenuCommands
+    {
+    EGSCmdBarringActivate = 6,
+    EGSCmdBarringCancel,
+    EGSCmdBarringInquiry,
+    EGSCmdBarringChangePwd,
+    EGSCmdBarringCancelAll
+    };
+
+enum TGSMainBarringSetting
+    {
+    EGSCBCellular = 0,
+    EGSCBInternet
+    };
+
+enum TGSBarringSetting
+    {
+    EGSCBOutgoing = 0,
+    EGSCBInternational,
+    EGSCBInternationalExceptHome,
+    EGSCBIncoming,
+    EGSCBAbroad
+    };
+
+enum TGSInternetBarringSetting
+    {
+    EGSCBAnonymous
+    };
+
+enum TGSBarringSettingActions
+    {
+    EGSCBActive = 0,
+    EGSCBInactive = 1,
+    EGSCBStatus = 2,
+    EGSCBCancelAll = 3,
+    EGSCBChangePwd = 4
+    };
+
+enum TGSCBPasswordType
+    {
+    EGSCBNormalPw,
+    EGSCBCurrentPw,
+    EGSCBNewPw,
+    EGSCBVerifyPw
+    };
+    
+// Internet call barring    
+enum TGSVoIPCallBarring
+    {
+    EGSCSCallBarringOn = 0,     // Default
+    EGSCSCallBarringOff         
+    };
+
+// VoIP specific setting id's
+enum TGSVoIPSetting
+    {
+    EGSVoIPSendIntCallId = 0,
+    EGSVoIPCW,
+    EGSVoIPPreType,
+    EGSVoIPDnd,
+    EGSVoIPBarring
+    };
+
+#endif // GSCALLBARRINGPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSCALLBARRINGPLUGIN_H
+#define GSCALLBARRINGPLUGIN_H
+
+// INCLUDES
+#include <gsbaseview.h>
+#include <aknview.h>
+#include <gspubsubslistener.h>
+#include <mgssettingpsobserver.h>
+#include <PsetCSP.h>
+#include <PsetCallBarring.h>
+#include <etelmm.h>
+#include <eikclb.h>
+
+#include "GSLocalBaseView.h"
+#include "CallBarringPlugin.hrh"
+
+
+// FORWARD DECLARATIONS
+class CGSBaseContainer;
+class CGSCallBarringPluginContainer;
+class CPsetCustomerServiceProfile;
+class CAknNavigationDecorator;
+class CPsetContainer;
+class CPsuiContainer;
+class CPsuiBarringObs;
+class CAknStaticNoteDialog;
+class CAknNoteDialog;
+
+// CONSTANTS
+_LIT( KGSCallBarringPluginIconDirAndName, "z:GSCallBarringPlugin.mbm");
+
+
+// CLASS DECLARATION
+/***************************************************
+*     CGSCallBarringPlugin class                   *
+****************************************************/
+class CGSCallBarringPlugin : public CGSBaseView,
+                             public MGSSettingPSObserver
+    {
+    public: // Constructors and destructor
+
+        /* C++ Constructor */
+        CGSCallBarringPlugin();
+
+        /* Symbian OS two phase constructor - puts self into stack. 
+        *
+        * @return CGSCallBarringPlugin object
+        */
+        static CGSCallBarringPlugin* NewLC();
+
+        /**
+        * Destructor.
+        */
+        ~CGSCallBarringPlugin();
+        
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS call barring view.
+        */
+        static CGSCallBarringPlugin* NewL( TAny* aInitParams );
+        
+        /**
+        *
+        */
+        void HandleClientRectChange();
+
+    public: // Functions from base classes
+
+        /**
+        * From CAknView, returns the views id.
+        *
+        * @return Returns TUid, which is the id of the view.
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikCommandObserver, handles the commands given through menu.
+        *
+        * @param aCommand is the given command.
+        */
+        void HandleCommandL( TInt aCommand );
+        
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    public: //new
+        
+        /**
+        * This is a locally owned method used to activate
+        * other local views seen from GSTelPlugin
+        * @param aFeatureId feature ID of the folder
+        */
+        void ActivateInternalViewL();
+
+        /**
+        * This is a locally owned method used to initialize
+        * other local views seen from GSTelPlugin
+        * @param aLocalViewId view ID of local views to this plugin
+        */
+        void CreateLocalViewL( TUid aLocalViewId );
+        
+        /**
+        * Removes sub-views owned by this plugin to make sure sub-view UIDs do
+        * not clash.
+        */
+        void RemoveLocalViews();
+        
+        /**
+        *Is VoIP feature supported 
+        */
+        TBool VoipSupported() const;
+
+    protected: // from CAknView
+
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+    
+        void DoDeactivate();
+
+    private: // from base class
+
+        /**
+        * Symbian OS default constructor. 
+        *
+        */
+        void ConstructL();
+    
+        /**
+        * From CGSBaseView, handles selection of list box.
+        */
+        void HandleListBoxSelectionL();
+
+        void NewContainerL();
+    
+    private: // From MGSSettingPSObserver
+        /**
+        * Callback from MGSSettingPSObserver
+        */
+        void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
+                              const TRequestStatus& aStatus );
+        
+    private: //new
+        /**
+        * Retrieves container pointer.
+        */
+        CGSCallBarringPluginContainer*  Container();
+
+        /**
+        * Customer Service Profile status setting
+        */
+        void SetCSPActiveL( TBool aValue );
+
+    private: // Member variables
+        //Navi pane
+        CAknNavigationDecorator* iNaviPaneContext;
+        //PubSub object for BT SAP state
+        CGSPubSubsListener* iBtSapListener;
+        //check if CSP is active
+        CPsetCustomerServiceProfile* iCSP;
+        // Call barring view. Not owned by this - owned by iAppUi.
+        CGSLocalBaseView* iBarringView;
+        // check if voip supported
+        TBool iVoipSupported;
+    };
+
+#endif //GSCALLBARRINGPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSCALLBARRINGPLUGINCONTAINER_H
+#define GSCALLBARRINGPLUGINCONTAINER_H
+
+// INCLUDES
+#include "gsbasecontainer.h"
+#include "GSPhoneSettingConstants.h"
+
+// FORWARD DECLARATIOIN
+class CGSListBoxItemTextArray;
+
+// CLASS DECLARATION
+
+/**
+* CGSCallBarringPluginContainer container class
+*/
+class CGSCallBarringPluginContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor. 
+        *
+        * @param aRect gives the correct TRect for construction.
+        */
+        void ConstructL( const TRect& aRect );
+
+        /* Destructor */
+        ~CGSCallBarringPluginContainer();
+
+    public:  //from CGSBaseContainer
+
+        /* 
+        * Creates list box object.
+        * @param aResLbxId resource list id to create list box.
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private: //new
+
+        /**
+        * Required for help.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    private: //member variables
+        //listbox array
+        CGSListBoxItemTextArray* iListboxItemArray;
+        //Is VoIP supported (feature on, dynamic voip setting on)
+        TBool iVoIPSupported;        
+    };
+
+#endif //GSCALLBARRINGPLUGINCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSSETTLISTBARRINGCONTAINER_H
+#define GSSETTLISTBARRINGCONTAINER_H
+
+// INCLUDES
+#include "gsbasecontainer.h"
+#include "GSPhoneSettingConstants.h"
+
+// CLASS DECLARATION
+
+/**
+* CGSSettListBarringContainer container class
+*/
+class CGSSettListBarringContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor. 
+        *
+        * @param aRect gives the correct TRect for construction.
+        */
+        void ConstructL( const TRect& aRect );
+
+        /* Destructor */
+        ~CGSSettListBarringContainer();
+
+    public:  //from CGSBaseContainer
+
+        /* 
+        * Creates list box object.
+        * @param aResLbxId resource list id to create list box.
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private: //new
+
+        /*
+        * Creates items for the list box.
+        */
+        void CreateListBoxItemsL();
+
+        /**
+        * Required for help.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    private: //member variables
+        //Resource texts for setting items
+        CDesCArrayFlat*         iItems;
+        //Setting items
+        CDesCArray*             iItemArray;
+    };
+
+#endif //GSSETTLISTBARRINGCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSSETTLISTBARRINGVIEW_H
+#define GSSETTLISTBARRINGVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include <PsetCallBarring.h>
+#include <etelmm.h>
+#include <eikclb.h>
+
+#include "GSLocalBaseView.h"
+#include "CallBarringPlugin.hrh"
+
+// FORWARD DECLARATIONS
+class CGSBaseContainer;
+class CGSSettListBarringContainer;
+class CAknNavigationDecorator;
+class CPsetContainer;
+class CPsuiContainer;
+class CPsuiBarringObs;
+class CAknStaticNoteDialog;
+class CAknNoteDialog;
+
+// CLASS DECLARATION
+/***************************************************
+*     CGSSettListBarringView view class            *
+***************************************************/
+class CGSSettListBarringView : public CGSLocalBaseView
+    {
+    public: // Constructors and destructor
+
+        /* C++ Constructor */
+        CGSSettListBarringView();
+
+        /**
+        * Symbian OS two phased constructor.
+        */
+        static CGSSettListBarringView* NewL();
+
+        /* Symbian OS two phase constructor - puts self into stack. 
+        *
+        * @return CGSSettListBarringView object
+        */
+        static CGSSettListBarringView* NewLC();
+
+        /**
+        * Destructor.
+        */
+        ~CGSSettListBarringView();
+
+    public: // Functions from base classes
+
+        /**
+        * From CAknView, returns the views id.
+        *
+        * @return Returns TUid, which is the id of the view.
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikCommandObserver, handles the commands given through menu.
+        *
+        * @param aCommand is the given command.
+        */
+        void HandleCommandL( TInt aCommand );
+		/**
+        * From MEikCommandObserver, handles the commands.
+        *
+        * @param aCommand identifies the command given.
+        */
+        void ProcessCommandL( TInt aCommand );
+
+    public: //new
+        
+        /**
+        * Creates the barring password query. 
+        * 
+        * @param aBarringPassword is user inputed password
+        * @param aTitleID is type of password query 
+        * @return softkey pressed in pwd query
+        */
+        TInt BarringPasswordQueryL( TBarringPassword& aBarringPassword,    
+                                    const TInt& aTitleID );
+
+    protected: // from CAknView
+
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+    
+        void DoDeactivate();
+
+       
+    private:
+    
+        /**
+        * Adds item to a list
+        * @param aList pointer to a list
+        * @param aItem resource ID of the item text
+        */
+        void AppendItemL( CDesCArrayFlat& aList, const TInt aItem );
+
+        /**
+        * Selects barring type
+        * @param aCommand user action
+        * @param aBarringSetting barring type is set into this
+        * @param aType value used for mapping the current type
+        */
+        void SetBarringType( TInt& aCommand, 
+            TCallBarringSetting& aBarringSetting, 
+            TGSBarringSetting aType );
+
+        /**
+        * Handles barring operation requests
+        * @param aBarringSetting barring settings (e.g. pwd) passed to TSY
+        * @param aBsc basic service groups
+        */
+        void HandleBarringOperationL( TCallBarringSetting aBarringSetting,
+            TBasicServiceGroups aBsc );
+
+        /** 
+        * Creates a request to cancel all barrings.
+        *
+        */
+        void CancelAllBarringsL();
+
+        /**
+        * Handles changing of barring password.
+        *
+        */
+        void ChangeBarringPwdL();
+
+    private: // From MEikMenuObserver
+        
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+    
+    private: // from base class
+
+        /**
+        * Symbian OS default constructor. 
+        *
+        */
+        void ConstructL();
+    
+        /**
+        * From CGSBaseView, handles selection of list box.
+        */
+        void HandleListBoxSelectionL();
+
+        void NewContainerL();
+
+    private: // Member variables
+        //Navi pane
+        CAknNavigationDecorator* iNaviPaneContext;
+        //Pointer to PhoneSetting's barring object
+        CPsetCallBarring*   iBarring;
+        //Pointer to PhoneSetting's container
+        CPsetContainer*     iSettings;
+        //Pointer to PSUI's container
+        CPsuiContainer*     iObsContainer;
+        //Pointer to PSUI's barring object
+        CPsuiBarringObs*    iCbObserver;
+        //Has selection key been pressed
+        TBool               iRockerPress;
+        //Has context menu initialized
+        TBool               iContextMenuInitialized;
+    };
+
+#endif //GSSETTLISTBARRINGVIEW_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Int. Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef __GSSETTLISTINTERNETBARRINGCONTAINER_H__
+#define __GSSETTLISTINTERNETBARRINGCONTAINER_H__
+
+// INCLUDES
+#include "gsbasecontainer.h"
+#include "GSPhoneSettingConstants.h"
+#include "CallBarringPlugin.hrh"
+#include <centralrepository.h>
+// CLASS DECLARATION
+class CGSListBoxItemTextArray;
+
+/**
+* CGSSettListInternetBarringContainer container class
+* @since 3.0
+*/
+class CGSSettListInternetBarringContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor. 
+        *
+        * @param aRect gives the correct TRect for construction.
+        */
+        void ConstructL( const TRect& aRect );
+
+        /* Destructor */
+        ~CGSSettListInternetBarringContainer();
+
+    public:  //from CGSBaseContainer
+
+        /* 
+        * Creates list box object.
+        * @param aResLbxId resource list id to create list box.
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+        
+        void UpdateListBoxL();
+    
+    public: // New
+    
+    		/** 
+        * Returns one of the VoIP call related values from Cent. Repository
+        * @param aVoipSettingId name of the Cent. Repository key to fetch
+        * @param aVoipId value of Cent. Repository key
+        * @return KErrNone if successful
+        */
+        TInt GetVoIPCallSettingValue( 
+            const TGSVoIPSetting aVoipSettingId, 
+            TInt& aVoipId );        
+                
+        /** 
+        * Sets one of the VoIP call related values from Cent. Repository
+        * @param aVoipSettingId name of the Cent. Repository key to set
+        * @param aVoipId value of Cent. Repository key
+        * @return KErrNone if successful
+        */
+        TInt SetVoIPCallSettingValue( 
+            const TGSVoIPSetting aVoipSettingId, 
+            TInt aVoipId ); 
+            
+        /**
+        * Gets SCCP status from Central Repository
+        * @param aStatus value of Cent. Repository key
+        * @return KErrNone if successful
+        */    
+        TInt GetSCCPStatus( TInt& aStatus );
+
+    private: //new
+
+        /*
+        * Creates items for the list box.
+        */
+        void CreateListBoxItemsL();
+
+        /**
+        * Required for help.
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+        
+        /*
+        * Creates anonymous item.
+        */
+        void MakeAnonymousItemL();
+        
+        /*
+        * Converting value
+        */
+        void SwitchValue( TInt& aValue );
+
+
+    private: // member variables
+    
+        //Resource texts for setting items
+        CDesCArrayFlat*          iItems;
+        // Listbox item array.
+        CGSListBoxItemTextArray* iListboxItemArray;
+        //CenRep handle
+        CRepository* iRichCallRepository;
+        CRepository* iTelephonyRepository;
+    };
+
+#endif //GSINTERNETBARRINGCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Internet Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef __GSSETTLISTINTERNETBARRINGVIEW_H
+#define __GSSETTLISTINTERNETBARRINGVIEW_H
+
+// INCLUDES
+#include "GSLocalBaseView.h"
+
+// FORWARD DECLARATIONS
+class CGSSettListInternetBarringContainer;
+class CAknRadioButtonSettingPage;
+class CAknNoteDialog;
+class CAknPopupList;
+class CGSTelPluginModel;
+
+// CLASS DECLARATION
+
+/**
+* CGSSettListInternetBarringView view class
+* @since 3.0
+*/
+
+class CGSSettListInternetBarringView : public CGSLocalBaseView
+    {
+    public: // Constructors and destructor
+
+        /* C++ Constructor */
+        CGSSettListInternetBarringView();
+
+        /**
+        * Symbian OS two phased constructor.
+        */
+        static CGSSettListInternetBarringView* NewL();
+
+        /* Symbian OS two phase constructor - puts self into stack. 
+        *
+        * @return CGSSettListInternetBarringView object
+        */
+        static CGSSettListInternetBarringView* NewLC();
+
+        /**
+        * Destructor.
+        */
+        ~CGSSettListInternetBarringView();
+
+    public: // Functions from base classes
+
+        /**
+        * From CAknView, returns the views id.
+        *
+        * @return Returns TUid, which is the id of the view.
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikCommandObserver, handles the commands given through menu.
+        *
+        * @param aCommand is the given command.
+        */
+        void HandleCommandL( TInt aCommand );
+
+    private:
+        /**
+        * Symbian OS default constructor. 
+        *
+        */
+        void ConstructL();
+    
+        /**
+        * From CGSBaseView, handles selection of list box.
+        */
+        void HandleListBoxSelectionL();
+        
+        /**
+        * Show Internet barring setting page.
+        */
+        void ShowSettingPageL();
+        
+        /**
+        * Adds item to a list
+        * @param aList reference to a list
+        * @param aItem resource ID of the item to be added
+        */
+        void AppendItemL( CDesCArrayFlat& aList, TInt aItem );
+
+    private: // From MEikMenuObserver
+        
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+    
+    private: // from CGSBaseView
+
+        void NewContainerL();
+        
+
+    private: // from CAknView
+    
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+    
+        void DoDeactivate();
+
+    private: // Member variables
+    
+        //GSTelPluginModel for settings from Central Repository
+        CGSTelPluginModel* iModel;
+    };
+
+#endif // GSINTERNETBARRINGVIEW_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSLocalBaseView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base vew in GSCallBarringPlugin.
+*
+*/
+
+
+#ifndef GSLOCALBASEVIEW_H
+#define GSLOCALBASEVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include <etelmm.h>
+#include <eikclb.h>
+
+// FORWARD DECLARATIONS
+class CGSBaseContainer;
+class CAknNavigationDecorator;
+class CAknViewAppUi;
+
+// CLASS DECLARATION
+/***************************************************
+*     CGSLocalBaseView view class            *
+***************************************************/
+class CGSLocalBaseView : public CAknView,
+                         public MEikListBoxObserver
+    {
+    public:
+        // Panic code used in this class
+        enum KGSViewPanicCodes
+            {
+            EGSViewPanicNullPtr = 1
+            };
+
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor. 
+        *
+        */
+        virtual void ConstructL()=0;
+
+        /* C++ Constructor */
+        CGSLocalBaseView();
+
+        /**
+        * Destructor.
+        */
+        ~CGSLocalBaseView();
+
+    public:
+
+        /**
+        * This function is used to set the current item in the listbox.
+        * @param aIndex Current item. Default value is 0 i.e. the first item of the list.
+        * 
+        */
+        virtual void SetCurrentItem( TInt aIndex = 0 );
+
+    protected: // from CAknView
+
+        /**
+        * Handles client rect change.
+        * 
+        */
+        void HandleClientRectChange();
+
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+    
+        void DoDeactivate();
+
+    protected: // from MEikListBoxObserver
+
+        /**
+        * Handles listbox events.
+        * @param aListBox Listbox where the event occurred.
+        * @param aEventType Event type.
+        * 
+        */
+        void HandleListBoxEventL( CEikListBox* aListBox,
+                                  TListBoxEvent aEventType );
+        
+    protected: //new
+
+        /**
+        * Sets the correct navi pane for the view (eg. tabs, empty, string etc.)
+        * 
+        */
+        virtual void SetNaviPaneL();
+
+        /**
+        * Creates context for view's navi pane.
+        * @param aResourceId Resource id for navi pane context's resource.
+        * 
+        */
+        virtual void CreateNaviPaneContextL( TInt aResourceId );
+
+    protected:
+        // Called by DoActivateL
+        virtual void NewContainerL() = 0;
+        virtual void CreateContainerL();
+
+    private:
+    
+        /**
+        * Handles selection of list box.
+        * Called by HandleListBoxEventL
+        */
+        virtual void HandleListBoxSelectionL() = 0;        
+
+    protected: // Member variables
+        //Navi pane
+        CAknNavigationDecorator* iNaviPaneContext;
+        //Handle to get the view
+        CAknViewAppUi*      iAppUi;
+        // currently selected listbox item
+        TInt                iCurrentItem;
+        // first item in the listbox
+        TInt                iTopItemIndex;
+        // pointer to the container
+        CGSBaseContainer*   iContainer;
+    };
+//end of file
+#endif //GSLOCALBASEVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Main Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSSETTLISTMAINBARRINGCONTAINER_H
+#define GSSETTLISTMAINBARRINGCONTAINER_H
+
+// INCLUDES
+#include "gsbasecontainer.h"
+#include "GSPhoneSettingConstants.h"
+
+// CLASS DECLARATION
+class CGSListBoxItemTextArray;
+
+/**
+* CGSSettListMainBarringContainer container class
+* @since 3.0
+*/
+class CGSSettListMainBarringContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor. 
+        *
+        * @param aRect gives the correct TRect for construction.
+        */
+        void ConstructL( const TRect& aRect );
+
+        /* Destructor */
+        ~CGSSettListMainBarringContainer();
+
+    public:  //from CGSBaseContainer
+
+        /* 
+        * Creates list box object.
+        * @param aResLbxId resource list id to create list box.
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+        /**
+        * Retrieves the feature id for the selected item in the listbox
+        * @return listbox item array's current feature.
+        */
+        TInt CurrentFeatureId() const;
+
+    private: //new
+
+        /*
+        * Creates items for the list box.
+        */
+        void CreateListBoxItemsL();
+
+        /**
+        * Required for help.
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+
+    private: //member variables
+    
+        //Resource texts for setting items
+        CDesCArrayFlat*          iItems;
+        
+        //Setting items
+        CDesCArray*              iItemArray;
+        CGSListBoxItemTextArray* iListboxItemArray;
+        
+        //BtSapConnectionState
+        TInt                     iBtSapConnectionState;
+    };
+
+#endif //GSSETTLISTMAINBARRINGCONTAINER_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main Barrings sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSSETTLISTMAINBARRINGVIEW_H
+#define GSSETTLISTMAINBARRINGVIEW_H
+
+// INCLUDES
+#include "GSLocalBaseView.h"
+#include <aknview.h>
+
+// FORWARD DECLARATIONS
+class CGSSettListMainBarringContainer;
+class CAknView;
+
+// CLASS DECLARATION
+
+/**
+* CGSSettListMainBarringView view class
+* @since 3.0
+*/
+class CGSSettListMainBarringView : public CGSLocalBaseView
+    {
+    public: // Constructors and destructor
+
+        /* C++ Constructor */
+        CGSSettListMainBarringView();
+
+        /* Symbian OS two phase constructor - puts self into stack. 
+        *
+        * @return CGSSettListMainBarringView object
+        */
+        static CGSSettListMainBarringView* NewLC();
+
+        /**
+        * Destructor.
+        */
+        ~CGSSettListMainBarringView();
+
+    public: // Functions from base classes
+
+        /**
+        * From CAknView, returns the views id.
+        *
+        * @return Returns TUid, which is the id of the view.
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikCommandObserver, handles the commands given through menu.
+        *
+        * @param aCommand is the given command.
+        */
+        void HandleCommandL( TInt aCommand );
+
+		/**
+        * From MEikCommandObserver, handles the commands.
+        *
+        * @param aCommand identifies the command given.
+        */
+        
+        void ProcessCommandL( TInt aCommand );
+
+    private:
+
+        /**
+        * Symbian OS default constructor. 
+        *
+        */
+        void ConstructL();
+    
+        /**
+        * From CGSLocalBaseView, handles selection of list box.
+        */
+        void HandleListBoxSelectionL();
+    
+        /**
+        * Retrieves container pointer.
+        */
+        CGSSettListMainBarringContainer*  Container();
+
+
+    private: // From MEikMenuObserver
+        
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+    
+    private: // from CGSLocalBaseView
+
+        void NewContainerL();
+
+    private: // from CAknView
+    
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+    
+        void DoDeactivate();
+
+    private: // Member variables
+    
+        // Call barring view. Not owned by this - owned by iAppUi.
+        CAknView* iBarringView;
+        
+        // Internet call barring view. Not owned by this - owned by iAppUi.
+        CAknView* iInternetBarringView;
+            
+    };
+
+#endif //GSSETTLISTMAINBARRINGVIEW_H
+
+//End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/LocalViewIds.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View ID's for Call Barring views.
+*
+*/
+
+
+#ifndef  CBLOCALVIEWID_H
+#define  CBLOCALVIEWID_H
+
+const TUid KCallBarringPluginId = {0x102824A5};
+const TUid KCallBarringViewId = {83};
+const TUid KCallMainBarringViewId = {86};
+const TUid KCallInternetBarringViewId = {87};
+
+#endif //CBLOCALVIEWID_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,530 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for the Barring folder
+*
+*/
+
+ 
+// INCLUDE FILES
+#include "GSCallBarringPlugin.h"
+#include "GSCallBarringPluginContainer.h"
+#include "GSPhoneSettingConstants.h"
+#include "GSInternetBarringView.h"
+#include "GSCellularCallBarringView.h"
+#include "GSMainBarringView.h"
+#include "CallBarringPlugin.hrh"
+#include "LocalViewIds.h"
+#include "GsLogger.h"
+
+#include <coeaui.h>
+#include <hlplch.h>                 // For HlpLauncher
+#include <e32base.h>
+#include <featmgr.h>
+#include <exterror.h>               //for extended error codes
+#include <StringLoader.h>           //for StringLoader
+#include <PsetContainer.h>          //for CPsetContainer
+#include <PsuiContainer.h>          //for CPsuiContainer
+#include <eikmenup.h>               //for menu bar
+#include <SecUiCodeQueryDialog.h>
+#include <nwdefs.h>
+#include <aknViewAppUi.h>
+
+#include <gscommon.hrh>
+#include <GSCallBarringPluginRsc.rsg>
+#include <gscallbarringplugin.mbg>
+#include <gsfwviewuids.h>
+#include <gsprivatepluginproviderids.h>
+#include <BTSapInternalPSKeys.h>
+#include <centralrepository.h>
+#include <settingsinternalcrkeys.h>
+
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+#include <spsettings.h>
+#endif // __VOIP && RD_VOIP_REL_2_2
+// LOCAL CONSTANTS
+_LIT( KGSCallBarringPluginResourceFileName, "z:GSCallBarringPluginRsc.rsc" );
+_LIT( KGSNameOfClass, "CGSCallBarringPlugin" );
+
+enum
+    {
+    EGSCallBarringPluginPanicNullPtr
+    };
+ 
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+// 
+// C++ constructor.
+// 
+// ---------------------------------------------------------------------------
+CGSCallBarringPlugin::CGSCallBarringPlugin()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two-phased constructor (second phase)
+// 
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::ConstructL()
+    {
+    __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::ConstructL");
+    FeatureManager::InitializeLibL();
+    OpenLocalizedResourceFileL( KGSCallBarringPluginResourceFileName,
+                                iResourceLoader );
+    //PS listener initialization
+    iBtSapListener = CGSPubSubsListener::NewL( 
+                     KPSUidBluetoothSapConnectionState,
+                     KBTSapConnectionState, this );
+    SetCSPActiveL( ETrue );
+    iBarringView = NULL;
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+    iVoipSupported = EFalse;
+    CSPSettings* spSettings = CSPSettings::NewL();
+    if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
+        spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) )
+        {
+        iVoipSupported = ETrue;
+        }
+    delete spSettings;
+#else // __VOIP && RD_VOIP_REL_2_2
+    if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        TInt supported( KGSSettingOff );
+        CRepository* telephonyrep = 
+            CRepository::NewL( KCRUidTelephonySettings );
+        telephonyrep->Get( KDynamicVoIP, supported );
+        iVoipSupported = KGSSettingOff != supported;
+        delete telephonyrep;
+        }
+#endif // __VOIP && RD_VOIP_REL_2_2
+    BaseConstructL( R_GS_BARRING_MAIN_VIEW );
+    // VoIP feature supported
+    __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::ConstructL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::NewL()
+//
+// Symbian OS default constructor
+// ---------------------------------------------------------------------------
+CGSCallBarringPlugin* CGSCallBarringPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSCallBarringPlugin* self = new( ELeave ) CGSCallBarringPlugin();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two-phased constructor (first phase)
+// 
+// ---------------------------------------------------------------------------
+CGSCallBarringPlugin* CGSCallBarringPlugin::NewLC()
+    {
+    __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::NewLC");
+    CGSCallBarringPlugin* self = new ( ELeave ) CGSCallBarringPlugin;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::NewLC");
+    return self;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// C++ destructor
+// 
+// ---------------------------------------------------------------------------
+CGSCallBarringPlugin::~CGSCallBarringPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    TRAP_IGNORE( SetCSPActiveL( EFalse ) );
+    if ( iBtSapListener )
+        {
+        delete iBtSapListener;
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Returns Id of the Barring view.
+// 
+// ---------------------------------------------------------------------------
+TUid CGSCallBarringPlugin::Id() const
+    {
+    return KCallBarringPluginId;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Handles other than list box events.
+// 
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::HandleCommandL( TInt aCommand )
+    {
+    __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::HandleCommandL");
+		switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            RemoveLocalViews();
+            iAppUi->ActivateLocalViewL( KGSMainViewUid );
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::HandleCommandL");
+    }
+  
+// ---------------------------------------------------------------------------
+// 
+// Activates view.
+// 
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                        TUid aCustomMessageId,
+                                        const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::DoActivateL");
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+    ActivateInternalViewL();
+    __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::DoActivateL");
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Deactivates view.
+// 
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::DoDeactivate");
+    CGSBaseView::DoDeactivate();
+    __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::DoDeactivate");
+    }
+ 
+ 
+// ---------------------------------------------------------------------------
+// 
+// Creates new iContainer.
+// 
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::NewContainerL()
+    {
+    iContainer = new (ELeave) CGSCallBarringPluginContainer();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::Container
+//
+// Returns call container item
+// ---------------------------------------------------------------------------
+//
+CGSCallBarringPluginContainer* CGSCallBarringPlugin::Container()
+    {
+    return static_cast <CGSCallBarringPluginContainer*> ( iContainer );
+    }
+
+// ========================= from CGSPluginInterface ==================
+
+// ----------------------------------------------------------------------------
+// CGSCallBarringPlugin::GetCaption
+//
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CGSCallBarringPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_CALL_BARRING_CAPTION );
+
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallBarringPlugin::PluginProviderCategory
+//
+// A means to identify the location of this plug-in in the framework.
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallBarringPlugin::PluginProviderCategory() const
+    {
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallBarringPlugin::Visible
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSCallBarringPlugin::Visible() const
+    {
+    TBool result( ETrue );
+    TInt value = 0;
+    RProperty::Get( KPSUidBluetoothSapConnectionState, 
+                    KBTSapConnectionState, value );
+    if ( value == EBTSapNotConnected || value == EBTSapConnecting )
+        {
+        //Now checking also for CSP support
+        __ASSERT_ALWAYS( iCSP != NULL, User::Panic( KGSNameOfClass, 
+                                   EGSCallBarringPluginPanicNullPtr ) );
+        TInt err = KErrNone;
+        err = iCSP->IsCBSupported( result );
+        //CSP modifies result value even if something goes wrong
+        //CSP will return KErrNotSupported (-5) in cases when
+        //it is not possible to read CSP values from SIM card
+        //Call Barring should be still displayed in this case
+        if ( err != KErrNone )
+            {
+            result = ETrue;
+            }
+        }
+    else
+        {
+        result = EFalse;
+        }
+    return result;    
+    }    
+
+// -----------------------------------------------------------------------------
+// CGSCallBarringPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSCallBarringPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSCallBarringPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetBarrSub,
+        fp->FullName(),
+        EMbmGscallbarringpluginQgn_prop_set_barr_sub,
+        EMbmGscallbarringpluginQgn_prop_set_barr_sub_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::HandleNotifyPSL
+//
+// Handling PS keys change
+// ---------------------------------------------------------------------------
+//  
+void CGSCallBarringPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey,
+                                          const TRequestStatus& /* aStatus */ )
+    {
+    if ( aUid == KPSUidBluetoothSapConnectionState && 
+         aKey == KBTSapConnectionState )
+        {
+        Visible();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallBarringPlugin::SetCSPActiveL
+// 
+// Set Customer Service Profile active
+// ----------------------------------------------------------------------------
+//
+void CGSCallBarringPlugin::SetCSPActiveL( TBool aValue )
+    {
+    if ( aValue )
+        {
+        iCSP = CPsetCustomerServiceProfile::NewL();
+        User::LeaveIfError( iCSP->OpenCSProfileL() );
+        }
+    else
+        {        
+        delete iCSP;
+        iCSP = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::HandleClientRectChange
+//
+// Handle changes to rect().
+// ---------------------------------------------------------------------------
+//
+void CGSCallBarringPlugin::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::ActivateInternalViewL
+//
+// Activate local views within this plug-in.
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::ActivateInternalViewL()
+    {
+    TInt btSapState = 0; 
+    RProperty::Get( KPSUidBluetoothSapConnectionState,
+                    KBTSapConnectionState,
+                    btSapState );
+
+    if ( iVoipSupported )
+        {
+        CreateLocalViewL( KCallMainBarringViewId );
+        }
+    else
+        {
+        if ( btSapState == EBTSapNotConnected )
+            {
+            CreateLocalViewL( KCallBarringViewId );
+            }
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::CreateLocalViewL
+//
+// Initializes local views within this plug-in based on the view ID.
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::CreateLocalViewL( TUid aLocalViewId )
+    {
+    CGSLocalBaseView* view;
+
+    // Check if the view exists. If view does not exist:
+    // 1. Create the view
+    // 2. Add view to cleanupstack (NewLC)
+    // 3. Add view to iAppUi -> iAppUi takes the view ownership.
+    // 4. Remove view from cleanupstack
+    // 5. Assign pointer of created view to member variable
+    //
+    if ( aLocalViewId == KCallBarringViewId )
+        {
+        //Check if BarringView already exists
+        if ( !iBarringView )
+            {
+            view = CGSSettListBarringView::NewLC();
+            iAppUi->AddViewL( view );
+            CleanupStack::Pop( view );
+            iBarringView = view;
+            }
+        iAppUi->ActivateLocalViewL( aLocalViewId );
+        }
+    else if ( aLocalViewId == KCallMainBarringViewId )
+        {
+        TUid viewId = aLocalViewId;
+        if ( !iBarringView )
+            {            
+            if ( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) )
+                {
+                // create the barring view directly if it's in restricted
+                // call barring
+                view = CGSSettListBarringView::NewLC();
+                viewId = view->Id();
+                }
+            else
+                {
+                view = CGSSettListMainBarringView::NewLC();
+                }
+            iAppUi->AddViewL( view );
+            CleanupStack::Pop( view );
+            iBarringView = view;    
+            }
+        // Activate the correct view in case restricted call barring is
+        // active
+        iAppUi->ActivateLocalViewL( viewId );    
+        }
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::RemoveLocalViews
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallBarringPlugin::RemoveLocalViews()
+    {
+    // Remove view from iAppUi -> View is deleted by iAppUi automatically.
+    if ( iBarringView )
+        {
+        if ( iVoipSupported )
+            {
+            iAppUi->RemoveView( KCallMainBarringViewId );// Also deletes view.
+            }
+        else
+            {
+            iAppUi->RemoveView( KCallBarringViewId );// Also deletes view.
+            }    
+        iBarringView = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::HandleListBoxSelectionL
+//
+// Handle any user actions while in the list view.
+// ---------------------------------------------------------------------------
+void CGSCallBarringPlugin::HandleListBoxSelectionL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPlugin::VoIPSupported
+//
+// Is VoIP feature supported.
+// ---------------------------------------------------------------------------
+
+TBool CGSCallBarringPlugin::VoipSupported() const 
+    {
+    return iVoipSupported;
+    }
+
+ // End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Barring folder
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSCallBarringPluginContainer.h"
+
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <GSCallBarringPluginRsc.rsg>
+#include <csxhelp/cp.hlp.hrh>
+#include <featmgr.h>
+#include <gsfwviewuids.h>
+#include <gslistbox.h>
+
+#include <centralrepository.h>
+#include <settingsinternalcrkeys.h>
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+#include <spsettings.h>
+#endif // __VOIP && RD_VOIP_REL_2_2
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+void CGSCallBarringPluginContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSingleLargeStyleListBox;
+    BaseConstructL( aRect, R_GS_BARR_VIEW_TITLE, R_INTERNET_BARRING_LBX );
+
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+    iVoIPSupported = EFalse;
+    CSPSettings* spSettings = CSPSettings::NewL();
+    if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
+        spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) )
+        {
+        iVoIPSupported = ETrue;
+        }
+#else // __VOIP && RD_VOIP_REL_2_2
+    if ( FeatureManager::FeatureSupported ( KFeatureIdCommonVoip ) )
+        {
+        TInt supported( KGSSettingOff );
+        CRepository* telephonyrep = 
+            CRepository::NewL( KCRUidTelephonySettings );
+        telephonyrep->Get( KDynamicVoIP, supported );
+        iVoIPSupported = KGSSettingOff != supported;
+        delete telephonyrep;
+        }
+#endif // __VOIP && RD_VOIP_REL_2_2
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Destructor
+//  
+// ---------------------------------------------------------------------------
+CGSCallBarringPluginContainer::~CGSCallBarringPluginContainer()
+    {
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    }
+// ---------------------------------------------------------------------------
+// 
+// Creates list box
+//  
+// ---------------------------------------------------------------------------
+void CGSCallBarringPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    iListBox->ConstructL( this );
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
+        *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallBarringPluginContainer::GetHelpContext
+// Gets Help Context
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSCallBarringPluginContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    if ( iVoIPSupported )
+        {
+        aContext.iMajor = KUidGS;
+        aContext.iContext = KDIV_HLP_BARRING_MAIN;
+        }
+    else
+        {
+        aContext.iMajor = KUidGS;
+        aContext.iContext = KSET_HLP_BARRING_SETTINGS;
+        }
+    }
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSCallBarringPlugin.h"
+
+// Constants
+const TImplementationProxy KGSCallBarringPluginImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x102824A6, CGSCallBarringPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                  TInt& aTableCount )
+    {
+    aTableCount = sizeof( KGSCallBarringPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+    return KGSCallBarringPluginImplementationTable;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Barring folder
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSCellularCallBarringContainer.h"
+
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <GSCallBarringPluginRsc.rsg>
+#include <csxhelp/cp.hlp.hrh>
+#include <gsfwviewuids.h>
+#include "LocalViewIds.h"
+#include "GSCallBarringPlugin.h"
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+
+    TInt resTitleId = R_GS_BARRING_VIEW_TITLE;
+    
+    CGSCallBarringPlugin* plugin = static_cast<CGSCallBarringPlugin*>
+      ( ( static_cast<CAknViewAppUi*>( iCoeEnv->AppUi() ) )
+              ->View( KCallBarringPluginId ) ); 
+    
+    if ( plugin && plugin->VoipSupported() )
+        {
+        resTitleId = R_GS_BARRING_VIEW_TITLE_VOIP;
+        }
+    
+    BaseConstructL( aRect, 
+                    resTitleId, 
+                    R_BARRING_LBX_RESOURCE );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Destructor
+//  
+// ---------------------------------------------------------------------------
+CGSSettListBarringContainer::~CGSSettListBarringContainer()
+    {
+    if ( iItems )
+        {
+        delete iItems;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates list box
+//  
+// ---------------------------------------------------------------------------
+void CGSSettListBarringContainer::ConstructListBoxL( TInt /*aResLbxId*/ )
+    {        
+    iListBox->ConstructL( this, EAknListBoxSelectionList); 
+    iItemArray = static_cast <CDesCArray*> 
+        ( iListBox->Model()->ItemTextArray() );
+    iItems = iCoeEnv->ReadDesC16ArrayResourceL( R_BARRING_LBX );
+
+    CreateListBoxItemsL();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates List box items
+//  
+// ---------------------------------------------------------------------------
+void CGSSettListBarringContainer::CreateListBoxItemsL()
+    {
+    TInt placeInArray = 0;
+    TSettingItem readItem;
+    for ( TInt i = 0; i < iItems->Count(); i++ )
+        {
+        readItem = ( *iItems ) [ i ]; 
+        iItemArray->InsertL( placeInArray++, readItem ); 
+        }
+    iListBox->HandleItemAdditionL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListBarringContainer::GetHelpContext
+// Gets Help Context
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSSettListBarringContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KSET_HLP_BARRING_SETTINGS;
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,575 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for the Barring folder
+*
+*/
+
+ 
+// INCLUDE FILES
+#include "GSCellularCallBarringView.h"  //for CGSSettListBarringView
+#include "GSCellularCallBarringContainer.h"//for CGSBaseContainer
+#include "GSPhoneSettingConstants.h"  //for constant values
+#include "GSCallBarringPlugin.h"            //for plugin UID
+#include "GsLogger.h"
+#include "LocalViewIds.h"           //for KTellBarringViewId
+
+#include <gscommon.hrh>
+#include <coeaui.h>
+#include <hlplch.h>             // For HlpLauncher
+#include <e32base.h>
+#include <featmgr.h>
+#include <GSCallBarringPluginRsc.rsg>      //for resource IDs
+#include <exterror.h>               //for extended error codes
+#include <StringLoader.h>           //for StringLoader
+#include <PsetContainer.h>          //for CPsetContainer
+#include <PsuiContainer.h>          //for CPsuiContainer
+#include <eikmenup.h>               //for menu bar
+#include <SecUiCodeQueryDialog.h>
+#include <nwdefs.h>
+#include <aknViewAppUi.h>
+#include <gsfwviewuids.h>
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+#include <spsettings.h>
+#endif // __VOIP && RD_VOIP_REL_2_2
+ 
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+// 
+// C++ constructor.
+// 
+// ---------------------------------------------------------------------------
+CGSSettListBarringView::CGSSettListBarringView()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two-phased constructor (second phase)
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::ConstructL()
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::ConstructL");
+    BaseConstructL( R_GS_BARRING_VIEW );
+
+    iSettings = CPsetContainer::NewL();
+    iObsContainer = CPsuiContainer::NewL();
+    iCbObserver = iObsContainer->CreateCBObsL();
+    iBarring = iSettings->CreateCBObjectL( *iCbObserver );
+    iRockerPress = EFalse;
+    iContextMenuInitialized = EFalse;
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::ConstructL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSettListBarringView::NewL()
+// Symbian OS two-phased constructor
+// 
+// ---------------------------------------------------------------------------
+CGSSettListBarringView* CGSSettListBarringView::NewL()
+    {
+    CGSSettListBarringView* self = NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two-phased constructor (first phase)
+// 
+// ---------------------------------------------------------------------------
+CGSSettListBarringView* CGSSettListBarringView::NewLC()
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::NewLC");
+    CGSSettListBarringView* self = new ( ELeave ) CGSSettListBarringView;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::NewLC");
+    return self;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// C++ destructor
+// 
+// ---------------------------------------------------------------------------
+CGSSettListBarringView::~CGSSettListBarringView()
+    {
+    delete iBarring;
+    delete iSettings;
+    delete iObsContainer;
+    delete iCbObserver;
+    iRockerPress = EFalse;
+
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Returns Id of the Barring view.
+// 
+// ---------------------------------------------------------------------------
+TUid CGSSettListBarringView::Id() const
+    {
+    return KCallBarringViewId;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Handles other than list box events.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::HandleCommandL( TInt aCommand )
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::HandleCommandL");
+    iRockerPress = EFalse;
+
+    TCallBarringSetting barringSetting;
+    iCurrentItem = iContainer->iListBox->CurrentItemIndex();
+    SetBarringType( 
+        aCommand, 
+        barringSetting, 
+        static_cast <TGSBarringSetting> (iCurrentItem) );
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+    CSPSettings* spSettings = CSPSettings::NewL();
+    TBool showVoipFeatures( EFalse );
+    if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
+        spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) )
+        {
+        showVoipFeatures = ETrue;
+        }
+#endif // __VOIP && RD_VOIP_REL_2_2
+    
+    switch ( aCommand )
+        {
+        case EGSCmdAppChange:
+            iRockerPress = EFalse;
+            HandleListBoxEventL( iContainer->iListBox, EEventEnterKeyPressed );
+            break;
+        case EAknSoftkeyBack:
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+            if ( showVoipFeatures )
+                {
+                iAppUi->ActivateLocalViewL( KCallMainBarringViewId );
+                }
+            else
+                {
+                iAppUi->ActivateLocalViewL( KGSTelPluginUid );
+                }
+#else // __VOIP && RD_VOIP_REL_2_2
+            if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+                {
+                iAppUi->ActivateLocalViewL( KCallMainBarringViewId );
+                }
+            else
+                {
+                iAppUi->ActivateLocalViewL( KGSTelPluginUid );
+                }
+#endif // __VOIP && RD_VOIP_REL_2_2
+            break;
+        case EGSCmdBarringActivate:
+            barringSetting.iSetting = EActivateBarring;
+            HandleBarringOperationL( barringSetting, EAllTeleAndBearer );
+            break;
+        case EGSCmdBarringCancel:
+            barringSetting.iSetting = ECancelBarring;
+            HandleBarringOperationL( barringSetting, EAllTeleAndBearer );
+            break;
+        case EGSCmdBarringInquiry:
+            iBarring->GetBarringStatusL( EServiceGroupVoice, 
+                barringSetting.iType );             
+            break;
+        case EGSCmdBarringChangePwd:
+            ChangeBarringPwdL();            
+            break;
+        case EGSCmdBarringCancelAll:
+            CancelAllBarringsL();            
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleCommandL");
+    }
+  
+// ---------------------------------------------------------------------------
+// 
+// Activates view.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::DoActivateL( const TVwsViewId& aPrevViewId,
+                                          TUid aCustomMessageId,
+                                          const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::DoActivateL");
+    CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId, 
+                                   aCustomMessage );
+
+    iContainer->iListBox->SetTopItemIndex(iTopItemIndex);
+
+    if (iCurrentItem >= 0 && 
+        iCurrentItem < iContainer->iListBox->Model()->NumberOfItems())
+        {
+        iContainer->iListBox->SetCurrentItemIndexAndDraw(iCurrentItem);
+        }
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::DoActivateL");
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Deactivates view.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::DoDeactivate()
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::DoDeactivate");
+    if ( iContainer )
+        {
+        iCurrentItem = iContainer->iListBox->CurrentItemIndex();
+        iTopItemIndex = iContainer->iListBox->TopItemIndex();
+ 
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::DoDeactivate");
+    }
+ 
+ 
+ // -----------------------------------------------------------------------------
+// CGSSettListBarringView::ProcessCommandL
+// -----------------------------------------------------------------------------
+void CGSSettListBarringView::ProcessCommandL( TInt aCommand )
+    {
+    // Context menu is needed to be initialized only if selection key
+    // is pressed. Initialization need to be performed only once.
+    if( aCommand == EAknSoftkeyContextOptions &&
+            !iContextMenuInitialized )
+            {
+            MenuBar()->SetContextMenuTitleResourceId(
+                    R_CALL_BARRING_MSK_CONTEXTMENUBAR );
+            iContextMenuInitialized = ETrue;
+            }
+    
+    // Call base class
+    CAknView::ProcessCommandL( aCommand );
+    }
+// ---------------------------------------------------------------------------
+// 
+// Before showing a options menu, delete options key specific settings if 
+// rocker key has been pressed.
+// ---------------------------------------------------------------------------
+//
+void CGSSettListBarringView::DynInitMenuPaneL( TInt aResourceId, 
+                                              CEikMenuPane* aMenuPane )
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::DynInitMenuPaneL");
+    CEikMenuBar* menuBar = MenuBar();
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+        
+    if ( iRockerPress )
+        {
+        // always hide 'help' & 'exit' menu items when rocker key is pressed
+        if( aResourceId == R_GS_MENU_ITEM_EXIT )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdExit, ETrue );
+            }
+        else if ( aResourceId == R_GS_MENU_ITEM_HELP )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        else if ( aResourceId == R_GS_BARRING_VIEW_MENU )
+            {
+            // these options are not initialized in restricted call barring
+            if ( !FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) )
+                {
+                aMenuPane->SetItemDimmed( EGSCmdBarringCancelAll, ETrue );
+                aMenuPane->SetItemDimmed( EGSCmdBarringChangePwd, ETrue );
+                }
+            }
+        }
+	else if (aResourceId == R_GS_BARRING_VIEW_MENU)
+		{
+		if (!menuBar->ItemSpecificCommandsEnabled() && menuBar->GetMenuType()
+				== CEikMenuBar::EMenuOptions)
+			{
+			aMenuPane->SetItemDimmed(EGSCmdBarringActivate, ETrue);
+			aMenuPane->SetItemDimmed(EGSCmdBarringCancel, ETrue);
+			aMenuPane->SetItemDimmed(EGSCmdBarringInquiry, ETrue);
+			}
+		}
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::DynInitMenuPaneL");
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Queries password from the user.
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CGSSettListBarringView::BarringPasswordQueryL( 
+    TBarringPassword& aBarringPassword,
+    const TInt& aTitleID )
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::BarringPasswordQueryL");
+    TBool continueLoop = ETrue;
+
+    while ( continueLoop )
+        {
+        aBarringPassword = KNullDesC;
+        CCodeQueryDialog* dlg = new (ELeave)
+            CCodeQueryDialog( aBarringPassword, KGSBarringPasswordLength, 
+            KGSBarringPasswordLength, ESecUiNone );
+        dlg->PrepareLC( R_BARRING_PASSWORD_DLG );
+
+        HBufC* string = NULL;
+        string = StringLoader::LoadLC( aTitleID );        
+        dlg->SetPromptL( *string );
+        CleanupStack::PopAndDestroy( string );        
+
+        TInt res = dlg->RunLD();
+        dlg = NULL;
+
+        if ( res )
+            {
+            if ( aBarringPassword.Length() == KGSBarringPasswordLength )
+                {
+                continueLoop = EFalse;
+                }
+            }
+        else
+            {
+            __GSLOGSTRING("[GS]    BarringPasswordQueryL: EAknSoftkeyCancel returned");
+            __GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL");
+            return EAknSoftkeyCancel;
+            }        
+    }
+    __GSLOGSTRING("[GS]    BarringPasswordQueryL: EAknSoftkeyOk returned");
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL");
+    return EAknSoftkeyOk;
+ }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Adds given item to a given list
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::AppendItemL( 
+    CDesCArrayFlat& aList, const TInt aItem )
+    {
+    HBufC* string = NULL;
+    string = StringLoader::LoadLC( aItem );
+    aList.AppendL( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Handles barring operation requests.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::HandleBarringOperationL( 
+    TCallBarringSetting aBarringSetting, TBasicServiceGroups aBsc )
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::HandleBarringOperationL");
+    TInt ret = KErrNone;
+    ret = BarringPasswordQueryL( 
+        aBarringSetting.iPassword, R_BARRING_PASSWORD );
+    if ( ret == EAknSoftkeyOk )
+         {
+         iBarring->SetBarringL( aBarringSetting, aBsc );
+         }
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleBarringOperationL");
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Sets barring type. Switches from GS internal values, to values
+// shared by phone/phonesettings.
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::SetBarringType( TInt& aCommand,
+    TCallBarringSetting& aBarringSetting, 
+    TGSBarringSetting aType )
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::SetBarringType");
+    if ( aCommand != EGSCmdBarringActivate &&
+         aCommand != EGSCmdBarringCancel &&
+         aCommand != EGSCmdBarringInquiry &&
+         aCommand != EGSCmdBarringChangePwd &&
+         aCommand != EGSCmdBarringCancelAll )
+        {
+        __GSLOGSTRING("[GS]    SetBarringType: No barring variables set");
+        return; //in case of exit do not set barring variables.
+        }
+
+    aBarringSetting.iServiceGroup = EServiceGroupVoice;
+
+    switch ( aType )
+        {
+        case EGSCBOutgoing:
+            aBarringSetting.iType = EBarringTypeAllOutgoing;
+            break;    
+        case EGSCBInternational:
+            aBarringSetting.iType = EBarringTypeOutgoingInternational;
+            break;
+        case EGSCBInternationalExceptHome:
+            aBarringSetting.iType = 
+                EBarringTypeOutgoingInternationalExceptToHomeCountry;
+            break;
+        case EGSCBIncoming:
+            aBarringSetting.iType = EBarringTypeAllIncoming;
+            break;
+        case EGSCBAbroad:
+            aBarringSetting.iType = EBarringTypeIncomingWhenRoaming;
+            break;
+        default:
+            aBarringSetting.iType = EBarringTypeAllBarrings;
+            break;
+        }
+        
+    if ( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) )
+        {
+        // Restricted call barring only support EBarringTypeIncomingWhenRoaming
+        aBarringSetting.iType = EBarringTypeIncomingWhenRoaming;
+        }    
+
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::SetBarringType");
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates a request to cancel all barrings.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::CancelAllBarringsL()
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::CancelAllBarringsL");
+    TCallBarringSetting cancelAllCB;       
+
+    TInt retValue = KErrNone; 
+    retValue = BarringPasswordQueryL( cancelAllCB.iPassword, 
+        R_BARRING_PASSWORD );
+    if ( retValue == EAknSoftkeyOk )
+        { 
+        cancelAllCB.iSetting = ECancelBarring;
+        cancelAllCB.iType = EBarringTypeAllBarrings;
+        cancelAllCB.iServiceGroup = EServiceGroupVoice;
+        iBarring->SetBarringL( cancelAllCB, EAllTeleAndBearer );
+        }
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::CancelAllBarringsL");
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Handles changing of barring password.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::ChangeBarringPwdL()
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListBarringView::ChangeBarringPwdL");
+    TInt returnValue = KErrNone;
+    RMobilePhone::TMobilePhonePasswordChangeV2 pwd;
+
+    returnValue = BarringPasswordQueryL( 
+        pwd.iOldPassword, R_CURRENT_BARRING_PASSWORD );
+
+    if ( returnValue != EAknSoftkeyOk ) //cancelled or error
+        {
+        __GSLOGSTRING("[GS]    ChangeBarringPwdL: Current PW cancelled/error");
+        return;
+        }
+    returnValue = BarringPasswordQueryL( pwd.iNewPassword, 
+        R_NEW_BARRING_PASSWORD );
+    if ( returnValue != EAknSoftkeyOk ) //cancelled or error
+        {
+        __GSLOGSTRING("[GS]    ChangeBarringPwdL: New PW cancelled/error");
+        return;
+        }
+    returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword , 
+                                         R_VERIFY_NEW_BARRING_PASSWORD );
+    if ( returnValue != EAknSoftkeyOk )
+        {
+        __GSLOGSTRING("[GS]    ChangeBarringPwdL: Verify PW1 cancelled/error");
+        return;
+        }            
+    // check if newpw and verifypw do not 
+    // match->password error->return to query            
+    while ( pwd.iNewPassword.Compare( pwd.iVerifiedPassword ) != 0 )
+        {
+        iCbObserver->HandleBarringErrorL( KErrGsmSSNegativePasswordCheck );
+
+        returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword, 
+                                             R_VERIFY_NEW_BARRING_PASSWORD );
+        if ( returnValue != EAknSoftkeyOk ) //cancelled or error
+            {
+            __GSLOGSTRING("[GS]    ChangeBarringPwdL: Verify PW2 cancelled/error");
+            return;
+            }
+        }
+    iBarring->ChangePasswordL( pwd, ETrue );
+    __GSLOGSTRING("[GS] <--CGSSettListBarringView::ChangeBarringPwdL");
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates new iContainer.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::NewContainerL()
+    {
+    iContainer = new (ELeave) CGSSettListBarringContainer;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Handles listbox selection
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListBarringView::HandleListBoxSelectionL()
+    {
+    iRockerPress = ETrue;
+    CEikMenuBar* menuBar = this->MenuBar();
+    menuBar->SetMenuType( CEikMenuBar::EMenuContext );
+    menuBar->SetContextMenuTitleResourceId(R_CALL_BARRING_MSK_CONTEXTMENUBAR);
+    // Display menu bar.
+    menuBar->TryDisplayContextMenuBarL();
+    iRockerPress = EFalse;
+    menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
+    iContextMenuInitialized = ETrue;
+    }
+
+
+ // End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Internet Barring folder
+*
+*/
+
+
+// INCLUDE FILES
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <GSCallBarringPluginRsc.rsg>
+#include <csxhelp/cp.hlp.hrh>
+#include <gsfwviewuids.h>
+#include <generalsettingsvariant.hrh>
+#include <PSVariables.h>  //PubSub 
+#include <settingsinternalcrkeys.h>
+#include <LogsDomainCRKeys.h>
+#include "GSInternetBarringContainer.h"
+#include "gslistbox.h"              //for listbox clases
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+		iRichCallRepository = CRepository::NewL( KCRUidRichCallSettings );
+		iTelephonyRepository = CRepository::NewL( KCRUidTelephonySettings );
+    BaseConstructL( aRect, 
+                    R_GS_INTERNET_BARRING_VIEW_TITLE, 
+                    R_INTERNET_BARRING_LBX );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Destructor
+//  
+// ---------------------------------------------------------------------------
+CGSSettListInternetBarringContainer::~CGSSettListInternetBarringContainer()
+    {
+    if ( iItems )
+        {
+        delete iItems;
+        }
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    if ( iTelephonyRepository )
+        {
+        delete iTelephonyRepository;
+        iTelephonyRepository = NULL;
+        }
+    if ( iRichCallRepository )
+        {
+        delete iRichCallRepository;
+        iRichCallRepository = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates list box
+//  
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringContainer::ConstructListBoxL( TInt aResLbxId )
+    {        
+    iListBox->ConstructL( this, EAknListBoxSelectionList); 
+       
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, 
+        *iListBox, *iCoeEnv );        
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    
+    // Create items  
+    iItems = iCoeEnv->ReadDesC16ArrayResourceL( 
+                        R_GS_INTERNET_BARRING_SETTING_PAGE_LBX );
+    
+    CreateListBoxItemsL();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates List box items
+//  
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringContainer::CreateListBoxItemsL()
+    {    
+    MakeAnonymousItemL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListInternetBarringContainer::GetHelpContext
+// Gets Help Context
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSSettListInternetBarringContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KDIV_HLP_CALL_FORW_VOIP;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListInternetBarringContainer::MakeAnonymousItemL
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSSettListInternetBarringContainer::MakeAnonymousItemL()
+    {
+    TInt value( KErrNone );
+    GetVoIPCallSettingValue( EGSVoIPBarring, value );
+    
+    HBufC* dynamicText = HBufC::NewLC( KGSSettingItemLength );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    ptrBuffer = ( *iItems )[ value ];
+    
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSCBAnonymous, ptrBuffer );
+    iListboxItemArray->SetItemVisibilityL( EGSCBAnonymous, 
+        CGSListBoxItemTextArray::EVisible );    
+    
+    CleanupStack::PopAndDestroy( dynamicText );  
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListInternetBarringContainer::UpdateListBoxL
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSSettListInternetBarringContainer::UpdateListBoxL()
+    {
+    MakeAnonymousItemL();     
+    iListBox->HandleItemAdditionL();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSSettListInternetBarringContainer::GetVoIPCallSettingValue
+// Gets one of the VoIP call related values (send my Int. call id, 
+// Internet call waiting, preferred call type, do not disturb or 
+// Internet call barring) from Central Repository
+// ----------------------------------------------------------------------------
+//
+TInt CGSSettListInternetBarringContainer::GetVoIPCallSettingValue( 
+    const TGSVoIPSetting aVoipSettingId, TInt& aVoipId ) 
+    {
+    TInt ret( KErrNone );
+   
+    switch ( aVoipSettingId )
+        {
+        case EGSVoIPSendIntCallId:
+            ret = iRichCallRepository->Get( KRCSEClir, aVoipId );
+            break;
+        case EGSVoIPCW:
+            ret = iRichCallRepository->Get( KRCSPSCallWaiting, aVoipId );
+            break;
+        case EGSVoIPPreType:
+            ret = iRichCallRepository->Get( KRCSEPreferredTelephony, aVoipId );
+            break;
+        case EGSVoIPDnd:
+            ret = iRichCallRepository->Get( KRCSEDoNotDisturb, aVoipId );
+            break;
+        case EGSVoIPBarring:
+            ret = iRichCallRepository->Get( KRCSEAnonymousCallBlockRule, aVoipId );
+            SwitchValue( aVoipId );
+            break;
+        default:
+            break;
+        }
+    
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSSettListInternetBarringContainer::SetVoIPCallSettingValue
+// Sets one of the VoIP call related values (send my Int. call id, 
+// Internet call waiting, preferred call type, do not disturb or 
+// Internet call barring) from Central Repository
+// ----------------------------------------------------------------------------
+//
+TInt CGSSettListInternetBarringContainer::SetVoIPCallSettingValue( 
+    const TGSVoIPSetting aVoipSettingId, TInt aVoipId )
+    {
+    TInt ret( KErrNone );
+    
+    switch( aVoipSettingId )
+        {
+        case EGSVoIPSendIntCallId:
+            ret = iRichCallRepository->Set( KRCSEClir, aVoipId );
+            break;
+        case EGSVoIPCW:
+            ret = iRichCallRepository->Set( KRCSPSCallWaiting, aVoipId );
+            break;
+        case EGSVoIPPreType:
+            ret = iRichCallRepository->Set( KRCSEPreferredTelephony, aVoipId );
+            break;
+        case EGSVoIPDnd:
+            ret = iRichCallRepository->Set( KRCSEDoNotDisturb, aVoipId );
+            break;
+        case EGSVoIPBarring:
+            SwitchValue( aVoipId );
+            ret = iRichCallRepository->Set( KRCSEAnonymousCallBlockRule, aVoipId );
+            break;
+        default:
+            break;
+        }
+        
+    return ret;    
+    }
+    
+// ----------------------------------------------------------------------------
+// CGSSettListInternetBarringContainer::GetSCCPStatus
+// Gets SCCP status from Central Repository
+// ----------------------------------------------------------------------------
+//
+TInt CGSSettListInternetBarringContainer::GetSCCPStatus( TInt& aStatus )
+    {
+    TInt ret( KErrNone );
+    ret = iTelephonyRepository->Get( KSCCPinstallUpgrade, aStatus );
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSSettListInternetBarringContainer::SwitchValue
+//
+// Switching value from 1 to 0 and back
+// ----------------------------------------------------------------------------
+//
+void CGSSettListInternetBarringContainer::SwitchValue( TInt& aValue )
+    {
+    switch( aValue )
+        {
+        case KGSSettingOff: //0
+            aValue = KGSIndexOff; //1
+            break;
+        case KGSSettingOn: //1
+            aValue = KGSIndexOn; //0
+            break;
+        default:
+            break;
+        }
+    }
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for the Internet Barring folder
+*
+*/
+
+ 
+// INCLUDE FILES
+#include "CallBarringPlugin.hrh"    //for enumerations (e.g.TGSInternetBarringSetting)
+#include "GSInternetBarringView.h"//for CGSSettListInternetBarringView
+#include "GSInternetBarringContainer.h" //for CGSBaseContainer
+#include "LocalViewIds.h"         //for KSettListBarringViewId, KGSMainViewId
+#include "GsLogger.h"
+
+
+#include <e32base.h>
+#include <featmgr.h>
+#include <GSCallBarringPluginRsc.rsg>      //for resource IDs
+#include <gscommon.hrh>
+#include <StringLoader.h>           //for StringLoader
+#include <aknradiobuttonsettingpage.h>
+#include <aknViewAppUi.h>
+#include <aknnotewrappers.h>
+#include <hlplch.h>                 // For HlpLauncher
+
+// CONSTANS
+const TInt KGSBarringGranularity = 2;
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// 
+// C++ constructor.
+// 
+// ---------------------------------------------------------------------------
+CGSSettListInternetBarringView::CGSSettListInternetBarringView()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two-phased constructor (second phase)
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::ConstructL()
+    {
+    BaseConstructL( R_GS_INTERNET_BARRING_VIEW );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListInternetBarringView::NewL()
+// Symbian OS two-phased constructor
+// 
+// ---------------------------------------------------------------------------
+CGSSettListInternetBarringView* CGSSettListInternetBarringView::NewL()
+    {
+    CGSSettListInternetBarringView* self = NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two-phased constructor (first phase)
+// 
+// ---------------------------------------------------------------------------
+CGSSettListInternetBarringView* CGSSettListInternetBarringView::NewLC()
+    {
+    CGSSettListInternetBarringView* self = 
+        new ( ELeave ) CGSSettListInternetBarringView();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// C++ destructor
+// 
+// ---------------------------------------------------------------------------
+CGSSettListInternetBarringView::~CGSSettListInternetBarringView()
+    {
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Returns Id of the Barring view.
+// 
+// ---------------------------------------------------------------------------
+TUid CGSSettListInternetBarringView::Id() const
+    {
+    return KCallInternetBarringViewId;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Handles other than list box events.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+       	case EGSMSKCmdAppChange:
+			HandleListBoxSelectionL();
+       		break;
+       	case EGSCmdAppChange:
+            ShowSettingPageL();
+            break;
+        case EAknSoftkeyBack:
+            iAppUi->ActivateLocalViewL( KCallMainBarringViewId );
+            break;
+        case EAknCmdHelp:
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// 
+// Activates view.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::DoActivateL( const TVwsViewId& aPrevViewId,
+                                          TUid aCustomMessageId,
+                                          const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING("[GS]--> CGSSettListInternetBarringView::DoActivateL");
+    CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId, 
+                                   aCustomMessage );
+
+    iContainer->iListBox->SetTopItemIndex( iTopItemIndex );
+
+    if ( iCurrentItem >= 0 && 
+         iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() )
+        {
+        iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem );
+        }
+    __GSLOGSTRING("[GS]<-- CGSSettListInternetBarringView::DoActivateL");
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Deactivates view.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        if ( iContainer->iListBox && iContainer->iListBox->View() )
+            {
+            iCurrentItem = iContainer->iListBox->CurrentItemIndex();
+            iTopItemIndex = iContainer->iListBox->TopItemIndex();
+            }
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// Before showing a options menu, delete options key specific settings if 
+// rocker key has been pressed.
+// ---------------------------------------------------------------------------
+//
+void CGSSettListInternetBarringView::DynInitMenuPaneL( TInt aResourceId, 
+                                              CEikMenuPane* aMenuPane )
+    {
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates new iContainer.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::NewContainerL()
+    {
+    iContainer = new (ELeave) CGSSettListInternetBarringContainer;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Handles changing of barring password.
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::HandleListBoxSelectionL()
+    {
+    CGSSettListInternetBarringContainer& container = 
+        *static_cast<CGSSettListInternetBarringContainer*>( iContainer );
+    
+    TInt value( KErrNone );
+    container.GetVoIPCallSettingValue( EGSVoIPBarring, value );
+    
+    if ( value == EGSCSCallBarringOff )
+        {
+        container.SetVoIPCallSettingValue( EGSVoIPBarring, EGSCSCallBarringOn );
+        }
+    else
+        {
+        container.SetVoIPCallSettingValue( EGSVoIPBarring, EGSCSCallBarringOff );
+        }
+
+    if ( iContainer->iListBox )
+        {
+        container.UpdateListBoxL();
+        }
+    
+    // Show SCCP note if needed. 
+    TInt status( KErrNone );
+    container.GetSCCPStatus( status );
+       
+    if ( value == EGSCSCallBarringOff && status == 1 )
+        {
+        HBufC* prompt = 
+            StringLoader::LoadLC( R_QTN_VOIP_SCCP_CALL_BARRING_NOTE );
+        CAknInformationNote* note = new(ELeave) CAknInformationNote( ETrue );
+        note->ExecuteLD( *prompt );
+        CleanupStack::PopAndDestroy( prompt ); 
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Shows setting page - for ON/OFF setting items
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::ShowSettingPageL()
+    {
+    CGSSettListInternetBarringContainer& container = 
+        *static_cast<CGSSettListInternetBarringContainer*>( iContainer );
+    
+    CDesCArrayFlat* items = 
+          new ( ELeave ) CDesCArrayFlat( KGSBarringGranularity );
+    CleanupStack::PushL( items );
+    
+    AppendItemL( *items, R_INTERNET_BARRING_ON );
+    AppendItemL( *items, R_INTERNET_BARRING_OFF );
+    
+    TInt value( KErrNone );
+    container.GetVoIPCallSettingValue( EGSVoIPBarring, value );
+      
+    CAknRadioButtonSettingPage* dlg = new( ELeave ) 
+        CAknRadioButtonSettingPage( 
+        R_GS_INTERNET_BARRING_SETTING_PAGE,
+        value, items );
+     
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        if ( value == EGSCSCallBarringOff )
+            {
+            container.SetVoIPCallSettingValue( 
+                EGSVoIPBarring, EGSCSCallBarringOff );
+            }
+        else
+            {
+            container.SetVoIPCallSettingValue( 
+                EGSVoIPBarring, EGSCSCallBarringOn );
+            }
+        }
+        
+    CleanupStack::PopAndDestroy( items );
+    
+    container.UpdateListBoxL();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Appends given item to given list
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListInternetBarringView::AppendItemL( 
+    CDesCArrayFlat& aList, TInt aItem )
+    {
+    HBufC* string = StringLoader::LoadLC( aItem );
+    aList.AppendL( *string );
+    CleanupStack::PopAndDestroy( string );
+    }    
+        
+ // End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSLocalBaseView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base view for all the views in General Settings
+*
+*/
+
+
+// INCLUDE FILES
+#include    "GSLocalBaseView.h"
+
+#include <aknViewAppUi.h>
+#include <akntitle.h>
+#include <barsread.h>
+#include <aknnavi.h>
+#include <akntabgrp.h>
+#include <aknnavide.h>
+#include <AknUtils.h>
+#include <bldvariant.hrh>
+#include <featmgr.h>
+#include <gsbasecontainer.h>
+#include <GSCallBarringPluginRsc.rsg>
+
+// CONSTANTS
+#ifdef _DEBUG
+_LIT( KGSDoActivateError, "DoActivateL" );
+#endif
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::CGSLocalBaseView
+//
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CGSLocalBaseView::CGSLocalBaseView()
+    {
+    iAppUi = iAvkonViewAppUi;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::~CGSLocalBaseView
+//
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CGSLocalBaseView::~CGSLocalBaseView()
+    {
+    if ( iContainer && iAppUi )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::SetCurrentItem
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::SetCurrentItem( TInt aIndex )
+    {
+    iCurrentItem = aIndex;
+    if( iContainer )
+        {
+        iContainer->SetSelectedItem( aIndex );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::HandleListBoxEventL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::HandleListBoxEventL( CEikListBox* /*aListBox*/,
+                                            TListBoxEvent aEventType )
+    {
+    switch ( aEventType )
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemSingleClicked:
+            HandleListBoxSelectionL();
+            break;
+        default:
+           break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::SetNaviPaneL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::SetNaviPaneL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::CreateNaviPaneContextL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::CreateNaviPaneContextL( TInt /*aResourceId*/ )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::HandleClientRectChange
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::HandleClientRectChange()
+    {
+    if ( iContainer && iContainer->iListBox )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::DoActivateL
+// Activates the view.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
+                              TUid /*aCustomMessageId*/,
+                              const TDesC8& /*aCustomMessage*/)
+    {
+    if( iContainer )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+
+    CreateContainerL();
+
+    iAppUi->AddToViewStackL( *this, iContainer );
+    iContainer->iListBox->SetListBoxObserver( this );
+
+    SetNaviPaneL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::CreateContainerL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::CreateContainerL()
+    {
+    NewContainerL();
+    __ASSERT_DEBUG( iContainer,
+        User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) );
+    iContainer->SetMopParent( this );
+
+    TRAPD( error, iContainer->ConstructL( ClientRect() ) );
+
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Main Barring folder
+*
+*/
+
+
+// INCLUDE FILES
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <GSCallBarringPluginRsc.rsg>
+#include <csxhelp/cp.hlp.hrh>
+#include <gsfwviewuids.h>
+#include "GSMainBarringContainer.h"
+
+#include "gslistbox.h"
+#include "CallBarringPlugin.hrh"
+#include <BTSapInternalPSKeys.h>
+#include <e32property.h>  //P&S
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// 
+// Symbian OS two phased constructor
+// 
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+
+    BaseConstructL( aRect, 
+                    R_GS_BARRING_MAIN_VIEW_TITLE, 
+                    R_BARRING_MAIN_LBX );
+                    
+    RProperty::Get( KPSUidBluetoothSapConnectionState,
+                    KBTSapConnectionState,
+                    iBtSapConnectionState );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Destructor
+//  
+// ---------------------------------------------------------------------------
+CGSSettListMainBarringContainer::~CGSSettListMainBarringContainer()
+    {
+    if ( iItems )
+        {
+        delete iItems;
+        }
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates list box
+//  
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringContainer::ConstructListBoxL( TInt aResLbxId )
+    {        
+    iListBox->ConstructL( this, EAknListBoxSelectionList); 
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, 
+    *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    
+    CreateListBoxItemsL();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// Creates List box items
+//  
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringContainer::CreateListBoxItemsL()
+    {
+    if ( iBtSapConnectionState != EBTSapConnected )
+        {
+        iListboxItemArray->SetItemVisibilityL( EGSCBCellular, 
+            CGSListBoxItemTextArray::EVisible );
+        }
+
+    iListboxItemArray->SetItemVisibilityL( EGSCBInternet, 
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListMainBarringContainer::GetHelpContext
+// Gets Help Context
+//  
+// ---------------------------------------------------------------------------
+//
+void CGSSettListMainBarringContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KDIV_HLP_BARRING_MAIN;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListMainBarringContainer::CurrentFeatureId()
+//  
+// ---------------------------------------------------------------------------
+//
+TInt CGSSettListMainBarringContainer::CurrentFeatureId() const
+    {
+    return iListboxItemArray->CurrentFeature();
+    }
+    
+//End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,249 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for the Main Barring folder
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <GSCallBarringPluginRsc.rsg>
+#include "CallBarringPlugin.hrh"            //for enumerations (e.g.TGSBarringSetting)
+#include "GSMainBarringView.h"      //for CGSSettListMainBarringView
+#include "GSMainBarringContainer.h" //for CGSBaseContainer
+#include "GSCellularCallBarringView.h"          //for CGSSettListBarringView
+#include "GSInternetBarringView.h"  //for CGSSettListInternetBarringView
+#include "GSPhoneSettingConstants.h"//for constant values
+#include "LocalViewIds.h"           //for KSettListBarringViewId, KGSMainViewId
+#include <eikmenup.h>               //for menu bar
+#include "GSCallBarringPlugin.h"
+#include <aknViewAppUi.h>
+#include <gsfwviewuids.h>
+#include <gscommon.hrh>
+#include <aknlists.h>
+#include <hlplch.h>                 // For HlpLauncher
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+//
+// C++ constructor.
+//
+// ---------------------------------------------------------------------------
+CGSSettListMainBarringView::CGSSettListMainBarringView()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two-phased constructor (second phase)
+//
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringView::ConstructL()
+    {
+    BaseConstructL( R_GS_BARRING_MAIN_VIEW );
+
+    // Create call barring and Internet call barring views.
+    iBarringView = CGSSettListBarringView::NewL();
+    iAppUi->AddViewL( iBarringView );
+
+    iInternetBarringView = CGSSettListInternetBarringView::NewL();
+    iAppUi->AddViewL( iInternetBarringView );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two-phased constructor (first phase)
+//
+// ---------------------------------------------------------------------------
+CGSSettListMainBarringView* CGSSettListMainBarringView::NewLC()
+    {
+    CGSSettListMainBarringView* self =
+        new ( ELeave ) CGSSettListMainBarringView;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// C++ destructor
+//
+// ---------------------------------------------------------------------------
+CGSSettListMainBarringView::~CGSSettListMainBarringView()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Returns Id of the Barring view.
+//
+// ---------------------------------------------------------------------------
+TUid CGSSettListMainBarringView::Id() const
+    {
+    return KCallMainBarringViewId;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Handles other than list box events.
+//
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringView::HandleCommandL( TInt aCommand )
+    {
+    iCurrentItem = iContainer->iListBox->CurrentItemIndex();
+
+    switch ( aCommand )
+        {
+        case EAknSoftkeyOpen:
+		case EGSCmdAppOpen:
+            HandleListBoxSelectionL();
+            break;
+        case EAknSoftkeyBack:
+            iAppUi->ActivateLocalViewL( KGSTelPluginUid );
+            break;
+        case EAknCmdHelp:
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Activates view.
+//
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringView::DoActivateL( const TVwsViewId& aPrevViewId,
+                                          TUid aCustomMessageId,
+                                          const TDesC8& aCustomMessage )
+    {
+    CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId,
+                                   aCustomMessage );
+
+    iContainer->iListBox->SetTopItemIndex( iTopItemIndex );
+
+    if ( iCurrentItem >= 0 &&
+         iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() )
+        {
+        iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Deactivates view.
+//
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iCurrentItem = iContainer->iListBox->CurrentItemIndex();
+        iTopItemIndex = iContainer->iListBox->TopItemIndex();
+
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSSettListMainBarringView::ProcessCommandL
+// -----------------------------------------------------------------------------
+void CGSSettListMainBarringView::ProcessCommandL( TInt aCommand )
+    {
+    MenuBar()->SetContextMenuTitleResourceId(R_CALL_BARRING_MSK_CONTEXTMENUBAR);
+    // Call base class
+    CAknView::ProcessCommandL( aCommand );
+    }
+// ---------------------------------------------------------------------------
+//
+// Before showing a options menu, delete options key specific settings if
+// rocker key has been pressed.
+// ---------------------------------------------------------------------------
+//
+void CGSSettListMainBarringView::DynInitMenuPaneL( TInt aResourceId,
+                                                   CEikMenuPane* aMenuPane )
+    {
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        //Handle Help Fature
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates new iContainer.
+//
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringView::NewContainerL()
+    {
+    iContainer = new ( ELeave ) CGSSettListMainBarringContainer;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Handles changing of barring password.
+//
+// ---------------------------------------------------------------------------
+void CGSSettListMainBarringView::HandleListBoxSelectionL()
+    {
+    const TInt currentItem = Container()->CurrentFeatureId();
+
+    switch ( currentItem )
+        {
+        case EGSCBCellular:
+            iAppUi->ActivateLocalViewL( KCallBarringViewId );
+            break;
+        case EGSCBInternet:
+            iAppUi->ActivateLocalViewL( KCallInternetBarringViewId );
+            break;
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListMainBarringView::Container
+//
+// Returns call container item
+// ---------------------------------------------------------------------------
+//
+CGSSettListMainBarringContainer* CGSSettListMainBarringView::Container()
+    {
+    return static_cast <CGSSettListMainBarringContainer*> ( iContainer );
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building 
+*                GSCallBarringPlugin.
+*                
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSCallBarringPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gscallbarringplugin.iby )
+../rom/GSCallBarringPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gscallbarringpluginresources.iby )
+loc/CallBarringPlugin.loc MW_LAYER_LOC_EXPORT_PATH( callbarringplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gscallbarringplugin.mif
+  OPTION HEADERFILE gscallbarringplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_barr_sub
+END
+
+
+PRJ_MMPFILES
+GSCallBarringPlugin.mmp    
+
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSCallBarringPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallBarringPlugin/loc/CallBarringPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSCallBarringPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d: title for call settings folder
+//l: list_single_large_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_folder_barring "Call Barring"
+
+
+//BARRING FOLDER
+//d: title for barring folder when opened
+//l: title_pane_t2/opt9
+//
+#define qtn_set_title_restrictions "Call barring settings"
+
+//d: text to indicate outgoing calls in call barring-folder
+//l: list_double2_pane
+//
+#define text_no_outgoing "Outgoing calls"
+
+//d: text to indicate international calls in call barring-folder
+//l: list_double2_pane
+//
+#define text_no_international "International calls"
+
+//d: text to indicate international calls except to home country 
+//d: in call barring-folder
+//l: list_double2_pane
+//
+#define text_no_inter_but_home "International calls except to home country"
+
+//d: text to indicate incoming calls in call barring-folder
+//l: list_double2_pane
+//
+#define text_no_incoming "Incoming calls"
+
+//d: text to indicate incoming calls when abroad in call barring-folder
+//l: list_double2_pane
+//
+#define text_no_incom_if_roam "Incoming calls when abroad"
+
+// ACTIONS IN CALL BARRING FOLDER
+//d: action in call barring folder, 
+//d: activating the corresponding barring service
+//l: list_single_pane_t1_cp2
+//
+#define text_activate_barring "Activate"
+
+//d: action in call barring folder, 
+//d: cancelling the corresponding barring service
+//l: list_single_pane_t1_cp2
+//
+#define text_cancel_barring "Cancel"
+
+//d: action in call barring folder, 
+//d: checking status of the corresponding barring service
+//l: list_single_pane_t1_cp2
+//
+#define text_status_barring "Check status"
+
+//d: text to indicate cancelling call barrings in call barring-folder
+//l: list_single_pane_t1_cp2
+//
+#define text_cancel_all_barrings "Cancel all barrings"
+
+//d: text to indicate changing barring password in call barring-folder
+//l: list_single_pane_t1_cp2
+//
+#define qtn_barr_list_password "Change barrings' password"
+
+// CALL BARRING INTERROGATION AND PASSWORD RELATED STUFF
+//d: text to the code query which opens when one is about to enter 
+//d: barring password
+//l: popup_query_data_window
+//
+#define text_password "Barring password: "
+
+//d: when the barring password is being changed, 
+//d: this is the text when the old pw is asked
+//l: popup_query_data_window
+//
+#define text_old_pass "Current password: "
+
+//d: when the barring password is being changed, 
+//d: this is the text when the new pw is entered
+//l: popup_query_data_window
+//
+#define text_new_pass "Enter new password: "
+
+//d: when the barring password is being changed, 
+//d: this is the text when the new pw is confirmed
+//l: popup_query_data_window
+//
+#define text_verify_pass "Verify new password: "
+
+//VOIP
+
+//d: text to indicate cellular call selection in call barring-folder
+//l: list_double2_pane
+//
+#define qtn_cell_call_barring "Cellular call Barring"
+
+//d: text to indicate internet call selection in call barring-folder
+//l: list_double2_pane
+//
+#define qtn_voip_call_barring "Internet call Barring"
+
+//d: text to indicate internet call selection in call barring-folder
+//l: list_double2_pane
+//
+#define qtn_set_title_restrictions_int "Anonymous call barring"
+
+//d: text to indicate anonymous calls in call barring-folder
+//l: list_setting_pane_t1
+//
+#define qtn_voip_barring_anonymous "Anonymous calls"
+
+//d: text to indicate anonymous call type
+//l: list_set_graphic_pane_t1
+//
+#define qtn_voip_barring_active "Active"
+
+//d: text to indicate anonymous call type
+//l: list_set_graphic_pane_t1
+//
+#define qtn_voip_barring_not_active "Not active"
+
+//d: title for barring folder when opened
+//l: title_pane_t2/opt9
+//
+#define qtn_title_cell_call_barring "Cellular call barring"
+
+//d: title for barring folder when opened
+//l: title_pane_t2/opt9
+//
+#define qtn_title_voip_call_barring "Internet call barring"
+
+//d: note is shown when the barring is set for anonymous internet call and SCCP software is installed
+//l: popup_note_window
+//
+#define qtn_voip_sccp_call_barring_note "Note that anonymous call barring does not affect SCCP based Internet calls"
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Data/102824A3.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Call Divert settings plugin.
+*
+*/
+
+
+// INCLUDES
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x102824A3;
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x102824A4;
+					version_no          = 1;
+					display_name        = "Call Divert Plugin";
+					default_data        = "0x1020723D";//Parent UID
+					#ifdef RD_CONTROL_PANEL
+					    opaque_data         = "40";//Order number
+					#else //RD_CONTROL_PANEL
+					    opaque_data         = "20";//Order number
+					#endif //RD_CONTROL_PANEL
+					}
+				};
+			}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Data/GSCallDivertPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,559 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSCallDivertPlugin
+*
+*/
+
+//  RESOURCE IDENTIFIER
+NAME    CFWD // 4 letter ID
+
+//  INCLUDES
+#include     <bldvariant.hrh>
+
+#include    "CallDivertPlugin.hrh"
+
+#include    <cf.loc>
+#include    <gs.loc>
+#include    <gscommon.hrh>
+#include    <gscommon.rh>
+#include    <GSApp.rsg>
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <gscalldivertplugin.mbg>
+#include    <uikon.rh>
+
+
+#include <AiwCommon.rh> // AIW for pbk2
+#include <AiwGenericParam.hrh> // AIW for pbk2
+
+// CONSTANTS
+
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+RESOURCE TBUF
+    {
+    buf="CFWD";
+    }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+
+//----------------------------------------------------
+//  r_gs_call_divert_caption
+//
+// Data call view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_call_divert_caption
+    {
+    buf = qtn_set_folder_divert;
+    }
+
+//Divert
+
+//----------------------------------------------------
+//
+//    r_cf_main_view
+//    The main view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_cf_main_view
+    {
+    menubar = r_cf_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+
+//----------------------------------------------------
+//
+//    r_cf_menubar_open_exit
+//    Call forward menu bar.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_cf_menubar_open_exit
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_exit;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_help;
+            },    
+        MENU_TITLE
+            {
+            menu_pane = r_cf_cancel_all_diverts;
+            },
+        MENU_TITLE
+            {
+            menu_pane = r_gs_menu_item_open;
+            }
+        };
+    }
+
+
+
+//----------------------------------------------------
+//
+//    r_cf_cancel_all_diverts
+//    Call forward "cancel all" menu pane.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_cf_cancel_all_diverts
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = ECFCmdCancelAll;
+            txt = text_cancel_all_diverts;
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_cf_main_view_title
+//    Title for the main view: "Call Divert"
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_cf_main_view_title
+    {
+    txt = qtn_div_heading_cf;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_cf_div_view_menu
+//    Menu pane for Options.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_cf_div_view_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = ECFCmdActivate;
+            txt = text_activate_divert;
+            },
+        MENU_ITEM
+            {
+            command = ECFCmdCancel;
+            txt = text_cancel_divert;
+            },
+        MENU_ITEM
+            {
+            command = ECFCmdCheckStatus;
+            txt = text_check_status;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdHelp;
+            txt = qtn_options_help;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_cf_menubar_options_view
+//    Menu bar in the Main view.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_cf_menubar_options_view
+    {
+    titles =
+        {
+        MENU_TITLE {menu_pane = r_cf_div_view_menu;}
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_cf_menubar_div_view
+//    Menu bar in the Main view when selection key has been pressed.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_cf_menubar_div_view
+    {
+    titles =
+        {
+        MENU_TITLE {menu_pane = r_cf_div_view_menu;}
+        };
+    }
+
+
+//-----------------------------------------------------------------------------
+//
+//    r_cf_main_lbx_resource
+//    List box resource.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_cf_main_lbx_resource
+    {
+    array_id = r_cf_main_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_cf_voice_view_title
+//    Title for the sub view: "Voice Call Diverts"
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_cf_voice_view_title
+    {
+    txt = qtn_div_heading_voice;
+    }
+
+//----------------------------------------------------
+//
+//    r_cf_video_view_title
+//    Title for the sub view: "Video Call Diverts"
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_cf_video_view_title
+    {
+    txt = qtn_div_heading_video;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_cf_div_lbx
+//    List items in the call divert view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_cf_div_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_dlist_all"\t\t";
+            item = ECFDivertVoiceCalls;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_dlist_all_video"\t\t";
+            item = ECFDivertVideoCalls;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_dlist_busy"\t\t";
+            item = ECFDivertWhenBusy;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_dlist_noreply"\t\t";
+            item = ECFDivertWhenNoAnswer;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_dlist_outreach"\t\t";
+            item = ECFDivertWhenOutOfReach;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_dlist_notavail"\t\t";
+            item = ECFDivertWhenNotAvailable;
+            }
+        };
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_cf_main_lbx
+//    List items in the call divert main view. IDs are from enum 
+//    TGSCallDivertServiceGroups.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_cf_main_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_voice_calls;
+            item = EGSSettIdVoiceDivert;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_video_calls;
+            item = EGSSettIdVideoDivert;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_cf_div_view
+//    The diverts view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_cf_div_view
+    {
+    menubar = r_cf_menubar_options_view;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CONTEXTOPTIONS;
+    }
+
+// -----------------------------------------------------------------------------
+//    
+//    r_cf_restricted_main_lbx_resource
+//    List box resource.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_cf_restricted_main_lbx_resource
+    {
+    array_id = r_cf_restricted_main_lbx;
+    flags = EEikListBoxMultipleSelection;    
+    }
+
+//-----------------------------------------------------------------------------
+//    
+//    r_cf_restricted_main_lbx
+//    List items in the restricted call divert main view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_cf_restricted_main_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_div_restricted;
+            item = ECFDivertVoiceCalls;
+            }
+        };    
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_title_array
+//    Titles for specific popups.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_title_array
+    {
+    items =
+        {
+        LBUF {txt = qtn_div_title_all;},
+        LBUF {txt = qtn_div_title_all_video;},
+        LBUF {txt = qtn_div_title_busy;},
+        LBUF {txt = qtn_div_title_not_answered;},
+        LBUF {txt = qtn_div_title_not_reach;},
+        LBUF {txt = qtn_div_title_not_available;}
+        };
+    }
+
+//-----------------------------------------------------------------------------
+//
+//   (various resources)
+//   Texts for additional dialogs and popups.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_text_divert_to_voice_mail {buf = text_divert_to_voice_mail;}
+RESOURCE TBUF r_text_divert_to_number     {buf = text_divert_to_number;}
+RESOURCE TBUF r_text_slist_seconds        {buf = qtn_div_slist_seconds;}
+RESOURCE TBUF r_text_delay_header         {buf = qtn_div_heading_delay;}
+RESOURCE TBUF r_text_prmpt_data_number    {buf = qtn_ss_prmpt_video_number;}
+RESOURCE TBUF r_text_prmpt_number         {buf = qtn_div_prmpt_number;}
+RESOURCE TBUF r_invalid_number            {buf = text_invalid_number;}
+
+//-----------------------------------------------------------------------------
+//
+//    r_data_query
+//    "To other number"-dialog
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_data_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_SEARCH_BACK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = EPhoneLayout;
+                control = EDWIN
+                    {
+                    flags = EEikEdwinNoHorizScrolling;
+                    width = 10;
+                    lines = 1;
+                    maxlength = KGSMaxDataLength;
+                    numeric_keymap=EAknEditorStandardNumberModeKeymap;
+                    allowed_input_modes=EAknEditorNumericInputMode;
+                    default_input_mode=EAknEditorNumericInputMode;
+                    };
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//   r_cf_softkeys_search_cancel, own cba for
+//   search - cancel softkey combination
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_cf_softkeys_search_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON{id=EAknSoftkeySearch; txt=text_softkey_search; },
+        CBA_BUTTON{id=EAknSoftkeyCancel; txt=text_softkey_cancel; },
+        CBA_BUTTON{id=EAknSoftkeySearch; txt=text_softkey_search; }
+        };
+    }
+
+
+RESOURCE TBUF r_qtn_ss_divert_to_video_mailbox
+    {
+    buf = qtn_ss_divert_to_video_mailbox;
+    }
+
+RESOURCE TBUF r_qtn_ss_divert_vcall_to_other_number
+    {
+    buf = qtn_ss_divert_vcall_to_other_number;
+    }
+
+//MSK Labels and Resources
+
+//----------------------------------------------------
+//   
+//    r_call_divert_msk_contextmenubar
+//    Options menu with 'Open'.
+//    Context Menu Options for MSK key handling
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_call_divert_msk_contextmenubar
+    {
+    titles =
+        {
+        MENU_TITLE {menu_pane = r_cf_msk_div_view_menu;}
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_cf_msk_div_view_menu
+//    Menu pane for Context Options.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_cf_msk_div_view_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = ECFCmdActivate;
+            txt = text_activate_divert;
+            },
+        MENU_ITEM
+            {
+            command = ECFCmdCancel;
+            txt = text_cancel_divert;
+            },
+        MENU_ITEM
+            {
+            command = ECFCmdCheckStatus;
+            txt = text_check_status;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_call_divert_contact_selection_interest
+//    Contact selection interest.
+//
+//----------------------------------------------------
+RESOURCE AIW_INTEREST r_call_divert_contact_selection_interest
+    {
+    items=
+        {
+        AIW_CRITERIA_ITEM
+            {
+            id = KAiwCmdSelect;  // serviceCmd used here also as ID
+            serviceCmd   = KAiwCmdSelect;
+            contentType  = EGenericParamContactLinkArrayStr;
+            serviceClass = KAiwClassBase;
+            maxProviders = 1;
+            }
+        };
+    }
+    
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/GSCallDivertPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallDivertPlugin project file.
+*
+*/
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gscalldivertplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x102824A3
+VENDORID            VID_DEFAULT
+
+SOURCEPATH  Src  // /GSTelPlugin
+SOURCE      GSCallDivertPluginImplementationTable.cpp
+SOURCE      GSLocalBaseView.cpp
+SOURCE      GSRestrictedDivertContainer.cpp
+SOURCE      GSCallDivertPluginContainer.cpp
+SOURCE      GSCallDivertPlugin.cpp
+SOURCE      GSCallDivertContainer.cpp
+SOURCE      GSCallDivertView.cpp
+SOURCE      GSCallDivertModel.cpp
+
+//SOURCE      GSTelPlugin.cpp
+//SOURCE      GSTelPluginContainer.cpp
+//SOURCE      GSTelPluginModel.cpp
+
+SOURCE      GSCallDivertQuery.cpp
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Data
+USERINCLUDE     ../Logger
+USERINCLUDE     ../GSTelPlugin/Inc
+
+// The above include is required becasue of secuicodequerydialog.h
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  102824A3.rss
+TARGET          gscalldivertplugin.rsc
+END
+
+START RESOURCE  GSCallDivertPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   centralrepository.lib
+LIBRARY   cenrepnotifhandler.lib
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   cone.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   eikctl.lib
+LIBRARY   etelmm.lib            // security, network, call
+LIBRARY   euser.lib
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   gsecomplugin.lib
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   pbkeng.lib
+LIBRARY   pbkview.lib
+LIBRARY   phoneclient.lib       // handle phonenumbers
+LIBRARY   phonesettings.lib
+LIBRARY   psui.lib              // phone settings notes UI
+LIBRARY   sssettings.lib        // Supplementary settings
+LIBRARY   numbergrouping.lib
+LIBRARY   flogger.lib // For GSLogger
+
+LIBRARY   aknnotify.lib         // for CAknGlobalNote.h
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   apgrfx.lib
+LIBRARY   servicehandler.lib    // AIW
+
+LIBRARY   vpbkeng.lib           // Phonebook2
+LIBRARY   pbk2presentation.lib  // Phonebook2
+
+SOURCEPATH      Data
+DOCUMENT        102824A3.rss
+DOCUMENT        GSCallDivertPluginRsc.rss
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/CallDivertPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains definition of constants used in CallDivertPlugin.
+*
+*/
+
+#ifndef GSCALLDIVERTPLUGIN_HRH
+#define GSCALLDIVERTPLUGIN_HRH
+
+// Data query max length
+#ifndef KGSMaxDataLength
+    #define KGSMaxDataLength 21
+#endif
+
+/**
+* Main view is actually a selection list of three basic service groups which 
+* are wanted to be configured:
+*   - Voice calls §qtn_div_voice_calls§ ,
+*   - Data and video calls §qtn_div_data_video_calls§ if the Video telephone is
+*     supported, otherwise Data calls §qtn_div_data_calls§ , and
+*   - Fax calls §qtn_div_fax_calls§
+* When the user selects one of these, control moves to its basic service group 
+* Divert service view, see ? 4.2.1.1 Divert setting service views.
+*/
+enum TGSCallDivertServiceGroups
+    {
+    EGSSettIdVoiceDivert,
+    EGSSettIdVideoDivert
+    };
+
+/**
+* Each basic service group has the same five call forwarding service items in
+* their own views. All three views are specified in this Section, and are 
+* called accordingly as Div_voi, Div_dat, and Div_fax views when a reference is
+* needed. 
+*/
+enum TGSCallDivertServices
+    {
+    ECFDivertVoiceCalls = 0,
+    ECFDivertVideoCalls,
+    ECFDivertWhenBusy,
+    ECFDivertWhenNoAnswer,
+    ECFDivertWhenOutOfReach,
+    ECFDivertWhenNotAvailable
+    };
+
+/**
+* Divert settings view’s options menu has the following functions:
+* - Activate §text_activate_divert§ starts an activation "process" before the service request is sent to the network for a currently focused service. I.e. for the voice calls in case of first five items, further specification in ? 4.3.1.1 For voice calls, and in Fax and Data cases see ? 4.3.1.2 For data and video calls. This option belongs to the context specific options menu list.
+* - Cancel §text_cancel_divert§ deactivates a currently focused service, i.e. deactivates only those basic services which are activated with the Activate function, see more in ? 4.3.2 Deactivation. This option belongs to the context specific options menu list.
+* - Check status §text_check_status§ asks the status of the focused service from the network, i.e. interrogations only those basic services which are activated with the Activate function, see more in ? 4.3.3 Status checking. For composite conditional service If not available this function is not available. This option belongs to the context specific options menu list.
+* - Help §qtn_options_help§ opens a context sensitive help (ref. ? |18| ) with help IDs [DIV_HLP_CALL_FORW_VOI] for the Div_voi view, [DIV_HLP_CALL_FORW_DAT] for the Div_dat view, and [DIV_HLP_CALL_FORW_FAX] for the Div_fax view.
+* - Exit §qtn_options_exit§ . Closes the Control Panel application (ref. ? |3| )
+* I.e. with functions Cancel and Check status service request is sent immediately without any additional queries. 
+* 
+*/
+enum TGSCallDivertFunctions
+    {
+    ECFCmdActivate = 5001,
+    ECFCmdCancel,
+    ECFCmdCheckStatus,
+    ECFCmdCancelAll
+    };
+
+#endif // GSCALLDIVERTPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Call Divert view.
+*
+*/
+
+
+#ifndef GSCALLDIVERTCONTAINER_H
+#define GSCALLDIVERTCONTAINER_H
+
+// INCLUDES
+#include "gsbasecontainer.h"
+#include "CallDivertPlugin.hrh"
+
+// FORWARD DECLARATION
+class CGSListBoxItemTextArray;
+
+// CLASS DECLARATION
+/**
+*  GSCallDivertContainer container class
+*/
+class CGSCallDivertContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        *
+        * @param aRect gives the size of container
+        */
+        void ConstructL( const TRect& aRect );
+
+        /* Destructor */
+        ~CGSCallDivertContainer();
+
+        /* Constructor */
+        CGSCallDivertContainer( TGSCallDivertServiceGroups aItemId );
+
+    public:
+        /**
+        * Retrieves the feature id for the selected item in the listbox
+        * @return listbox item array's current feature.
+        */
+        TInt CurrentFeatureId() const;
+
+    private:
+
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+        /* Updates listbox
+        *   @param aItemId
+        */
+        void UpdateListBoxL( TInt aItemId );
+
+        /* Creates listbox
+        *   @param aResLbxId
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+
+        /* Sets title to container */
+        void SetTitleL();
+
+        void CreateListBoxItemsL();
+
+    private: //new
+        void MakeAllVoiceCallDivertsItemL();
+        void MakeAllVideoCallDivertsItemL();
+        void MakeIfBusyItemL();
+        void MakeIfNotAnsweredItemL();
+        void MakeIfOutOfReachItemL();
+        void MakeIfNotAvailableItemL();
+
+	private:
+        // listbox item array
+		CGSListBoxItemTextArray* iListboxItemArray;
+        //variable to store the main view selection
+		TGSCallDivertServiceGroups iItemId;
+
+    };
+
+#endif //GSCALLDIVERTCONTAINER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for call divert functionality. Tries to encapsulate
+*                 most of hw/engine related functionality from UI components.
+*
+*/
+
+#ifndef CGSCALLDIVERTMODEL_H_
+#define CGSCALLDIVERTMODEL_H_
+
+
+#include <data_caging_path_literals.hrh>
+#include "CallDivertPlugin.hrh"
+
+#include <etelmm.h>
+#include <nwdefs.h>
+#include <e32base.h>
+
+
+// Forward declarations:
+class CPsetCallDiverting;
+class CPsetContainer;
+class CPsuiContainer;
+class CPsuiDivertObs;
+class CPhCltUssd;
+class RSSSettings;
+class CPbkContactEngine;
+class CGSCallDivertView;
+class CRepository;
+
+class CGSCallDivertModel : public CBase
+    {
+    public:
+
+        /**
+        * Symbian OS two-phase Constructor
+        * @return
+        */
+        static CGSCallDivertModel* NewL ( );
+
+        /**
+        * Destructor
+        */
+        virtual ~CGSCallDivertModel ( );
+
+    public: // Functions
+
+       /**
+       * Send call divert request.
+       * @param aCallDivertSetting Data used for call divert.
+       * @param aInfo Defines the precise action.
+       * @param aVmbxDivert ETrue if voice mailbox is used as divert number.
+       * @param aCommand This is for CancelAll command.
+       */
+       void SendCallDivertRequestL(
+           TCallDivertSetting& aCallDivertSetting,
+           RMobilePhone::TMobilePhoneServiceAction aInfo,
+           TBool& aVmbxDivert,
+           TInt aCommand,
+           TGSCallDivertServices aService );
+
+        /**
+        * Handles attempts to divert to voicemail box.
+        * @param aTelNumber telephone number of the voicemail box
+        * @return KErrNone on success, otherwise KErrCancel
+        */
+        TInt VoiceMailActivationL( TDes& aTelNumber );
+
+        /**
+        * Handles attempts to divert to videomail box.
+        * @param aTelNumber telephone number of the videomail box
+        * @return KErrNone on success, otherwise KErrCancel
+        */
+        TInt VideoMailActivationL( TDes& aTelNumber );
+
+        /**
+        * Handles attempts to check divert status in restricted
+        * mode (KFeatureIdRestrictedCallDivert).
+        */
+        void CheckStatusRestrictedCallDivertL();
+
+        /**
+        * Handles attempts to cancel call divert restricted
+        * mode (KFeatureIdRestrictedCallDivert).
+        */
+        void CancelRestrictedCallDivertL();
+
+        /**
+        * Returns the contact name matching the number, or the number if
+        * no contact name is found.
+        * Pushes the found (i.e. returned) name into CleanupStack.
+        * @param aTelNum number on which to base the fetch.
+        * @return Pointer to contact name
+        */
+        HBufC* MatchNumberToContactLC( const TDesC& aTelNum );
+
+        /**
+        * @ return Reference to divert handling engine. Does NOT transfer
+        *          ownership.
+        */
+        CPsetCallDiverting* DivertHandler();
+
+        /**
+        * @param aView Reference to call divert view. Does NOT transfer
+        *        ownership.
+        */
+        void SetDivertView( CGSCallDivertView* aDivertView );
+
+        /**
+        * @return Currently selected divert service group.
+        */
+        TGSCallDivertServiceGroups DivertServiceGroup();
+
+        /**
+        * Sets new divert service group. Voice/Data/Fax...
+        * See TGSCallDivertServiceGroups
+        * @param aDivertServiceGroup New divert service group.
+        */
+        void SetDivertServiceGroup(
+            TGSCallDivertServiceGroups aDivertServiceGroup );
+
+        /**
+        * Checks number grouping feature from central repository.
+        * @return ETrue  - Feature supported.
+        *         EFalse - Feature not supported.
+        */
+        TBool NumberGroupingSupportedL();
+
+    private: // Functions
+
+        /**
+        * Symbian OS default constructor
+        */
+        void ConstructL ( );
+
+        /**
+        *  C++ Constructor
+        */
+        CGSCallDivertModel ( );
+
+        /**
+        * Handles attempts to activate call divert in restricted
+        * mode (KFeatureIdRestrictedCallDivert).
+        */
+        void ActivateRestrictedCallDivertL( TTelNumber& aDivertNumber );
+
+        /**
+        * Sets parameters for calling Phone Settings' method.
+        */
+        void SetDivertParametersL( TCallDivertSetting& aDivert,
+                                   TBasicServiceGroups& aBsc,
+                                   TGSCallDivertServices aService,
+                                   TGSCallDivertServiceGroups aServiceGroup );
+
+        /**
+        * Uses the phonesettings-module.
+        *
+        * @param aDivert gives required information such as number,
+        *                timervalue, status etc
+        * @param aInfo   defines the precise action
+        * @param aVmbxValidNumber divert is to a voicemail box number
+        * @param aCommand this is for CancelAll command
+        */
+        void EngineOperatorL( TCallDivertSetting& aDivert,
+            const RMobilePhone::TMobilePhoneServiceAction & aInfo,
+            TBool& aVmbxValidNumber,
+            TInt aCommand,
+            TGSCallDivertServices aService,
+            TGSCallDivertServiceGroups aServiceGroup );
+
+        /**
+        * Removes special chars ('*','+','p','w' and '#') from VMBX number.
+        */
+        static void RemoveSpecialChar(
+            TDes& aVmbxNumber,
+            const TDesC& aSpecChar );
+
+
+    private: // Member variables
+
+        // Selected call divert group. Selected from the main view. Value is
+        // stored here as is accessed by several components.
+        TGSCallDivertServiceGroups iDivertServiceGroup;
+
+        // PhoneSettings engine object for diverts
+        CPsetCallDiverting* iForward;
+
+        // PhoneSettings container
+        CPsetContainer*     iSettings;
+
+        // PSUI container
+        CPsuiContainer*     iObsContainer;
+
+        // Shows PSUI notes
+        CPsuiDivertObs*     iCfObserver;
+
+        // Sending with notes
+        CPhCltUssd* iBasicClient;
+
+        // For fetching line in use info
+        RSSSettings* iSsSettings;
+
+        // Contact engine for retrieving contact numbers
+        CPbkContactEngine*  iContactEngine;
+
+        // Reference to call divert view. NOT owned.
+        CGSCallDivertView* iDivertView;
+
+        // Repository for number grouping run time variation.
+        CRepository* iNumberGroupingRepository;
+    };
+
+#endif /*CGSCALLDIVERTMODEL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View handling for Call Divert.
+*
+*/
+
+
+#ifndef CFVIEW_H
+#define CFVIEW_H
+
+// INCLUDES
+#include "CallDivertPlugin.hrh"
+
+#include <aknlists.h>
+#include <gsbaseview.h>
+#include <gspubsubslistener.h>
+#include <mgssettingpsobserver.h>
+#include <PsetCSP.h>
+#include <eikmenup.h>
+
+// FORWARD DECLARATIONS
+class CGSCallDivertPluginContainer;
+class CGSCallDivertView;
+class CPsetCustomerServiceProfile;
+class CGSCallDivertModel;
+
+// CONSTANTS
+_LIT( KGSCallDivertPluginIconDirAndName, "z:GSCallDivertPlugin.mbm");
+
+// CLASS DECLARATION
+
+/**
+*  CGSCallDivertPlugin view class
+*/
+class CGSCallDivertPlugin : public CGSBaseView,
+                            public MGSSettingPSObserver
+    {
+    public: // Constructors and destructor
+
+        /* Symbian OS default constructor */
+        void ConstructL();
+
+        /* Destructor */
+        ~CGSCallDivertPlugin();
+
+
+        /* Symbian OS two-phase Constructor
+        *
+        * @return pointer to CGSCallDivertPlugin object
+        */
+        static CGSCallDivertPlugin* NewLC();
+
+        /* C++ Constructor */
+        CGSCallDivertPlugin();
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS connection view.
+        */
+        static CGSCallDivertPlugin* NewL( TAny* aInitParams );
+
+
+    public: // functions from base class CAknView
+
+        /**
+        * From CAknView, gives the id of the view.
+        *
+        * @return Returns the TUid of the view.
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikCommandObserver, handles the commands.
+        *
+        * @param aCommand identifies the command given.
+        */
+        void HandleCommandL( TInt aCommand );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    protected: // From MEikMenuObserver
+
+        /**
+        *
+        */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aItemId An item which is updated.
+        *
+        */
+        void UpdateListBox( TInt aItemId );
+
+        void SetCSPActiveL( TBool aValue );
+
+    private: // from base class CGSBaseView
+
+        /* From CAknView, activates the view. */
+        void DoActivateL(
+            const TVwsViewId& /*aPrevViewId*/,
+            TUid /*aCustomMessageId*/,
+            const TDesC8& /*aCustomMessage*/ );
+
+        /* From CAknView, deactivates the view. */
+        void DoDeactivate();
+
+        void NewContainerL();
+
+    private: // from CGSBaseView
+
+        void HandleListBoxSelectionL();
+
+        //Retrieves container pointer.
+        CGSCallDivertPluginContainer*  Container();
+
+    private: // From MGSSettingPSObserver
+        /**
+        * Callback from MGSSettingPSObserver
+        */
+        void HandleNotifyPSL( const TUid aUid, const TInt& aKey,
+                              const TRequestStatus& aStatus );
+
+    private:
+
+        // Local view of call diverts.
+        CGSCallDivertView* iCallDivertView;
+        // PubSub object for BT SAP state.
+        CGSPubSubsListener* iBtSapListener;
+        // Check if CSP is active.
+        CPsetCustomerServiceProfile* iCSP;
+
+        // Model for call diverts.
+        CGSCallDivertModel* iCallDivertModel;
+    };
+
+#endif
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Call Divert Plugin.
+*
+*/
+
+
+#ifndef GSDIVERTPLUGINCONTAINER_H
+#define GSDIVERTPLUGINCONTAINER_H
+
+// INCLUDES
+#include "gsbasecontainer.h"
+
+// CLASS DECLARATION
+class CGSListBoxItemTextArray;
+
+// CLASS DECLARATION
+/**
+*  CGSCallDivertPluginContainer container class
+*/
+class CGSCallDivertPluginContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        *
+        * @param aRect gives the size of container
+        */
+        void ConstructL( const TRect& aRect );
+
+        /** Destructor */
+        ~CGSCallDivertPluginContainer();
+
+    private:
+
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    public:
+        /**
+        * Updates the listbox items
+        * @param aFeatureId: selected listbox item ID
+        */
+        void UpdateListBoxL( TInt aFeatureId );
+
+        /**
+        * Retrieves the feature id for the selected item in the listbox
+        * @return listbox item array's current feature.
+        */
+        TGSCallDivertServiceGroups CurrentFeatureId() const;
+
+
+    protected:
+        /* Creates listbox
+        *   @param aResLbxId
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private: // Functions
+        void MakeVoiceDivertsItemL();
+        void MakeVideoDivertsItemL();
+
+    private: // Member variables
+		CGSListBoxItemTextArray* iListboxItemArray;
+
+    };
+
+#endif // GSDIVERTPLUGINCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertQuery.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Data query dialog for Call Divert view.
+*
+*/
+
+
+#ifndef GSCALLDIVERTQUERY_H
+#define GSCALLDIVERTQUERY_H
+
+// INCLUDES
+#include <AknQueryDialog.h>
+
+// CLASS DECLARATION
+
+/**
+* GSCallDivertQuery is responsible for creating a data query dialog.
+* This class basicly just switches the active softkeys.
+*/
+class CGSCallDivertQuery : public CAknTextQueryDialog
+    {
+    public:  // Constructors and destructor
+
+        /* Two-phased constructor */
+        static CGSCallDivertQuery* NewL( TDes& aDataText,
+            const TTone& aTone,
+            TInt aOKCba,
+            TInt aDefaultCba );
+
+        /* Destructor */
+        ~CGSCallDivertQuery() {};
+
+    public: // Functions from base class
+
+        /**
+        * From CAknQueryDialog, takes care of user input.
+        *   @param  aKeyEvent which event
+        *   @param  aType type of event
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        /**
+        * From CAknQueryDialog, takes care of user input.
+        *   @param  aKeyEvent which event
+        *   @return boolean
+        */
+        TBool NeedToDismissQueryL( const TKeyEvent& aKeyEvent );
+
+        /**
+        * From CEikDialog, called after layout.
+        */
+        void PostLayoutDynInitL();
+
+        /**
+        * From CEikDialog, called before layout.
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * From CEikdialog, check if it is OK to exit.
+        *   @param  aButtonId   id of pressed button
+        */
+        TBool OkToExitL( TInt aButtonId );
+
+        /**
+        * From CAknQueryDialog. Used to update data after stylus event.
+        */
+        TBool HandleQueryEditorStateEventL( CAknQueryControl* aQueryControl,
+                                            TQueryControlEvent aEventType,
+                                            TQueryValidationStatus aStatus );
+
+    private:
+        /* C++ default constructor */
+        CGSCallDivertQuery(   TDes& aDataText,
+                    const TTone& aTone,
+                    TInt aOKCba,
+                    TInt aDefaultCba );
+
+        /**
+        * Updates softkeys to Search-Cancel if required.
+        */
+        void UpdateSoftkeysL();
+
+        /**
+        * Changes softkeys as specified.
+        *
+        *   @param  aCba    new cba
+        */
+        void SetCbaL( TInt aCba );
+
+    private:
+        // OK cba, used when there is text in query.
+        TInt        iOKCba;
+        // Default cba, used when there is no text in query.
+        const TInt  iDefaultCba;
+        // Current cba.
+        TInt        iCurrentCba;
+        // About to exit the Query
+        TInt        iLeaving;
+    };
+
+#endif
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,365 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View handling for Call Divert.
+*
+*/
+
+
+#ifndef CFCALLDIVERTVIEW_H
+#define CFCALLDIVERTVIEW_H
+
+// INCLUDES
+#include "GSLocalBaseView.h"
+#include "CallDivertPlugin.hrh"
+
+#include <aknlists.h>
+#include <AiwContactAssignDataTypes.h>
+#include <AiwCommon.h>
+#include <MVPbkSingleContactOperationObserver.h>
+#include <MVPbkContactStoreListObserver.h>
+#include <nwdefs.h>
+
+// FORWARD DECLARATIONS
+class CAiwServiceHandler;
+class CGSCallDivertModel;
+class CGSCallDivertPluginContainer;
+class CGSCallDivertQuery;
+class CVPbkContactLinkArray;
+class CVPbkContactManager;
+class MVPbkContactLink;
+
+
+// CLASS DECLARATION
+
+/**
+*  CGSCallDivertView view class.
+*/
+class CGSCallDivertView : public CGSLocalBaseView,
+                          public MAiwNotifyCallback,
+                          public MVPbkSingleContactOperationObserver,
+                          public MVPbkContactStoreListObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor
+        */
+        void ConstructL();
+
+        /**
+        * Destructor
+        */
+        ~CGSCallDivertView();
+
+
+        /**
+        * Symbian OS two-phase Constructor
+        * @return pointer to CGSCallDivertView object
+        */
+        static CGSCallDivertView* NewLC( CGSCallDivertModel* aModel );
+
+
+
+    public: // Functions from base class CAknView
+
+        /* C++ Constructor */
+        CGSCallDivertView( CGSCallDivertModel* aModel );
+
+        /**
+        * From CAknView, gives the id of the view.
+        *
+        * @return Returns the TUid of the view.
+        */
+        TUid Id() const;
+
+        /**
+        * From MEikCommandObserver, handles the commands.
+        *
+        * @param aCommand identifies the command given.
+        */
+        void HandleCommandL( TInt aCommand );
+        /**
+        * From MEikCommandObserver, handles the commands.
+        *
+        * @param aCommand identifies the command given.
+        */
+        void ProcessCommandL( TInt aCommand );
+
+    public: // MAiwNotifyCallback
+
+        /**
+        * From MAiwNotifyCallback. Handles notifications caused by an
+        * asynchronous Execute*CmdL call or an event.
+        *
+        * @param aCmdId The service command associated to the event.
+        * @param aEventId Occured event, see AiwCommon.hrh.
+        * @param aEventParamList Event parameters, if any, as defined per
+        *        each event.
+        * @param aInParamList Input parameters, if any, given in the
+        *        related HandleCommmandL.
+        * @return Error code for the callback.
+        */
+        TInt HandleNotifyL(
+            TInt aCmdId,
+            TInt aEventId,
+            CAiwGenericParamList& aEventParamList,
+            const CAiwGenericParamList& aInParamList);
+
+    public: // From MVPbkSingleContactOperationObserver
+
+        /**
+        * This is called when user has selected a contact from pbk2
+        * contacts-dialog.
+        * @param aOperation pbk2 related operation. Not used here.
+        * @param aContact Selected contact data.
+        */
+        void VPbkSingleContactOperationComplete(
+            MVPbkContactOperationBase& aOperation,
+            MVPbkStoreContact* aContact );
+        /**
+        * See MVPbkSingleContactOperationObserver.
+        */
+        void VPbkSingleContactOperationFailed(
+            MVPbkContactOperationBase& aOperation,
+            TInt aError );
+
+    public: // From MVPbkContactStoreListObserver
+
+        /**
+        * See MVPbkContactStoreListObserver.
+        */
+        void OpenComplete();
+
+        /**
+        * See MVPbkContactStoreListObserver.
+        */
+        void StoreReady( MVPbkContactStore& aContactStore );
+
+        /**
+        * See MVPbkContactStoreListObserver.
+        */
+        void StoreUnavailable( MVPbkContactStore& aContactStore,
+                               TInt aReason );
+
+        /**
+        * See MVPbkContactStoreListObserver.
+        */
+        void HandleStoreEventL( MVPbkContactStore& aContactStore,
+                                TVPbkContactStoreEvent aStoreEvent );
+
+    public: // New
+
+        /**
+        * Creates time list to be used in "not available" cf service.
+        * @return Returns user keypress of the list
+        */
+        TInt CreateTimeListL();
+
+    private: // From base class CGSBaseView
+
+        /**
+        * See CGSBaseView.
+        */
+        void NewContainerL();
+
+        /**
+        * See CGSBaseView.
+        */
+        void HandleListBoxSelectionL();
+
+    private: //new
+
+        /**
+        * Executes divert query dialog.
+        * --> voice calls -> all voice calls -> activate -> this popup.
+        *                   OR
+        * --> data calls  -> all data calls  -> activate -> this popup.
+        *
+        * @param aTelNumber user selected existing divert-to number
+        * @param aTitle gives title to the list
+        * @param aVmbxValidNumber divert is to a voicemail box number
+        * @return Returns TTelnumber to be the target for operation.
+        */
+        void ExecuteDivertQueryL( TTelNumber& aTelNumber,
+                                  const TPtrC& aTitle,
+                                  TBool& aVmbxValidNumber );
+
+        /**
+        * Displays a query for divert number. Used for all divert types:
+        * - voice
+        * - data
+        * - fax
+        * diverts.
+        *
+        * @param aValue text in the editor
+        * @param aType Dataquery resource ID text
+        * @return Returns the number.
+        */
+        void ExecuteDivertNumberQueryL( TDes& aValue, TInt aType );
+
+        /**
+        * Single item fetch from the phonebook
+        * @param aNumber fetched phonenumber
+        */
+        void StartAsyncPhoneNumberFetchL( /*TDes& aNumber*/ );
+
+
+        /**
+        * Checks if the user given telephone number contain
+        * illegal ('#', 'p', 'w', ...) characters
+        *
+        *   @param  aDivertTo   user given telephone number
+        */
+        static TInt ValidatePhoneNumberL( const TDesC& aDivertTo );
+
+        /**
+        *   Appends to array a delay time in steps of five (5,10,15,...).
+        *   Delay time is figured out by multiplying index by five.
+        *
+        *   @param   aArrayToAppend
+        *   @param  aIndex
+        */
+        void AppendDelayItemL( CDesCArrayFlat& aArrayToAppend, TInt aIndex );
+
+
+        /**
+        * Seeks '+' from given number.
+        *   @param  aDivertTo   the number checked for
+        *   @return Either KErrNone (no plus) or KCFErrIllegalNumber.
+        */
+        static TInt FindPlus( const TDesC& aDivertTo );
+
+        /**
+        * Sets prompt text to a query.
+        */
+        void SetPromptToQueryL( CGSCallDivertQuery& aQuery,
+                                const TInt& aType );
+
+        /**
+        * Creates items for Delay time list
+        */
+        void CreateDelayTimeItemsL( CDesCArrayFlat& aItems );
+
+        /**
+        * Creates items for Delay time list for restricted call divert
+        */
+        void CreateRestrictedCallDivertDelayTimeItemsL( CDesCArrayFlat& aItems );
+
+        /**
+        * Displays invalid number note.
+        */
+        static void ShowErrorNoteL();
+
+        /**
+        * Updates most recently used voice divert numbers to cenrep
+        *
+        *   @param  aItems          array in which all items are
+        *   @param  aNumber         telNumber to be updated
+        */
+        void UpdateDefaultVoiceDivertNumbersL( TDes& aNumber );
+
+        /**
+        * Reads 3 previously used voice divert numbers.
+        *
+        *   @param  aItems          array in which the items are put into
+        *   @param  aDefaultNumbers array from which default items are read
+        */
+        void ReadDefaultVoiceDivertNumbersL( CDesCArray& aItems,
+                                             CDesC16ArrayFlat& aDefaultNumbers );
+
+        /**
+        * Creates items for the target list ('To voicemailbox', ...)
+        *
+        *   @param  aItems          array in which the items are put into
+        *   @param  aDefaultNumbers array from which default items are read
+        */
+        void CreateVoiceDivertItemsL( CDesCArray& aItems,
+                                      CDesC16ArrayFlat& aDefaultNumbers );
+
+        /**
+        * Creates items for the target list ('To voicemailbox', ...)
+        *
+        *   @param  aItems          array in which the items are put into
+        */
+        void CreateVideoDivertItemsL( CDesCArray& aItems );
+
+        /**
+        * Handles users selection from Target menu
+        */
+        TTelNumber HandleVoiceDivertSelectionL(
+            CAknSinglePopupMenuStyleListBox& aList,
+            CDesC16ArrayFlat& aDefNumbers,
+            TBool& aVmbxDivert );
+
+        /**
+        * Handles users selection from Target menu
+        */
+        TTelNumber HandleVideoDivertSelectionL(
+                CAknSinglePopupMenuStyleListBox& aList );
+        
+        /**
+         * Displays data call number query and activates data divert
+         * @param aTelNumber Phone number for call divert
+         */
+        void DisplayDataCallDivertNumberQueryL( TTelNumber& aTelNumber );
+
+    private:
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    private:
+        // Has selection key been pressed
+        TBool               iRockerPress;
+
+        // Array of setting item titles
+        CDesCArray*         iTitles;
+
+        /**
+        * Member variables related to AIW service handler used by pbk2 contact
+        * selection functionality. Former functionality was synchronous dialog
+        * based but pbk2 framework required refactoring this to asynchronous.
+        * As a result a bucket load of observers and functionality otherwise
+        * unused is needed here. Basically the call divert plugin is now
+        * changed into a state machine because of pbk2 requirement.
+        */
+        // AIW service for pbk2.
+        CAiwServiceHandler* iServiceHandler;
+        // Handles contact stores.
+        CVPbkContactManager* iContactManager;
+        // Pointer to both a contact and a contact field
+        CVPbkContactLinkArray* iContactLinks;
+        // Pbk stores are opened.
+        TBool iStoresOpened;
+        // Stores pbk2 operations.
+        MVPbkContactOperationBase* iRetrieveOperation;
+        // Used pbk2 number query which is asynchronously.
+        TBool iNumberFetchedAsynchronously;
+
+
+        // Call divert request is for voice mailbox.
+        TBool iVoiceMailboxDivert;
+
+        //Context menu items for call forwarding
+        CDesCArrayFlat* iContextMenuItems;
+
+        // Reference to call divert model. NOT owned.
+        CGSCallDivertModel* iModel;
+        TBool iVideoMailboxSupported;
+
+    };
+
+
+
+#endif //CFCALLDIVERTVIEW_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSLocalBaseView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base vew in GSTelPlugin.
+*
+*/
+
+
+#ifndef GSLOCALBASEVIEW_H
+#define GSLOCALBASEVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include <etelmm.h>
+#include <eikclb.h>
+
+// FORWARD DECLARATIONS
+class CGSBaseContainer;
+class CAknNavigationDecorator;
+class CAknViewAppUi;
+
+// CLASS DECLARATION
+/***************************************************
+*     CGSLocalBaseView view class            *
+***************************************************/
+class CGSLocalBaseView : public CAknView,
+                         public MEikListBoxObserver
+    {
+    public:
+        // Panic code used in this class
+        enum KGSViewPanicCodes
+            {
+            EGSViewPanicNullPtr = 1
+            };
+
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        *
+        */
+        virtual void ConstructL()=0;
+
+        /* C++ Constructor */
+        CGSLocalBaseView();
+
+        /**
+        * Destructor.
+        */
+        ~CGSLocalBaseView();
+
+    public:
+
+        /**
+        * This function is used to set the current item in the listbox.
+        * @param aIndex Current item. Default value is 0 i.e. the first item of the list.
+        *
+        */
+        virtual void SetCurrentItem( TInt aIndex = 0 );
+
+    protected: // from CAknView
+
+        /**
+        * Handles client rect change.
+        *
+        */
+        void HandleClientRectChange();
+
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        void DoDeactivate();
+
+    protected: // from MEikListBoxObserver
+
+        /**
+        * Handles listbox events.
+        * @param aListBox Listbox where the event occurred.
+        * @param aEventType Event type.
+        *
+        */
+        void HandleListBoxEventL( CEikListBox* aListBox,
+                                  TListBoxEvent aEventType );
+
+    protected: //new
+
+        /**
+        * Sets the correct navi pane for the view (eg. tabs, empty, string etc.)
+        *
+        */
+        virtual void SetNaviPaneL();
+
+        /**
+        * Creates context for view's navi pane.
+        * @param aResourceId Resource id for navi pane context's resource.
+        *
+        */
+        virtual void CreateNaviPaneContextL( TInt aResourceId );
+
+    protected:
+        // Called by DoActivateL
+        virtual void NewContainerL() = 0;
+        virtual void CreateContainerL();
+
+    private:
+
+        /**
+        * Handles selection of list box.
+        * Called by HandleListBoxEventL
+        */
+        virtual void HandleListBoxSelectionL() = 0;
+
+    protected: // Member variables
+        //Navi pane
+        CAknNavigationDecorator* iNaviPaneContext;
+        //Handle to get the view
+        CAknViewAppUi*      iAppUi;
+        // currently selected listbox item
+        TInt                iCurrentItem;
+        // first item in the listbox
+        TInt                iTopItemIndex;
+        // pointer to the container
+        CGSBaseContainer*   iContainer;
+    };
+//end of file
+#endif //GSLOCALBASEVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSRestrictedDivertContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Restricted Call Divert view.
+*
+*/
+
+
+#ifndef GSDIVERTRESTRICTEDCONTAINER_H
+#define GSDIVERTRESTRICTEDCONTAINER_H
+
+// INCLUDES
+#include "gsbasecontainer.h"
+
+// CLASS DECLARATION
+class CGSListBoxItemTextArray;
+
+// CLASS DECLARATION
+/**
+*  CGSRestrictedDivertContainer container class
+*/
+class CGSRestrictedDivertContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        *
+        * @param aRect gives the size of container
+        */
+        void ConstructL( const TRect& aRect );
+
+        /* Destructor */
+        ~CGSRestrictedDivertContainer();
+
+    private:
+
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+    public:
+        /**
+        * Updates the listbox items
+        * @param aFeatureId: selected listbox item ID
+        */
+        void UpdateListBoxL( TInt aFeatureId );
+
+        /**
+        * Retrieves the feature id for the selected item in the listbox
+        * @return listbox item array's current feature.
+        */
+        TInt CurrentFeatureId() const;
+
+
+    protected:
+        /* Creates listbox
+        *   @param aResLbxId
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private:
+        void CreateListBoxItemsL();
+        void MakeRestrictedDivertItemL();
+
+	private:
+		CGSListBoxItemTextArray* iListboxItemArray;
+
+    };
+
+#endif //GSDIVERTRESTRICTEDCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/LocalViewId.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View ID's for all Telephony Plug-in views.
+*
+*/
+
+
+#ifndef  LOCALVIEWID_H
+#define  LOCALVIEWID_H
+
+const TUid KCallDivertPluginId = {0x102824A3};
+const TUid KCallDivertViewId = {85};
+
+#endif //LOCALVIEWID_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Call Divert's view.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSCallDivertContainer.h"
+#include "CallDivertPlugin.hrh"
+
+#include <aknlists.h>
+#include <GSCallDivertPluginRsc.rsg>
+#include <gslistbox.h>
+#include <csxhelp/cp.hlp.hrh>        // for help context of Divert
+#include <gsfwviewuids.h>     // for KUidGS
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::CGSCallDivertContainer
+//
+// C++ constructor
+// ---------------------------------------------------------------------------
+CGSCallDivertContainer::CGSCallDivertContainer( TGSCallDivertServiceGroups aItemId )
+    : iItemId( aItemId )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::ConstructL
+//
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+    switch( iItemId )
+        {
+        case EGSSettIdVoiceDivert:
+            BaseConstructL( aRect, R_CF_VOICE_VIEW_TITLE, R_CF_DIV_LBX );
+            break;
+        case EGSSettIdVideoDivert:
+            BaseConstructL( aRect, R_CF_VIDEO_VIEW_TITLE, R_CF_DIV_LBX );
+            break;
+        default:
+            break;
+        }
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::~CGSCallDivertContainer
+//
+// Destructor
+// ---------------------------------------------------------------------------
+CGSCallDivertContainer::~CGSCallDivertContainer()
+    {
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::GetHelpContext
+//
+// This function is called when Help application is launched.
+// Only available, when __SERIES60_HELP is defined.
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+
+    switch( iItemId )
+        {
+        case EGSSettIdVoiceDivert:
+            aContext.iContext = KDIV_HLP_CALL_FORW_VOI;
+            break;
+        case EGSSettIdVideoDivert:
+            aContext.iContext = KDIV_HLP_CALL_FORW_DAT;
+            break;
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::ConstructListBoxL
+// Creates list box from resources.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    iListBox->ConstructL(this, EAknListBoxSelectionList);
+
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
+        *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    CreateListBoxItemsL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::CreateListBoxItemsL
+//
+// Creates List box items
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::CreateListBoxItemsL()
+    {
+    if ( iItemId == EGSSettIdVoiceDivert )
+        {
+        MakeAllVoiceCallDivertsItemL();
+        }
+    else if ( iItemId == EGSSettIdVideoDivert )
+        {
+        MakeAllVideoCallDivertsItemL();
+        }
+
+    MakeIfBusyItemL();
+    MakeIfNotAnsweredItemL();
+    MakeIfOutOfReachItemL();
+    MakeIfNotAvailableItemL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL
+//
+// Create voice call diverts item
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( ECFDivertVoiceCalls,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::MakeAllVideoCallDivertsItemL
+//
+// Create data & video call diverts item
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::MakeAllVideoCallDivertsItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( ECFDivertVideoCalls,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL
+//
+// Create if_busy item
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::MakeIfBusyItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( ECFDivertWhenBusy,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL
+//
+// Create if_not_answered item
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::MakeIfNotAnsweredItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( ECFDivertWhenNoAnswer,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL
+//
+// Create if_out_of_reach item
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::MakeIfOutOfReachItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( ECFDivertWhenOutOfReach,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::MakeIfNotAvailableItemL
+//
+// Create if_not_available item
+// ---------------------------------------------------------------------------
+void CGSCallDivertContainer::MakeIfNotAvailableItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( ECFDivertWhenNotAvailable,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertContainer::CurrentFeatureId
+//
+//
+// ---------------------------------------------------------------------------
+TInt CGSCallDivertContainer::CurrentFeatureId() const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,598 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for call divert functionality. Tries to encapsulate
+*                 most of hw/engine related functionality from UI components.
+*
+*/
+
+
+
+
+// User includes:
+#include "featmgr.h"
+#include "GSCallDivertModel.h"
+#include "GSCallDivertView.h"
+#include "GsLogger.h"
+#include "GSPhoneSettingConstants.h"
+
+
+// System includes:
+#include <CPbkContactEngine.h>
+#include <CPhCltUssd.h>
+#include <MPsetDivertObs.h>
+#include <PhCltTypes.h>
+#include <PsetContainer.h>
+#include <PsuiContainer.h>
+#include <RPhCltServer.h>
+#include <RSSSettings.h>
+#include <centralrepository.h>
+#include <NumberGroupingCRKeys.h>
+#include <NumberGrouping.h>
+
+// Constants for restricted call divert
+const TInt KMaxLengthSendString = 40;
+_LIT( KOne, "1" );
+_LIT( KAsterisk, "*" );
+_LIT( KHashMark, "#" );
+_LIT( KOneHundredTwenty, "120" );
+
+// Class neme descriptor for panic descriptions
+_LIT( KGSCallDivertModel, "CGSCallDivertModel" );
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::CGSCallDivertModel
+// ---------------------------------------------------------------------------
+CGSCallDivertModel::CGSCallDivertModel()
+{
+}
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::NewL
+// ---------------------------------------------------------------------------
+CGSCallDivertModel* CGSCallDivertModel::NewL()
+{
+    CGSCallDivertModel* self = new( ELeave ) CGSCallDivertModel;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+}
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::ConstructL
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::ConstructL()
+{
+    iContactEngine = CPbkContactEngine::NewL();
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        iBasicClient = CPhCltUssd::NewL();
+        }
+    iSettings = CPsetContainer::NewL();
+    iObsContainer = CPsuiContainer::NewL();
+    iCfObserver = iObsContainer->CreateCFObsL();
+    iForward = iSettings->CreateCFObjectL( *iCfObserver );
+    iSsSettings = new (ELeave) RSSSettings;
+    User::LeaveIfError( iSsSettings->Open() );
+}
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::~CGSCallDivertModel
+// ---------------------------------------------------------------------------
+CGSCallDivertModel::~CGSCallDivertModel()
+{
+    // These objects have to be deleted in specific order or otherwise a access
+    // violation will follow. So, if changing order, be very careful and test
+    // thoroughly.
+    delete iContactEngine;
+    delete iObsContainer;
+    delete iCfObserver;
+    delete iForward;
+    delete iSettings;
+    if (FeatureManager::FeatureSupported ( KFeatureIdRestrictedCallDivert ) )
+        {
+        delete iBasicClient;
+        }
+    if( iSsSettings )
+        {
+        iSsSettings->Close ( );
+        delete iSsSettings;
+        }
+    if( iNumberGroupingRepository )
+        {
+        delete iNumberGroupingRepository;
+        iNumberGroupingRepository = NULL;
+        }
+}
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::SendCallDivertRequestL
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::SendCallDivertRequestL(
+    TCallDivertSetting& aCallDivertSetting,
+    RMobilePhone::TMobilePhoneServiceAction aInfo,
+    TBool& aVmbxDivert,
+    TInt aCommand,
+    TGSCallDivertServices aDivertService )
+    {
+    // Set Delay time if necessary.
+    TInt retVal = KCFNoNeedToGetTimeValue;
+
+    //User is doing activation
+    if ( aCallDivertSetting.iSetting == EActivateDiverting )
+        {
+        if ( aCallDivertSetting.iNumber == KNullDesC )
+            {
+            return; //User started to activate, but cancelled.
+            }
+        //Delay time needs to be set for no answer, not available.
+        if ( aDivertService == ECFDivertWhenNoAnswer ||
+             aDivertService ==  ECFDivertWhenNotAvailable )
+            {
+            retVal = iDivertView->CreateTimeListL();
+            }
+        }
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        // Always ask for duration if it's restricted call divert
+        retVal = iDivertView->CreateTimeListL();
+        }
+    //Call Phonesettings if all values have been set.
+    if ( retVal )
+        {
+        if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+            {
+            __GSLOGSTRING(  "[CGSCallDivertModel::SendCallDivertRequestL] -- Sending restricted call divert request: --" );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aCallDivertSetting.iNumber:%S",   &aCallDivertSetting.iNumber );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] iDivertServiceGroup:  %d",        iDivertServiceGroup );
+
+            ActivateRestrictedCallDivertL( aCallDivertSetting.iNumber );
+            }
+        else
+            {
+            __GSLOGSTRING(  "[CGSCallDivertModel::SendCallDivertRequestL] -- Sending call divert request: --" );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aCallDivertSetting.iNumber:%S",   &aCallDivertSetting.iNumber );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aInfo:                %d",        aInfo );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aVmbxDivert:          %d",        aVmbxDivert );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aCommand:             %d",        aCommand );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aDivertService:       %d",        aDivertService );
+            __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] iDivertServiceGroup:  %d",        iDivertServiceGroup );
+
+            // Make a call to PhoneSettings.
+            EngineOperatorL( aCallDivertSetting, aInfo, aVmbxDivert, aCommand, aDivertService, iDivertServiceGroup );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::EngineOperatorL
+//
+// Seems to be a blocking function...
+// Handles the engine operating, arguments tell what to call and
+// the number if needed.
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::EngineOperatorL(
+    TCallDivertSetting& aDivert,
+    const RMobilePhone::TMobilePhoneServiceAction& aInfo,
+    TBool& aVmbxValidNumber,
+    TInt aCommand,
+    TGSCallDivertServices aDivertService,
+    TGSCallDivertServiceGroups aDivertServiceGroup )
+    {
+    __GSLOGSTRING("[CGSCallDivertModel::EngineOperatorL] Start...");
+
+    TBasicServiceGroups bsc = EAllTeleAndBearer;
+    aDivert.iNoReplyTimer = 0;
+
+    if ( aCommand == ECFCmdCancelAll )
+        {
+        aDivert.iCondition = EDivertConditionAllCalls;
+        aDivert.iSetting = EEraseDiverting;
+        aDivert.iStatus = EDivertingStatusUnknown;
+        aDivert.iServiceGroup = EServiceGroupAllTeleservices;
+        aDivert.iNumber.Zero();
+        iForward->SetDivertingL( aDivert, bsc );
+
+        __GSLOGSTRING("[CGSCallDivertModel::EngineOperatorL] ECFCmdCancelAll");
+        return;
+        }
+
+    SetDivertParametersL( aDivert, bsc, aDivertService, aDivertServiceGroup );
+    __GSLOGSTRING1("[CGSCallDivertModel::EngineOperatorL] ServiceGroup: %d", bsc);
+
+    switch ( aInfo )
+        {
+        case RMobilePhone::EServiceActionUnspecified:
+            iForward->GetDivertingStatusL( aDivert.iServiceGroup,
+                                           aDivert.iCondition,
+                                           bsc );
+            break;
+        case RMobilePhone::EServiceActionActivate:
+            aDivert.iSetting = EActivateDiverting;
+            iForward->SetDivertingL( aDivert, bsc, aVmbxValidNumber );
+            break;
+        case RMobilePhone::EServiceActionErase:
+            aDivert.iSetting = EEraseDiverting;
+            iForward->SetDivertingL( aDivert, bsc );
+            break;
+        case RMobilePhone::EServiceActionDeactivate:
+            aDivert.iSetting = ECancelDiverting;
+            iForward->SetDivertingL( aDivert, bsc );
+            break;
+        case RMobilePhone::EServiceActionRegister:
+            aDivert.iSetting = ERegisterDiverting;
+            iForward->SetDivertingL( aDivert, bsc, aVmbxValidNumber );
+            break;
+        default:
+            Panic ( KGSCallDivertModel, EInvalidDivertAction );
+            break;
+        }
+    __GSLOGSTRING("[CGSCallDivertModel::EngineOperatorL] End.");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::VoiceMailActivationL
+//
+// Handles activation attempts to voicemail box.
+// ---------------------------------------------------------------------------
+TInt CGSCallDivertModel::VoiceMailActivationL( TDes& aTelNumber )
+    {
+    __GSLOGSTRING1("[CGSCallDivertModel::VoiceMailActivationL] aTelNumber: %S", &aTelNumber);
+    TRAPD( err, iForward->VoiceMailQueryL( aTelNumber ) );
+    if ( err )
+        {
+    	__GSLOGSTRING1("[CGSCallDivertModel::VoiceMailActivationL] err=%d", err);
+    	// If application is killed via FSW, contact selection query
+    	// returns KLeaveExit. This should propagate to "root"
+    	// application where it reaches the active scheduler loop 
+    	// and thus allows proper application exit when the loop exits.
+    	// Therefore propagate the error to caller and do not ignore it.
+    	if ( KLeaveExit == err )
+    		{
+    		__GSLOGSTRING("[CGSCallDivertModel::VoiceMailActivationL] KLeaveExit");
+    		User::Leave( err );
+    		}
+        return KErrCancel;
+        }
+    //Vmbx number can be "invalid" from CF point of view, because they are allowed to
+    //contain special characters. These must be removed before making a divert to the
+    //vmbx number.
+    //E.g. number +35850888#45 becomes +35850888 (end is dropped).
+    TInt noOfInvalidChars = KCFInvalidChars().Length();
+
+    for ( TInt index = 0; index < noOfInvalidChars; index++ )
+        {
+        RemoveSpecialChar( aTelNumber, KCFInvalidChars().Mid( index, 1 ) );
+        }
+    __GSLOGSTRING1("[CGSCallDivertModel::VoiceMailActivationL] aTelNumber: %S", &aTelNumber);
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::VideoMailActivationL
+//
+// Handles activation attempts to videomail box.
+// ---------------------------------------------------------------------------
+TInt CGSCallDivertModel::VideoMailActivationL( TDes& aTelNumber )
+    {
+    __GSLOGSTRING1("[CGSCallDivertModel::VideoMailActivationL] aTelNumber: %S", &aTelNumber);
+    // Trapped to return KErrCancel in all cases in order to provide same
+    // behaviour as in VoiceMailActivationL method (Both methods can be used
+    // in the same manner)
+    TRAPD( err, iForward->VideoMailQueryL( aTelNumber ) );
+    if ( err )
+        {
+        return KErrCancel;
+        }
+    //Vmbx number can be "invalid" from CF point of view, because they are allowed to
+    //contain special characters. These must be removed before making a divert to the
+    //vmbx number.
+    //E.g. number +35850888#45 becomes +35850888 (end is dropped).
+    TInt noOfInvalidChars = KCFInvalidChars().Length();
+    TPtrC invalidChars( KCFInvalidChars );
+    for ( TInt index = 0; index < noOfInvalidChars; index++ )
+        {
+        RemoveSpecialChar( aTelNumber, TPtrC( &invalidChars[ index ] ) );
+        }
+    __GSLOGSTRING1("[CGSCallDivertModel::VideoMailActivationL] aTelNumber: %S", &aTelNumber);
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::ActivateRestrictedCallDivertL
+//
+// Handles attempts to activate call divert in restricted mode
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::ActivateRestrictedCallDivertL(
+    TTelNumber& aDivertNumber )
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        //Send Number and ringing time to network by using USSD.
+        HBufC* sendString = HBufC::NewLC( KMaxLengthSendString );
+        TPtr ptr = sendString->Des();
+
+        //Start call forwarding has following syntax:
+        //*120*SI1*SI2*SI3 # SEND(Start & Set CF number & Set the time (sec.))
+        //where: S1 = 1
+        //SI2:(CF number)
+        //SI3: 0 - 120(ringing time (sec.))
+        ptr.Append( KAsterisk );
+        ptr.Append( KOneHundredTwenty );
+        ptr.Append( KAsterisk );
+        ptr.Append( KOne );
+        ptr.Append( KAsterisk );
+        ptr.Append( aDivertNumber );
+        ptr.Append( KAsterisk );
+        ptr.AppendNum( iForward->GetTimerValueL() );
+        ptr.Append( KHashMark );
+
+        iBasicClient->SendUssd( *sendString );
+        CleanupStack::PopAndDestroy( sendString );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::CheckStatusRestrictedCallDivertL
+//
+// Handles attempts to check divert status in restricted mode
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::CheckStatusRestrictedCallDivertL()
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        //Check call forwarding: * # 120*SI1 # SEND
+        HBufC* sendString = HBufC::NewLC( KMaxLengthSendString );
+        TPtr ptr = sendString->Des();
+        ptr.Append( KAsterisk );
+        ptr.Append( KHashMark );
+        ptr.Append( KOneHundredTwenty );
+        ptr.Append( KAsterisk );
+        ptr.Append( KOne );
+        ptr.Append( KHashMark );
+        iBasicClient->SendUssd( *sendString );
+        CleanupStack::PopAndDestroy( sendString );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::CancelRestrictedCallDivertL
+//
+// Handles attempts to cancel call divert in restricted mode
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::CancelRestrictedCallDivertL()
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        //Cancel call forwarding: # 120*SI1 # SEND
+        HBufC* sendString = HBufC::NewLC( KMaxLengthSendString );
+        TPtr ptr = sendString->Des();
+        ptr.Append( KHashMark );
+        ptr.Append( KOneHundredTwenty );
+        ptr.Append( KAsterisk );
+        ptr.Append( KOne );
+        ptr.Append( KHashMark );
+        iBasicClient->SendUssd( *sendString );
+        CleanupStack::PopAndDestroy( sendString );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::SetDivertParametersL
+//
+// Sets parameters for EngineOperator function
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::SetDivertParametersL(
+        TCallDivertSetting& aDivert,
+        TBasicServiceGroups& aBsc,
+        TGSCallDivertServices aDivertService,
+        TGSCallDivertServiceGroups aDivertServiceGroup )
+    {
+    aDivert.iStatus = EDivertingStatusUnknown;
+     //complains for ambiguous definition of EUnknown
+     //need to correct in PhoneSettings.
+    aBsc = ( TBasicServiceGroups )-1;
+
+    if ( aDivertServiceGroup == EGSSettIdVoiceDivert )
+        {
+        aDivert.iServiceGroup = EServiceGroupVoice;
+        }
+    else
+        {
+        aDivert.iServiceGroup = EServiceGroupData;
+        aBsc = EAllBearer;
+        }
+
+    switch ( aDivertService )
+        {
+        case ECFDivertVoiceCalls:
+            {
+            aDivert.iCondition = EDivertConditionUnconditional;
+            TInt alsLine = ESSSettingsAlsNotSupported;
+            TInt alsError = iSsSettings->Get( ESSSettingsAls, alsLine );
+            if ( alsLine == ESSSettingsAlsNotSupported || ( alsLine == ESSSettingsAlsPrimary ) )
+                {
+                // Etelephony only activates voice service nothing else or causes
+                // voice service status request.
+                aBsc = ETelephony;
+                }
+            else // ESSSettingsAlsAlternate
+                {
+                // EAltTele only activates alternate service nothing else or causes
+                // alternate service status request.
+                aBsc = EAltTele;
+                }
+            break;
+            }
+        case ECFDivertWhenBusy:
+            aDivert.iCondition = EDivertConditionBusy;
+            break;
+        case ECFDivertWhenNoAnswer:
+            aDivert.iCondition = EDivertConditionNoReply;
+            aDivert.iNoReplyTimer = iForward->GetTimerValueL();
+            break;
+        case ECFDivertWhenOutOfReach:
+            aDivert.iCondition = EDivertConditionNotReachable;
+            break;
+        case ECFDivertWhenNotAvailable:
+            aDivert.iCondition = EDivertConditionAllConditionalCases;
+            aDivert.iNoReplyTimer = iForward->GetTimerValueL();
+            break;
+        case ECFDivertVideoCalls:
+            aBsc = EAllBearer;
+            aDivert.iCondition = EDivertConditionUnconditional;
+            break;
+        default:
+            Panic ( KGSCallDivertModel, EInvalidCurrentItem );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::MatchNumberToContactLC
+//
+// Returns the contact name matching the number, or the number if
+// no contact name is found.
+// Pushes the found (i.e. returned) name into Cleanupstack.
+// @see CContactDatabase::MatchPhoneNumberL(const TDesC&,const TInt)
+// ---------------------------------------------------------------------------
+HBufC* CGSCallDivertModel::MatchNumberToContactLC( const TDesC& aTelNum )
+    {
+    CContactIdArray* idArray = iContactEngine->MatchPhoneNumberL(
+        aTelNum,
+        KCFCharactersToMatch );
+    CleanupStack::PushL( idArray );
+    HBufC* contactTitle = NULL;
+    // fill data only if only single match is found
+    TInt matches = idArray->Count();
+    TBool conflict = EFalse;
+    if ( matches >= KCFSingleContact )
+        {
+        //several matches, have to check that id is the same
+        if ( matches != KCFSingleContact )
+            {
+            for ( TInt i = 1 ; i < matches ; i++ )
+                {
+                //all have to have same ID
+                if ( (*idArray)[i] != (*idArray)[0] )
+                    {
+                    conflict = ETrue;
+                    break; //stop comparing
+                    }
+                }
+            }
+        //Contact names are only shown if single match with same ID.
+        if ( !conflict )
+            {
+            CPbkContactItem* pbkItem =
+                iContactEngine->ReadContactLC( ( *idArray )[0] );
+            contactTitle = iContactEngine->GetContactTitleL( *pbkItem );
+            CleanupStack::PopAndDestroy( pbkItem );
+            }
+        }
+    CleanupStack::PopAndDestroy( idArray );
+    CleanupStack::PushL( contactTitle );
+    if( contactTitle )
+        {
+        __GSLOGSTRING1("[CGSCallDivertModel::MatchNumberToContactLC] contactTitle: %S", &contactTitle);
+        }
+    return contactTitle;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Removes a special character from vmbx number.
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::RemoveSpecialChar( TDes& aVmbxNumber,
+                                            const TDesC& aSpecChar )
+    {
+    TInt location = aVmbxNumber.Find( aSpecChar );
+    if ( location != KErrNotFound )
+        {
+        aVmbxNumber = aVmbxNumber.Left( location );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::DivertHandler
+// ---------------------------------------------------------------------------
+CPsetCallDiverting* CGSCallDivertModel::DivertHandler()
+    {
+    return iForward;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::SetDivertView
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::SetDivertView( CGSCallDivertView* aDivertView )
+    {
+    iDivertView = aDivertView;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::CGSCallDivertModel
+// ---------------------------------------------------------------------------
+TGSCallDivertServiceGroups CGSCallDivertModel::DivertServiceGroup()
+    {
+    return iDivertServiceGroup;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::SetDivertServiceGroup
+// ---------------------------------------------------------------------------
+void CGSCallDivertModel::SetDivertServiceGroup(
+    TGSCallDivertServiceGroups aDivertServiceGroup )
+    {
+    iDivertServiceGroup = aDivertServiceGroup;
+    __GSLOGSTRING1( "[CGSCallDivertModel::SetDivertServiceGroup] aDivertServiceGroup:%d ",
+                    aDivertServiceGroup )
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertModel::NumberGroupingSupportedL
+//
+// ---------------------------------------------------------------------------
+TBool CGSCallDivertModel::NumberGroupingSupportedL()
+    {
+    TInt numberGroupingVal;
+    TBool retVal = EFalse;
+    if( !iNumberGroupingRepository )
+        {
+        iNumberGroupingRepository = CRepository::NewL( KCRUidNumberGrouping );
+        }
+    iNumberGroupingRepository->Get( KNumberGrouping, numberGroupingVal );
+    switch( numberGroupingVal )
+        {
+        case CPNGNumberGrouping::ENumberGroupingDisabled:
+            retVal = EFalse;
+            break;
+        case CPNGNumberGrouping::ENumberGroupingEnabled:
+            retVal = ETrue;
+            break;
+        default:
+            retVal = EFalse;
+            break;
+        }
+    return retVal;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,432 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main view handling for Call Divert.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSCallDivertPlugin.h"
+#include "GSCallDivertPluginContainer.h"
+#include "GSCallDivertView.h"
+#include "LocalViewId.h"
+#include "GSCallDivertModel.h"
+
+#include <gscommon.hrh>
+#include <coeaui.h>
+#include <hlplch.h>             // For HlpLauncher
+#include <aknViewAppUi.h>
+#include <GSCallDivertPluginRsc.rsg>
+#include <gscalldivertplugin.mbg>
+#include <StringLoader.h>
+#include <featmgr.h>
+#include <gsfwviewuids.h>
+#include <gscommon.hrh>
+#include <gsprivatepluginproviderids.h>
+#include <BTSapInternalPSKeys.h>
+
+// LOCAL CONSTANTS
+_LIT( KGSCallDivertPluginResourceFileName, "z:GSCallDivertPluginRsc.rsc" );
+_LIT( KGSNameOfClass, "CGSCallDivertPlugin" );
+enum
+    {
+    EGSCallDivertPluginPanicNullPtr
+    };
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::CGSCallDivertPlugin
+//
+// C++ constructor.
+// ---------------------------------------------------------------------------
+CGSCallDivertPlugin::CGSCallDivertPlugin()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::ConstructL
+//
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------------------------
+void CGSCallDivertPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    OpenLocalizedResourceFileL( KGSCallDivertPluginResourceFileName,
+                                iResourceLoader );
+
+    //PS listener initialization
+    iBtSapListener = CGSPubSubsListener::NewL(
+                     KPSUidBluetoothSapConnectionState,
+                     KBTSapConnectionState, this );
+
+    SetCSPActiveL( ETrue );
+    BaseConstructL( R_CF_MAIN_VIEW );
+
+    iCallDivertModel = CGSCallDivertModel::NewL();
+    CGSCallDivertView* callDivertView = CGSCallDivertView::NewLC( iCallDivertModel );
+    iAppUi->AddViewL( callDivertView );
+    CleanupStack::Pop( callDivertView );
+    iCallDivertView = callDivertView;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::~CGSCallDivertPlugin
+//
+// Destructor.
+// ---------------------------------------------------------------------------
+CGSCallDivertPlugin::~CGSCallDivertPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    TRAP_IGNORE( SetCSPActiveL( EFalse ) );
+    if ( iBtSapListener )
+        {
+        delete iBtSapListener;
+        }
+
+    if( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        AppUi()->RemoveView( KCallDivertPluginId );
+        delete iContainer;
+        }
+    delete iCallDivertModel;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::NewL()
+//
+// Symbian OS default constructor
+// ---------------------------------------------------------------------------
+CGSCallDivertPlugin* CGSCallDivertPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSCallDivertPlugin* self = new( ELeave ) CGSCallDivertPlugin();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::NewLC
+//
+// 1st phase constructor.
+// ---------------------------------------------------------------------------
+CGSCallDivertPlugin* CGSCallDivertPlugin::NewLC()
+    {
+    CGSCallDivertPlugin* self =
+            new ( ELeave ) CGSCallDivertPlugin;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::NewContainerL
+//
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+void CGSCallDivertPlugin::NewContainerL()
+    {
+    iContainer = new ( ELeave ) CGSCallDivertPluginContainer;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::Id
+//
+// implementation of the frameworks virtual function, closely related with view
+// architecture and has little or no relevance here
+// ---------------------------------------------------------------------------
+TUid CGSCallDivertPlugin::Id() const
+    {
+    return KCallDivertPluginId;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::HandleCommandL
+//
+// Handles the received commands
+// ---------------------------------------------------------------------------
+void CGSCallDivertPlugin::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            iAppUi->ActivateLocalViewL( KGSTelPluginUid );
+            break;
+        case EGSCmdAppOpen:
+        case EAknSoftkeyOpen:
+            HandleListBoxSelectionL();
+            break;
+        case ECFCmdCancelAll:
+            iCallDivertView->HandleCommandL( ECFCmdCancelAll );
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::HandleListBoxSelectionL
+//
+// Handles List box selection
+// ---------------------------------------------------------------------------
+void CGSCallDivertPlugin::HandleListBoxSelectionL()
+    {
+    // Other components will see updated value each time this funciton is 
+    // called.
+    iCallDivertModel->SetDivertServiceGroup( Container()->CurrentFeatureId() );
+
+    switch ( iCallDivertModel->DivertServiceGroup() )
+        {
+        case EGSSettIdVoiceDivert:
+        case EGSSettIdVideoDivert:
+            iAppUi->ActivateLocalViewL( KCallDivertViewId );
+            break;
+        default:
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::UpdateListBox
+//
+// Calls Containers UpdateListBoxL method
+// ---------------------------------------------------------------------------
+void CGSCallDivertPlugin::UpdateListBox( TInt aItemId )
+    {
+    if ( Container() )
+        {
+        TRAP_IGNORE( Container()->UpdateListBoxL( aItemId ) );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::DoActivateL
+//
+// Activates view
+// ---------------------------------------------------------------------------
+void CGSCallDivertPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                             TUid aCustomMessageId,
+                                             const TDesC8& aCustomMessage )
+    {
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+
+    iContainer->iListBox->SetTopItemIndex( iTopItemIndex );
+
+    if ( iCurrentItem >= 0 &&
+        iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() ) // magic
+        {
+        iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::DoDeactivate
+//
+// Deactivates view
+// ---------------------------------------------------------------------------
+void CGSCallDivertPlugin::DoDeactivate()
+    {
+    CGSBaseView::DoDeactivate();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::Container
+//
+// Returns call container item
+// ---------------------------------------------------------------------------
+//
+CGSCallDivertPluginContainer* CGSCallDivertPlugin::Container()
+    {
+    return static_cast <CGSCallDivertPluginContainer*> ( iContainer );
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+// ----------------------------------------------------------------------------
+// CGSCallDivertPlugin::GetCaption
+//
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CGSCallDivertPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_CALL_DIVERT_CAPTION );
+
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallDivertPlugin::PluginProviderCategory
+//
+// A means to identify the location of this plug-in in the framework.
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallDivertPlugin::PluginProviderCategory() const
+    {
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallDivertPlugin::Visible
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSCallDivertPlugin::Visible() const
+    {
+    TBool result( ETrue );
+    TInt value = 0;
+    iBtSapListener->Get( value );
+    if ( value == EBTSapNotConnected || value == EBTSapConnecting )
+        {
+        //Now checking also for CSP support
+        __ASSERT_ALWAYS( iCSP, User::Panic( KGSNameOfClass,
+                         EGSCallDivertPluginPanicNullPtr ) );
+        TInt err = KErrNone;
+        err = iCSP->IsCFSupported( result );
+        //CSP modifies result value even if something goes wrong
+        //CSP will return KErrNotSupported (-5) in cases when
+        //it is not possible to read CSP values from SIM card
+        //Call Barring should be still displayed in this case
+        if ( err != KErrNone )
+            {
+            result = ETrue;
+            }
+        }
+    else
+        {
+        result = EFalse;
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSCallDivertPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSCallDivertPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSCallDivertPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetDivSub,
+        fp->FullName(),
+        EMbmGscalldivertpluginQgn_prop_set_div_sub,
+        EMbmGscalldivertpluginQgn_prop_set_div_sub_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPlugin::HandleNotifyPSL
+//
+// Handling PS keys change
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey,
+                                          const TRequestStatus& /* aStatus */ )
+    {
+    if ( aUid == KPSUidBluetoothSapConnectionState &&
+         aKey == KBTSapConnectionState )
+        {
+        Visible();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallDivertPlugin::SetCSPActiveL
+//
+// Set Customer Service Profile active
+// ----------------------------------------------------------------------------
+//
+void CGSCallDivertPlugin::SetCSPActiveL( TBool aValue )
+    {
+    if ( aValue )
+        {
+        iCSP = CPsetCustomerServiceProfile::NewL();
+        User::LeaveIfError( iCSP->OpenCSProfileL() );
+        }
+    else
+        {
+        delete iCSP;
+        iCSP = NULL;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallDivertPlugin::DynInitMenuPaneL()
+//
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSCallDivertPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                            CEikMenuPane* aMenuPane )
+    {
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Call Divert's view.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CallDivertPlugin.hrh"
+#include "GSCallDivertPluginContainer.h"
+
+#include <aknlists.h>
+#include <GSCallDivertPluginRsc.rsg>
+#include <featmgr.h>
+#include <csxhelp/cp.hlp.hrh>          // for help context of Divert
+#include <gsfwviewuids.h>       // for KUidGS
+#include <gslistbox.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::ConstructL
+// Symbian OS two phased constructor
+//
+// ---------------------------------------------------------------------------
+void CGSCallDivertPluginContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+    BaseConstructL( aRect, R_CF_MAIN_VIEW_TITLE, R_CF_MAIN_LBX );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::~CGSCallDivertPluginContainer
+// Destructor
+//
+// ---------------------------------------------------------------------------
+CGSCallDivertPluginContainer::~CGSCallDivertPluginContainer()
+    {
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::GetHelpContext
+// This function is called when Help application is launched.
+// Only available, when __SERIES60_HELP is defined.
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertPluginContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KDIV_HLP_CALL_FORW_MAIN;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::ConstructListBoxL
+// Creates list box from resources.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
+        *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    MakeVoiceDivertsItemL();
+    MakeVideoDivertsItemL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::UpdateListBoxL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSCallDivertPluginContainer::UpdateListBoxL( TInt aFeatureId )
+    {
+    switch( aFeatureId )
+        {
+        case EGSSettIdVoiceDivert:
+            MakeVoiceDivertsItemL();
+            break;
+        case EGSSettIdVideoDivert:
+            MakeVideoDivertsItemL();
+            break;
+        default:
+            break;
+        }
+
+    // Update the listbox
+    iListBox->HandleItemAdditionL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::CurrentFeatureId
+//
+//
+// ---------------------------------------------------------------------------
+TGSCallDivertServiceGroups CGSCallDivertPluginContainer::CurrentFeatureId() const
+    {
+    // Actually listbox item IDs are from TGSCallDivertServiceGroups so safe to cast
+    return (TGSCallDivertServiceGroups) iListboxItemArray->CurrentFeature( );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::MakeVoiceDivertsItemL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSCallDivertPluginContainer::MakeVoiceDivertsItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdVoiceDivert,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertPluginContainer::MakeDataAndVideoDivertsItemL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSCallDivertPluginContainer::MakeVideoDivertsItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdVideoDivert,
+        CGSListBoxItemTextArray::EVisible );
+    }
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSCallDivertPlugin.h"
+
+// Constants
+const TImplementationProxy KGSCallDivertPluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x102824A4, CGSCallDivertPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+//
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                  TInt& aTableCount )
+    {
+    aTableCount = sizeof( KGSCallDivertPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+    return KGSCallDivertPluginImplementationTable;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertQuery.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone number query for Call Divert view.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "GSCallDivertQuery.h"
+
+// CONSTANTS
+const TInt KCFQueryClosing = 1;
+const TInt KCFQueryRunning = 0;
+
+// ================= MEMBER FUNCTIONS =======================
+// ---------------------------------------------------------
+// GSCallDivertQuery::NewL
+// ---------------------------------------------------------
+CGSCallDivertQuery* CGSCallDivertQuery::NewL( TDes& aDataText,
+    const TTone& aTone, TInt aOKCba, TInt aDefaultCba )
+    {
+    CGSCallDivertQuery* self =
+        new ( ELeave ) CGSCallDivertQuery(
+            aDataText, aTone, aOKCba, aDefaultCba );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::GSCallDivertQuery
+// ---------------------------------------------------------
+CGSCallDivertQuery::CGSCallDivertQuery(
+        TDes& aDataText,
+        const TTone& aTone,
+        TInt aOKCba,
+        TInt aDefaultCba )
+    : CAknTextQueryDialog( aDataText, aTone ),
+      iOKCba( aOKCba ),
+      iDefaultCba( aDefaultCba )
+    {
+    }
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::OfferKeyEventL
+// ---------------------------------------------------------
+TKeyResponse CGSCallDivertQuery::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+        TEventCode aType )
+    {
+    if ( aKeyEvent.iCode == EKeyEnter )
+        {
+        CAknQueryControl* control = 
+            static_cast<CAknQueryControl*> ( Control( EGeneralQuery ) );
+        if ( control->GetTextLength() )
+            {
+            TryExitL( EAknSoftkeyOk );
+            }
+        else
+            {
+            TryExitL( EAknSoftkeySearch );
+            }            
+        
+        return EKeyWasConsumed;
+        }
+    
+    CAknTextQueryDialog::OfferKeyEventL( aKeyEvent, aType );
+
+    if ( aKeyEvent.iCode != EKeyEscape )
+        {
+        UpdateSoftkeysL();
+        }
+
+    return EKeyWasConsumed;
+    }
+
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::OfferKeyEventL
+// ---------------------------------------------------------
+TBool CGSCallDivertQuery::NeedToDismissQueryL( const TKeyEvent& aKeyEvent )
+    {
+    if ( aKeyEvent.iCode == EKeyOK )
+        {
+        CAknQueryControl* control =
+            static_cast<CAknQueryControl*> ( Control( EGeneralQuery ) );
+        // check if the editor is empty or has some text
+        if ( control && control->GetTextLength() )
+            {
+            return EFalse;
+            }
+        else
+            {
+            return ETrue;
+            }
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::PostLayoutDynInitL
+// ---------------------------------------------------------
+void CGSCallDivertQuery::PostLayoutDynInitL()
+    {
+    iCurrentCba = 0;
+    iLeaving = KCFQueryRunning;
+    CAknTextQueryDialog::PostLayoutDynInitL();
+    UpdateSoftkeysL();
+    }
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::UpdateSoftkeysL
+// ---------------------------------------------------------
+void CGSCallDivertQuery::UpdateSoftkeysL()
+    {
+    if ( iLeaving != KCFQueryRunning )
+        {
+        return;
+        }
+    CAknQueryControl* control =
+        static_cast<CAknQueryControl*> ( Control( EGeneralQuery ) );
+    if ( control && control->GetTextLength() )
+        {
+        // There is text in cba; we can update softkeys to OK - Cancel.
+        SetCbaL( iOKCba );
+        }
+    else
+        {
+        // There is no text in cba; update softkeys to Search - Back.
+        SetCbaL( iDefaultCba );
+        }
+    }
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::OkToExitL
+// ---------------------------------------------------------
+TBool CGSCallDivertQuery::OkToExitL( TInt aButtonId )
+    {
+
+    if ( aButtonId == EAknSoftkeySearch )
+        {
+        return ETrue;
+        }
+    if ( aButtonId == EAknSoftkeyCancel )
+        {
+        iLeaving = KCFQueryClosing;
+        return ETrue;
+        }
+    if ( aButtonId == EAknSoftkeyBack )
+        {
+        iLeaving = KCFQueryClosing;
+        return ETrue;
+        }
+    iLeaving = KCFQueryClosing;
+    return CAknTextQueryDialog::OkToExitL( aButtonId );
+    }
+
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::SetCba
+// ---------------------------------------------------------
+void CGSCallDivertQuery::SetCbaL( TInt aCba )
+    {
+    if ( iCurrentCba != aCba )
+        {
+        CEikButtonGroupContainer& buttonGroup = ButtonGroupContainer();
+        buttonGroup.SetCommandSetL( aCba );
+        buttonGroup.DrawNow();
+        iCurrentCba = aCba;
+        }
+    MakeLeftSoftkeyVisible( ETrue );
+    }
+
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::PreLayoutDynInitL
+// ---------------------------------------------------------
+void CGSCallDivertQuery::PreLayoutDynInitL()
+    {
+    iCurrentCba = 0;
+    CAknTextQueryDialog::PreLayoutDynInitL();
+
+    if( this->Text().Length() )
+        {
+        MakeLeftSoftkeyVisible( ETrue );
+        }
+    }
+
+
+// ---------------------------------------------------------
+// GSCallDivertQuery::HandleQueryEditorStateEventL
+// ---------------------------------------------------------
+TBool CGSCallDivertQuery::HandleQueryEditorStateEventL(
+    CAknQueryControl* aQueryControl,
+    TQueryControlEvent aEventType,
+    TQueryValidationStatus aStatus )
+    {
+    CAknTextQueryDialog::HandleQueryEditorStateEventL( aQueryControl,
+                                                       aEventType,
+                                                       aStatus );
+    if( aEventType == EQueryControlEditorStateChanging &&
+        aStatus == EEditorValueValid )
+        {
+        UpdateSoftkeysL();
+        }
+    return EFalse;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1358 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main view handling for Call Divert.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSCallDivertContainer.h"
+#include "GSCallDivertModel.h"
+#include "GSCallDivertQuery.h"
+#include "GSCallDivertView.h"
+#include "GsLogger.h"
+#include "GSPhoneSettingConstants.h"
+#include "GSRestrictedDivertContainer.h"
+#include "LocalViewId.h"
+
+
+#include <AiwContactSelectionDataTypes.h>
+#include <AiwGenericParam.h>
+#include <aknnotewrappers.h>        //for AknErrorNote
+#include <AknUtils.h>
+#include <aknViewAppUi.h>
+#include <CPbk2SortOrderManager.h>
+#include <CPbk2StoreConfiguration.h>
+#include <CPbkContactItem.h>
+#include <CPbkSingleItemFetchDlg.h>
+#include <CVPbkContactLinkArray.h>
+#include <CVPbkContactManager.h>
+#include <featmgr.h>
+#include <gscommon.hrh>
+#include <gsfwviewuids.h>          // for restricted call forward
+#include <GSCallDivertPluginRsc.rsg>
+#include <MPbk2ContactNameFormatter.h>
+#include <MVPbkContactFieldData.h>
+#include <MVPbkContactFieldTextData.h>
+#include <MVPbkContactLink.h>
+#include <MVPbkContactOperationBase.h>
+#include <MVPbkContactStoreList.h>
+#include <MVPbkStoreContact.h>
+#include <NumberGrouping.h>         // for Number Grouping
+#include <Pbk2ContactNameFormatterFactory.h>
+#include <PsetCallDiverting.h>
+#include <PsuiConstants.h>
+#include <RPbkViewResourceFile.h>
+#include <AiwServiceHandler.h>
+#include <coeaui.h>
+#include <CVPbkContactStoreUriArray.h>
+#include <CVPbkFieldTypeSelector.h>
+#include <hlplch.h>                 // for Help Launcher
+#include <hlplch.h>             // For HlpLauncher
+#include <RVPbkContactFieldDefaultPriorities.h>
+#include <StringLoader.h>
+#include <VPbkContactViewFilterBuilder.h>
+#include <voicemailboxdomaincrkeys.h>
+#include <centralrepository.h>
+
+using namespace AiwContactAssign;
+
+// LOCAL CONSTANTS
+_LIT( KGSDivertClassName, "CGSCallDivertView" );
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::CGSCallDivertView
+//
+// C++ constructor.
+// ---------------------------------------------------------------------------
+CGSCallDivertView::CGSCallDivertView( CGSCallDivertModel* aModel )
+    : iModel( aModel )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::ConstructL
+//
+// Symbian OS two-phased constructor.
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::ConstructL()
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+            {
+            iModel->SetDivertServiceGroup( EGSSettIdVoiceDivert );
+            }
+    iModel->SetDivertView( this );
+
+    iStoresOpened = EFalse;
+    iNumberFetchedAsynchronously = EFalse;
+
+    BaseConstructL( R_CF_DIV_VIEW );
+
+    iTitles = iCoeEnv->ReadDesCArrayResourceL( R_TITLE_ARRAY );
+    iRockerPress = EFalse;
+
+    //Check video mailbox suppport from cenrep
+    //Since it is static feature, needs to be checked only once
+    CRepository* videoMailboxRepository = 
+                        CRepository::NewLC( KCRUidVideoMailbox );
+    videoMailboxRepository->Get( KVideoMbxSupport, iVideoMailboxSupported );
+    CleanupStack::PopAndDestroy( videoMailboxRepository );
+
+    // AIW for pbk2 contact selection functionality. Construct contact manager
+    // with the same store configuration as in Phonebook currently.
+    iServiceHandler = CAiwServiceHandler::NewL();
+    iServiceHandler->AttachL( R_CALL_DIVERT_CONTACT_SELECTION_INTEREST );
+    CPbk2StoreConfiguration* configuration = CPbk2StoreConfiguration::NewL();
+    CleanupStack::PushL( configuration );
+    CVPbkContactStoreUriArray* uriArray = configuration->CurrentConfigurationL();
+    CleanupStack::PushL( uriArray );
+    iContactManager = CVPbkContactManager::NewL( *uriArray );
+    iContactManager->ContactStoresL().OpenAllL( *this );
+    CleanupStack::PopAndDestroy( uriArray );
+    CleanupStack::PopAndDestroy( configuration );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::~CGSCallDivertView
+//
+// Destructor.
+// ---------------------------------------------------------------------------
+CGSCallDivertView::~CGSCallDivertView()
+    {
+    if ( iTitles )
+        {
+        delete iTitles;
+        }
+    if( iRetrieveOperation )
+        {
+        delete iRetrieveOperation;
+        iRetrieveOperation = NULL;
+        }
+    if( iContactLinks )
+        {
+        delete iContactLinks;
+        iContactLinks = NULL;
+        }
+    
+    TRAP_IGNORE
+        (
+        if( iContactManager )
+            {
+            iContactManager->ContactStoresL().CloseAll( *this );
+            iStoresOpened = EFalse;
+            delete iContactManager;
+            }
+        );
+    delete iServiceHandler;
+
+
+    if( iContextMenuItems )
+    	{
+    	delete iContextMenuItems;
+    	iContextMenuItems = NULL;
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::NewLC
+//
+// 1st phase constructor.
+// ---------------------------------------------------------------------------
+CGSCallDivertView* CGSCallDivertView::NewLC( CGSCallDivertModel* aModel )
+    {
+    CGSCallDivertView* self;
+    self = new ( ELeave ) CGSCallDivertView( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::NewContainerL
+//
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::NewContainerL()
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        iContainer = new (ELeave) CGSRestrictedDivertContainer();
+        }
+    else
+        {
+        iContainer = new (ELeave) CGSCallDivertContainer(
+                     iModel->DivertServiceGroup() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::Id
+//
+// implementation of the frameworks virtual function, closely related with view
+// architecture and has little or no relevance here
+// ---------------------------------------------------------------------------
+TUid CGSCallDivertView::Id() const
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        return KCallDivertPluginId;
+        }
+    else
+        {
+        return KCallDivertViewId;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::HandleCommandL
+//
+// Handles the received commands
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::HandleCommandL( TInt aCommand )
+    {
+    iVoiceMailboxDivert = EFalse;
+    TBool sendRequest = EFalse;
+    RMobilePhone::TMobilePhoneServiceAction info =
+        RMobilePhone::EServiceActionRegister;
+    TCallDivertSetting divertRequest;
+
+    if ( aCommand != ECFCmdCancelAll && iContainer )
+        {
+        if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+            {
+            CGSRestrictedDivertContainer& container =
+                *static_cast<CGSRestrictedDivertContainer*>( iContainer );
+            iCurrentItem = container.CurrentFeatureId();
+            }
+        else
+            {
+            CGSCallDivertContainer& container =
+                *static_cast<CGSCallDivertContainer*>( iContainer );
+            iCurrentItem = container.CurrentFeatureId();
+            }
+        __GSLOGSTRING1("[CGSCallDivertView::HandleCommandL] iCurrentItem: %d", iCurrentItem);
+
+        __ASSERT_ALWAYS( iCurrentItem != KErrNotFound, Panic( KGSDivertClassName,
+                                                              EInvalidCurrentItem ) );
+        }
+
+    switch ( aCommand )
+        {
+        case EGSCmdAppChange:
+            iRockerPress = EFalse;
+            HandleListBoxEventL( iContainer->iListBox, EEventEnterKeyPressed );
+            break;
+        case EAknSoftkeyBack:
+            if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+                {
+                iAppUi->ActivateLocalViewL( KGSTelPluginUid );
+                }
+            else
+                {
+                iAppUi->ActivateLocalViewL( KCallDivertPluginId );
+                }
+            break;
+        case EAknSoftkeyExit:
+            AppUi()->HandleCommandL( EEikCmdExit );
+            break;
+        case ECFCmdActivate:
+            divertRequest.iSetting = EActivateDiverting;
+            info = RMobilePhone::EServiceActionRegister;
+
+            // Activate depends on the selected call type (voice/data/fax)
+            switch( iModel->DivertServiceGroup() )
+                {
+                case EGSSettIdVoiceDivert:
+                    // Handle voice divert. Fetch used numbers and show it in query.
+                    ExecuteDivertQueryL(
+                        divertRequest.iNumber,
+                        iTitles->MdcaPoint( iCurrentItem ),
+                        iVoiceMailboxDivert );
+                    sendRequest = ETrue;
+                    break;
+                case EGSSettIdVideoDivert:
+                    if( iVideoMailboxSupported )
+                        {
+                        // Fetch used data divert number and show it in query.
+                        ExecuteDivertQueryL(
+                                divertRequest.iNumber,
+                                iTitles->MdcaPoint( iCurrentItem ),
+                                iVoiceMailboxDivert );
+                        sendRequest = ETrue;
+                        }
+                    else
+                        {
+                        DisplayDataCallDivertNumberQueryL( divertRequest.iNumber );
+                        sendRequest = ETrue;
+                        }
+                    break;
+                default:
+                    User::Panic( KGSDivertClassName, KErrArgument );
+                    break;
+                }
+            break;
+        case ECFCmdCancel:
+            if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+                {
+                sendRequest = EFalse;
+                iModel->CancelRestrictedCallDivertL();
+                }
+            else
+                {
+                sendRequest = ETrue;
+                divertRequest.iSetting = ECancelDiverting;
+                info = RMobilePhone::EServiceActionErase;
+                }
+            break;
+        case ECFCmdCheckStatus:
+            if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+                {
+                sendRequest = EFalse;
+                iModel->CheckStatusRestrictedCallDivertL();
+                }
+            else
+                {
+                sendRequest = ETrue;
+                divertRequest.iSetting = ECheckStatus;
+                info = RMobilePhone::EServiceActionUnspecified;
+                }
+            break;
+        case ECFCmdCancelAll:
+            sendRequest = ETrue;
+            divertRequest.iSetting = EEraseDiverting;
+            info = RMobilePhone::EServiceActionErase;
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+
+    // If a request needs to be sent.
+    if ( sendRequest )
+        {
+        // will not divert in case empty number
+        iModel->SendCallDivertRequestL( divertRequest,
+                                        info,
+                                        iVoiceMailboxDivert,
+                                        aCommand,
+                                        (TGSCallDivertServices) iCurrentItem );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::HandleListBoxSelectionL
+//
+// Handles List box selection
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::HandleListBoxSelectionL()
+    {
+    iRockerPress = ETrue;
+    CEikMenuBar* menuBar = MenuBar();
+    if ( iRockerPress )
+        {
+        menuBar->SetMenuTitleResourceId( R_CF_MENUBAR_OPTIONS_VIEW );
+        menuBar->SetMenuType( CEikMenuBar::EMenuContext );
+        }
+    else
+        {
+        menuBar->SetMenuTitleResourceId( R_CF_MENUBAR_DIV_VIEW );
+        menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
+        }
+
+    // Display menu bar.
+    menuBar->TryDisplayMenuBarL();
+
+    // Reset menu type to original default (EMenuOptions).
+    menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
+
+    iRockerPress = EFalse;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::ExecuteDivertQueryL
+//
+// --> voice calls -> all voice calls -> activate -> this popup.
+//                          OR
+// --> video calls -> all video calls -> activate -> this popup.
+//
+// ---Example---
+// All [voice/]video calls:
+// To [voice/]video mailbox
+// [050512345678]
+// [543454545435]
+// [342343242343]
+// To other number
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertView::ExecuteDivertQueryL( TTelNumber& aTelNumber,
+                                             const TPtrC& aTitle,
+                                             TBool& aVmbxValidNumber )
+    {
+    __GSLOGSTRING("[CGSCallDivertView::ExecuteDivertQueryL]");
+
+    CAknSinglePopupMenuStyleListBox* list =
+        new ( ELeave ) CAknSinglePopupMenuStyleListBox;
+    CleanupStack::PushL( list );
+
+    CDesC16ArrayFlat* defNumbers =
+        new ( ELeave ) CDesC16ArrayFlat( KCFDefaultNumbers );
+    CleanupStack::PushL( defNumbers );
+
+    CAknPopupList* divertPopup =
+        CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL__OK );
+    CleanupStack::PushL( divertPopup );
+
+    list->ConstructL( divertPopup,CEikListBox::ELeftDownInViewRect );
+    list->CreateScrollBarFrameL( ETrue );
+    list->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff,
+        CEikScrollBarFrame::EAuto );
+    divertPopup->SetTitleL( aTitle );
+    if( iContextMenuItems )
+    	{
+    	delete iContextMenuItems;
+    	iContextMenuItems = NULL;
+    	}
+    iContextMenuItems = new ( ELeave ) CDesCArrayFlat( KCFMaxNrOfTargets );
+    if( iModel->DivertServiceGroup() == EGSSettIdVoiceDivert )
+        {
+        CreateVoiceDivertItemsL( *iContextMenuItems, *defNumbers );
+        }
+    else
+        {
+        CreateVideoDivertItemsL( *iContextMenuItems );
+        }
+    __GSLOGSTRING2( "[CGSCallDivertView::ExecuteDivertQueryL] ItemCount: %d, defNumCount: %d",
+                    iContextMenuItems->Count(),
+                    defNumbers->Count() );
+    CTextListBoxModel* model = list->Model();
+    model->SetItemTextArray( iContextMenuItems );
+    model->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    // Executeld handles the events in the list
+    TBool modified = divertPopup->ExecuteLD();
+    __GSLOGSTRING1("[CGSCallDivertView::ExecuteDivertQueryL] modified: %d", modified);
+    CleanupStack::Pop(); //voiceDivertPopup
+
+    if ( modified )
+        {
+        if( iModel->DivertServiceGroup() == EGSSettIdVoiceDivert )
+            {
+            aTelNumber = HandleVoiceDivertSelectionL( *list,
+                                                      *defNumbers,
+                                                      aVmbxValidNumber );
+            }
+        else
+            {
+            aTelNumber = HandleVideoDivertSelectionL( *list );
+            }
+        }
+    __GSLOGSTRING1( "[CGSCallDivertView::ExecuteVoiceDivertQueryL] aTelNumber: %S",
+                    &aTelNumber);
+    CleanupStack::PopAndDestroy( 2 ); //defNumbers, list
+    __GSLOGSTRING( "[CGSCallDivertView::ExecuteVoiceDivertQueryL] End." );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::HandleVoiceDivertSelectionL
+//
+// Handles user's choice in the Target list.
+// ---------------------------------------------------------------------------
+TTelNumber CGSCallDivertView::HandleVoiceDivertSelectionL(
+    CAknSinglePopupMenuStyleListBox& aList,
+    CDesC16ArrayFlat& aDefNumbers,
+    TBool& aVmbxDivert )
+    {
+    __GSLOGSTRING("[CGSCallDivertView::HandleVoiceDivertSelectionL] Start...");
+    TTelNumber telNumber;
+    telNumber.Zero();
+    TInt index = aList.CurrentItemIndex();
+    __GSLOGSTRING1("[CGSCallDivertView::HandleVoiceDivertSelectionL] index: %d", index);
+
+    if ( index == KCFDivertToMailBox )
+        {
+        if ( iModel->VoiceMailActivationL( telNumber ) == KErrNone )
+            {
+            if ( telNumber == KNullDesC )
+                {
+                ShowErrorNoteL();
+                }
+            aVmbxDivert = ETrue;
+            }
+        }
+    //To other number - make a dataquery
+    else if ( index == ( aList.Model()->NumberOfItems() - 1 ) )
+        {
+        ExecuteDivertNumberQueryL( telNumber, R_TEXT_PRMPT_NUMBER );
+        __GSLOGSTRING1("[CGSCallDivertView::HandleVoiceDivertSelectionL] telNumber: %S", &telNumber);
+
+        UpdateDefaultVoiceDivertNumbersL( telNumber );
+        }
+    //To pre-defined default number
+    else
+        {
+        telNumber = aDefNumbers.MdcaPoint( index - 1 );
+        iModel->DivertHandler()->SwapDefaultNumberL( index );
+        }
+    __GSLOGSTRING("[CGSCallDivertView::HandleVoiceDivertSelectionL] End.");
+    return telNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::HandleVideoDivertSelectionL
+//
+// Handles user's choice in the video Target list.
+// ---------------------------------------------------------------------------
+TTelNumber CGSCallDivertView::HandleVideoDivertSelectionL(
+    CAknSinglePopupMenuStyleListBox& aList )
+    {
+    __GSLOGSTRING("[GSCallDivertView::HandleVideoDivertSelectionL] Start");
+    TTelNumber telNumber( 0 );
+    TInt index = aList.CurrentItemIndex();
+    if ( index == KCFDivertToMailBox )
+        {
+        if ( iModel->VideoMailActivationL( telNumber ) == KErrNone )
+            {
+            if ( telNumber == KNullDesC )
+                {
+                ShowErrorNoteL();
+                }
+            }
+        }
+    else if( index == ( aList.Model()->NumberOfItems() - 1 ) )
+        { // To other number - make a dataquery (Last item in list)
+        DisplayDataCallDivertNumberQueryL( telNumber );
+        __GSLOGSTRING1("[GSCallDivertView::HandleVideoDivertSelectionL] telNumber: %S", &telNumber );
+        }
+    __GSLOGSTRING("[GSCallDivertView::HandleVideoDivertSelectionL] Finished");
+    return telNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::DisplayDataCallDivertNumberQueryL
+//
+// Displays data call number query and sets call divert
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::DisplayDataCallDivertNumberQueryL( TTelNumber& aTelNumber )
+    {
+    aTelNumber = *iModel->DivertHandler()->GetUsedDataNumberLC();
+    ExecuteDivertNumberQueryL( aTelNumber, R_TEXT_PRMPT_DATA_NUMBER );
+    if( aTelNumber != KNullDesC )
+        {
+        iModel->DivertHandler()->SetUsedDataNumberL( aTelNumber );
+        }
+    CleanupStack::PopAndDestroy(); // aTelNumber from GetUsedDataNumberLC()
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::ExecuteDivertNumberQueryL
+//
+// Executes general number query dialog used by all diverts (voice/data/fax)
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertView::ExecuteDivertNumberQueryL( TDes& aValue, TInt aType )
+    {
+    TBool accepted = EFalse;
+    while ( !accepted )
+        {
+        if ( aValue.Length() > KGSMaxDataLength )
+            {
+            //Chop the first extra digits and keep the last KGSMaxDataLength
+            //digits intact. This is according to the spec.
+            aValue.Delete( 0, aValue.Length() - KGSMaxDataLength );
+            }
+
+        __GSLOGSTRING1("[CGSCallDivertView]    ExecuteDivertNumberQueryL: aValue: %S", &aValue);
+
+        if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeEditorDefault ) )
+            {
+            AknTextUtils::DisplayTextLanguageSpecificNumberConversion( aValue );
+            }
+        CGSCallDivertQuery* query = CGSCallDivertQuery::NewL( aValue,
+            CAknQueryDialog::ENoTone,
+            R_AVKON_SOFTKEYS_OK_CANCEL__OK, R_CF_SOFTKEYS_SEARCH_CANCEL );
+        CleanupStack::PushL( query );
+        SetPromptToQueryL( *query, aType );
+        TInt queryAction = query->ExecuteLD( R_DATA_QUERY );
+        CleanupStack::Pop( query );
+        AknTextUtils::ConvertDigitsTo( aValue, EDigitTypeWestern );
+        switch ( queryAction )
+            {
+            case EAknSoftkeySearch:
+                if( iStoresOpened )
+                    {
+                    // Reset the number selection because 'search' is selected.
+                    aValue.Zero();
+                    StartAsyncPhoneNumberFetchL();
+                    accepted = ETrue;// Change to asynchronous mode
+                    }
+                break;
+            case EAknSoftkeyOk:
+                accepted = ETrue;
+                if ( ValidatePhoneNumberL( aValue ) > KCFValidPhoneNumber ||
+                     aValue.Length() == 0 )
+                    {
+                    accepted = EFalse;
+                    }
+                if ( iNumberFetchedAsynchronously )
+                	{
+                	switch( iModel->DivertServiceGroup() )
+                	    {
+                	    case EGSSettIdVoiceDivert:
+                        	UpdateDefaultVoiceDivertNumbersL( aValue );
+                        	break;
+                	    case EGSSettIdVideoDivert:
+                            {
+                	        TTelNumber dataNumber( aValue );// Convert to TTelNumber
+                	        iModel->DivertHandler()->SetUsedDataNumberL( dataNumber );
+                	        break;
+                            }
+                	    default:
+                	        break;
+                	    }
+                	iNumberFetchedAsynchronously = EFalse;
+                	}
+                break;
+            case EAknSoftkeyBack:
+            case EAknSoftkeyCancel:
+            default:
+                accepted = ETrue;
+                aValue.Zero();
+                break;
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::StartAsyncPhoneNumberFetchL
+//
+// Fetches values from phonebook ASYNCHRONOUSLY (pbk2 requirement).
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertView::StartAsyncPhoneNumberFetchL()
+    {
+    TUint fetchFlags = 0;
+
+    // Construct empty filter
+    CVPbkFieldTypeSelector* contactViewFilter =
+                            CVPbkFieldTypeSelector::NewL(iContactManager->FieldTypes());
+    CleanupStack::PushL(contactViewFilter);
+
+    // Append the filter object with suitable criteria (only contacts with
+    // phone number shown)
+    VPbkContactViewFilterBuilder::BuildContactViewFilterL(*contactViewFilter,
+                              EVPbkContactViewFilterPhoneNumber, *iContactManager);
+    RVPbkContactFieldDefaultPriorities array;
+    CleanupClosePushL(array);
+
+    TAiwSingleItemSelectionDataV3 data = TAiwSingleItemSelectionDataV3();
+    // Details selection shows only phone numbers
+    data.SetAddressSelectType(EAiwPhoneNumberSelect);
+    data.SetDefaultPriorities(array);
+    // Contact list shows only contacts that have phone number(s)
+    data.SetFetchFilter(contactViewFilter);
+    data.SetFlags(fetchFlags);
+
+    CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
+    TAiwGenericParam param(EGenericParamContactSelectionData,
+                     TAiwVariant(TAiwSingleItemSelectionDataV3Pckg(data)));
+    inParamList.AppendL(param);
+
+    iServiceHandler->ExecuteServiceCmdL(
+            KAiwCmdSelect,
+            inParamList,
+            iServiceHandler->OutParamListL(),
+            0,
+            this);
+
+    CleanupStack::PopAndDestroy(); // array
+    CleanupStack::PopAndDestroy( contactViewFilter );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::ValidatePhoneNumberL
+//
+// Puts a single resource string into a list.
+// ---------------------------------------------------------------------------
+TInt CGSCallDivertView::ValidatePhoneNumberL( const TDesC& aDivertTo )
+    {
+    TInt enteredNumber = KErrNone;
+    TInt noOfInvalidChars = KCFInvalidChars().Length();
+
+    // Plus is a special case, as it is accepted as first character.
+    // FindPlus returns KCFErrIllegalNumber(1) if the number is not
+    // acceptable.
+    enteredNumber += FindPlus( aDivertTo );
+    for ( TInt index = 0; index < noOfInvalidChars; index++ )
+        {
+        enteredNumber += aDivertTo.Find(
+            KCFInvalidChars().Mid( index, 1 ) );
+        }
+    // Find returns KErrNotFound(-1), if character(s) is not found.
+    // Therefore, after four searches for special characters in the
+    // number, all results that have greater than -5 as result are not
+    // acceptable.
+    if ( enteredNumber > KCFValidPhoneNumber )
+        {
+        ShowErrorNoteL();
+        __GSLOGSTRING( "[CGSCallDivertView::ValidatePhoneNumberL] Invalid phone number. " );
+        }
+    return enteredNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::AppendDelayItemL
+//
+// Appends items to delay time list.
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::AppendDelayItemL( CDesCArrayFlat& aArrayToAppend,
+                                          TInt aIndex )
+    {
+    //Delay times are defined as 5,10,15,20,25,30.
+    //Append each of these to a list.
+    TInt delaySeconds = KCFDelayStep * ( aIndex + 1);
+    HBufC* string = StringLoader::LoadLC( R_TEXT_SLIST_SECONDS, delaySeconds );
+
+    TPtr bufPtr = string->Des();
+    if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) )
+        {
+        AknTextUtils::LanguageSpecificNumberConversion( bufPtr );
+        }
+    aArrayToAppend.AppendL( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::CreateVoiceDivertItemsL
+//
+// Creates items for the targert list.
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::CreateVoiceDivertItemsL(
+    CDesCArray& aItems,
+    CDesC16ArrayFlat& aDefaultNumbers )
+    {
+    HBufC* item = StringLoader::LoadLC( R_TEXT_DIVERT_TO_VOICE_MAIL );
+    aItems.AppendL( *item );
+    CleanupStack::PopAndDestroy( item );
+    ReadDefaultVoiceDivertNumbersL( aItems, aDefaultNumbers );
+    HBufC* string = StringLoader::LoadLC( R_TEXT_DIVERT_TO_NUMBER );
+    aItems.AppendL( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::CreateVideoDivertItemsL
+//
+// Creates items for the data target list.
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::CreateVideoDivertItemsL( CDesCArray& aItems )
+    {
+    HBufC* item = StringLoader::LoadLC( R_QTN_SS_DIVERT_TO_VIDEO_MAILBOX );
+    aItems.AppendL( *item );
+    CleanupStack::PopAndDestroy( item );
+    HBufC* string = StringLoader::LoadLC( R_QTN_SS_DIVERT_VCALL_TO_OTHER_NUMBER );
+    aItems.AppendL( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Seeks '+' from given number. If '+' is first character, it is ignored.
+//
+// ---------------------------------------------------------------------------
+TInt CGSCallDivertView::FindPlus( const TDesC& aDivertTo )
+    {
+    TInt seekPlus = aDivertTo.Find( KCFPlusSign );
+    if ( seekPlus == KErrNotFound )
+        {
+        //no '+' in the number
+        return KErrNone;
+        }
+    //first char '+', but there can additional '+'s
+    if ( seekPlus == 0 )
+        {
+        //ignore first '+'
+        TPtrC concat = aDivertTo.Right( aDivertTo.Length() - 1 );
+        seekPlus = concat.Find( KCFPlusSign );
+        if ( seekPlus != KErrNotFound )
+            {
+            return KCFErrIllegalNumber; //two '+'s in number
+            }
+        return KErrNone;
+        }
+    //'+' in number, but not first char
+    else
+        {
+        return KCFErrIllegalNumber;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::SetPromptToQueryL
+// Sets prompt to a query.
+//
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::SetPromptToQueryL( CGSCallDivertQuery& aQuery,
+                                           const TInt& aType )
+    {
+    HBufC* title = StringLoader::LoadLC( aType );
+    aQuery.SetPromptL( *title );
+    CleanupStack::PopAndDestroy( title );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::CreateDelayTimeItemsL
+// Creates items for delay time list.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertView::CreateDelayTimeItemsL( CDesCArrayFlat& aItems)
+    {
+    for ( TInt index = 0; index < KGSNrOfDelays; index++ )
+        {
+        AppendDelayItemL( aItems, index );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::CreateRestrictedCallDivertDelayTimeItemsL
+// Creates items for Delay time list for restricted call divert.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertView::CreateRestrictedCallDivertDelayTimeItemsL(
+    CDesCArrayFlat& aItems )
+    {
+    // first item is 0 seconds
+    AppendDelayItemL( aItems, -1);
+    for ( TInt index = 0; index < KGSNrOfDelays; index++ )
+        {
+        AppendDelayItemL( aItems, index );
+        }
+    AppendDelayItemL( aItems, ( 60 / KCFDelayStep ) - 1);
+    AppendDelayItemL( aItems, ( 90 / KCFDelayStep ) - 1);
+    AppendDelayItemL( aItems, ( 120 / KCFDelayStep ) - 1);
+    }
+
+// -----------------------------------------------------------------------------
+// CGSCallDivertView::ProcessCommandL
+// -----------------------------------------------------------------------------
+void CGSCallDivertView::ProcessCommandL( TInt aCommand )
+    {
+    MenuBar()->SetContextMenuTitleResourceId( R_CALL_DIVERT_MSK_CONTEXTMENUBAR );
+    // Call base class
+    CAknView::ProcessCommandL( aCommand );
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Before showing a options menu, delete options key specific settings if
+// rocker key has been pressed.
+// ---------------------------------------------------------------------------
+//
+void CGSCallDivertView::DynInitMenuPaneL( TInt aResourceId,
+                                          CEikMenuPane* aMenuPane )
+    {
+    TInt currentItem;
+    CEikMenuBar* menuBar = MenuBar();
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        CGSRestrictedDivertContainer &container =
+            *static_cast<CGSRestrictedDivertContainer*>( iContainer );
+        currentItem = container.CurrentFeatureId();
+        }
+    else
+        {
+        CGSCallDivertContainer& container =
+            *static_cast<CGSCallDivertContainer*>( iContainer );
+        currentItem = container.CurrentFeatureId();
+        }
+
+    if ( aResourceId == R_CF_DIV_VIEW_MENU )
+        {
+        if (!menuBar->ItemSpecificCommandsEnabled() && menuBar->GetMenuType() == CEikMenuBar::EMenuOptions)
+        	{
+        	aMenuPane->SetItemDimmed( ECFCmdActivate, ETrue );
+        	aMenuPane->SetItemDimmed( ECFCmdCancel, ETrue );
+        	aMenuPane->SetItemDimmed( ECFCmdCheckStatus, ETrue );
+        	}
+        //remove help, if not supported from the main divert view
+        //in this step, help is added to context menu too, which
+        //is deleted in the next conditional stmt
+        if ( FeatureManager::FeatureSupported ( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+
+        if ( iRockerPress )
+            {
+            //remove Exit & Help from the menu
+            aMenuPane->SetItemDimmed( EAknCmdExit, ETrue );
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        else
+            {
+            iRockerPress = EFalse;
+            }
+        }
+
+    if ( aResourceId == R_CF_MSK_DIV_VIEW_MENU ||
+         aResourceId == R_CF_DIV_VIEW_MENU )
+        {
+        // when not available does not have check status
+        if ( currentItem == ECFDivertWhenNotAvailable )
+            {
+            aMenuPane->SetItemDimmed( ECFCmdCheckStatus, ETrue );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CGSCallDivertView::ShowErrorNote
+//
+// ---------------------------------------------------------
+void CGSCallDivertView::ShowErrorNoteL()
+    {
+    HBufC* string = StringLoader::LoadLC( R_INVALID_NUMBER );
+    CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue );
+    note->ExecuteLD( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::ReadDefaultVoiceDivertNumbersL
+//
+// Creates defcault items for the target list.
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::ReadDefaultVoiceDivertNumbersL(
+    CDesCArray& aItems,
+    CDesC16ArrayFlat& aDefaultNumbers )
+    {
+    TInt amount = KErrNone;
+
+    // this is for fetching name to a number from phonebook
+    HBufC* defaultName = NULL;
+
+    //Default numbers are fetched from shared data
+    amount = iModel->DivertHandler()->GetDefaultNumbersL( aDefaultNumbers );
+    __ASSERT_ALWAYS( amount == aDefaultNumbers.MdcaCount(),
+        Panic( KGSDivertClassName, ECFDefaultNumberCountError ) );
+
+    for ( TInt i = 0; i < amount; i++ )
+        {
+        //Default numbers should be checked, if there is a contact name associated
+        // with it.
+        defaultName = NULL;
+        defaultName = iModel->MatchNumberToContactLC( aDefaultNumbers.MdcaPoint( i ) );
+        __GSLOGSTRING1("[CGSCallDivertView]    ReadDefaultVoiceDivertNumbersL: defaultName: %S", &defaultName);
+        if ( defaultName )
+            {
+            aItems.AppendL( *defaultName );
+            }
+        else
+            {
+            TTelNumber string;
+            if ( iModel->NumberGroupingSupportedL() )
+                {
+                CPNGNumberGrouping* numberGrouping = CPNGNumberGrouping::NewL(
+                    KPSUIMaxPSUIItemLength );
+                CleanupStack::PushL( numberGrouping );
+
+                if ( aDefaultNumbers.MdcaPoint( i ).Length() <=
+                    numberGrouping->MaxDisplayLength() )
+                    {
+                    numberGrouping->Set( aDefaultNumbers.MdcaPoint( i ) );
+                    string = numberGrouping->FormattedNumber();
+                    }
+                CleanupStack::PopAndDestroy( numberGrouping );
+                }
+            if ( !string.Length() )
+                {
+                string = aDefaultNumbers.MdcaPoint(i);
+                }
+            AknTextUtils::DisplayTextLanguageSpecificNumberConversion( string );
+            aItems.AppendL( string );
+            __GSLOGSTRING1("[CGSCallDivertView]    ReadDefaultVoiceDivertNumbersL: string: %S", &string);
+            }
+        CleanupStack::PopAndDestroy(); //defaultName
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL
+//
+// Updates most recently used numbers to cenrep
+// ---------------------------------------------------------------------------
+void CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL(  TDes& aNumber )
+
+    {
+    if ( aNumber !=  KNullDesC && iContextMenuItems )
+        {
+        //If activation is done to already existing default number,
+        //but using the "Other number" selection, this must be verified.
+        HBufC* contactName = iModel->MatchNumberToContactLC( aNumber );
+
+        TInt found = KErrNone;
+        TInt loc = KErrNotFound;
+
+        if ( contactName )
+            {
+            found = iContextMenuItems->Find( *contactName, loc );
+            }
+        else
+            {
+            found = iContextMenuItems->Find( aNumber, loc );
+            }
+        CleanupStack::PopAndDestroy(); //contactName
+
+        if ( found > 0 ) //number is not part of current def.numbers
+            {
+            iModel->DivertHandler()->SetNewDefaultNumberL( aNumber );
+            }
+        else
+            {
+            iModel->DivertHandler()->SwapDefaultNumberL( loc );
+            }
+        }
+    else
+        {
+        __GSLOGSTRING( "[CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL] iContextMenuItems == NULL!!" );
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::HandleNotifyL
+//
+// AIW callback function.
+// ---------------------------------------------------------------------------
+TInt CGSCallDivertView::HandleNotifyL(
+    TInt aCmdId,
+    TInt aEventId,
+    CAiwGenericParamList& aEventParamList,
+    const CAiwGenericParamList& /*aInParamList*/ )
+    {
+    TInt err = KErrNone;
+    if( ( aCmdId == KAiwCmdSelect ) || ( aCmdId == KAiwCmdAssign ) )
+        {
+        if( aEventId == KAiwEventCompleted )
+            {
+            TInt index = 0;
+            iNumberFetchedAsynchronously = ETrue;
+            const TAiwGenericParam* param = aEventParamList.FindFirst(
+                index, EGenericParamContactLinkArray );
+
+            if( param && iStoresOpened )
+                {
+                if( iContactLinks )
+                    {
+                    delete iContactLinks;
+                    iContactLinks = NULL;
+                    }
+                TPtrC8 contactLinks = param->Value().AsData();
+
+                CVPbkContactLinkArray* localContactLinks =
+                    CVPbkContactLinkArray::NewLC(
+                    contactLinks,
+                    iContactManager->ContactStoresL() );
+
+                CleanupStack::Pop( localContactLinks );
+                iContactLinks = localContactLinks;
+
+                if( iContactLinks->Count() > 0 )
+                    {
+                    iRetrieveOperation = iContactManager->RetrieveContactL( iContactLinks->At( 0 ), *this );
+                    }
+                }
+            }
+        else if (aEventId == KAiwEventCanceled)
+            {
+            // Do nothing.
+            }
+        else if (aEventId == KAiwEventOutParamCheck)
+            {
+            // This is needed as PBK2 mysteriously crashes if check is not
+            // acccepted. There's no actual need to check anything but to go
+            // ahead here so setting to ETrue.
+            err = ETrue;
+            }
+        else if (aEventId == KAiwEventQueryExit)
+            {
+            err = ETrue;
+            }
+        }
+    return err;
+    }
+
+
+// --------------------------------------------------------------------------
+// CGSCallDivertView::VPbkSingleContactOperationComplete
+// --------------------------------------------------------------------------
+//
+void CGSCallDivertView::VPbkSingleContactOperationComplete(
+    MVPbkContactOperationBase& /*aOperation*/,
+    MVPbkStoreContact* aContact )
+    {
+    if( iRetrieveOperation )
+        {
+        delete iRetrieveOperation;
+        iRetrieveOperation = NULL;
+        }
+    TRAP_IGNORE
+        (
+        MVPbkStoreContactField* field = aContact->Fields().RetrieveField( iContactLinks->At( 0 ) );
+        if ( field && field->FieldData().DataType() == EVPbkFieldStorageTypeText )
+            {
+            // aContact has selected phone number from Pbk2 dialog. Set this as
+            // a text for ExecuteDivertNumberQueryL.
+            TCallDivertSetting setting;
+            setting.iSetting = EActivateDiverting;
+            setting.iNumber = MVPbkContactFieldTextData::Cast( field->FieldData() ).Text();
+
+            //Ask for user input.
+            ExecuteDivertNumberQueryL( setting.iNumber, R_TEXT_PRMPT_NUMBER );
+
+            // ExecuteDivertNumberQueryL() will set setting.iNumber to KNullDesC if user
+            // selected 'search'. In this case program execution is moved to
+            // pbk2 asynchronous dialog and this function can exit without
+            // sending call divert request.
+            if( setting.iNumber != KNullDesC )
+                {
+                // Send divert request.
+                iModel->SendCallDivertRequestL( setting,
+                                                RMobilePhone::EServiceActionRegister,
+                                                iVoiceMailboxDivert,
+                                                ECFCmdActivate,
+                                                (TGSCallDivertServices) iCurrentItem );
+                }
+            }
+        );
+    delete aContact;// Ownership is taken by this
+    }
+
+
+// --------------------------------------------------------------------------
+// CGSCallDivertView::VPbkSingleContactOperationFailed
+// --------------------------------------------------------------------------
+//
+void CGSCallDivertView::VPbkSingleContactOperationFailed(
+    MVPbkContactOperationBase& /*aOperation*/,
+    TInt /*aError*/)
+    {
+    if( iRetrieveOperation )
+        {
+        delete iRetrieveOperation;
+        iRetrieveOperation = NULL;
+        }
+
+    }
+
+// --------------------------------------------------------------------------
+// CGSCallDivertView::OpenComplete
+// --------------------------------------------------------------------------
+//
+void CGSCallDivertView::OpenComplete()
+    {
+    iStoresOpened = ETrue;
+    }
+
+// --------------------------------------------------------------------------
+// CGSCallDivertView::StoreReady
+// --------------------------------------------------------------------------
+//
+void CGSCallDivertView::StoreReady( MVPbkContactStore& /*aContactStore*/ )
+    {
+    // Do nothing
+    }
+
+// --------------------------------------------------------------------------
+// CGSCallDivertView::StoreUnavailable
+// --------------------------------------------------------------------------
+//
+void CGSCallDivertView::StoreUnavailable
+        ( MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/ )
+    {
+    // Do nothing
+    }
+
+// --------------------------------------------------------------------------
+// CGSCallDivertView::HandleStoreEventL
+// --------------------------------------------------------------------------
+//
+void CGSCallDivertView::HandleStoreEventL( MVPbkContactStore& /*aContactStore*/,
+        TVPbkContactStoreEvent /*aStoreEvent*/ )
+    {
+    // Do nothing
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSCallDivertView::CreateTimeListL
+//
+// Activates this view's popup list in order to change time-setting.
+// ---------------------------------------------------------------------------
+TInt CGSCallDivertView::CreateTimeListL()
+    {
+    CAknSinglePopupMenuStyleListBox* list =
+        new ( ELeave ) CAknSinglePopupMenuStyleListBox;
+    CleanupStack::PushL( list );
+
+    CAknPopupList* popupList =
+        CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL__OK );
+    CleanupStack::PushL( popupList );
+
+    HBufC* title = StringLoader::LoadLC( R_TEXT_DELAY_HEADER );
+    popupList->SetTitleL( *title );
+    CleanupStack::PopAndDestroy( title );
+
+    list->ConstructL( popupList,CEikListBox::ELeftDownInViewRect );
+    list->CreateScrollBarFrameL( ETrue );
+    list->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff,
+        CEikScrollBarFrame::EAuto );
+
+    CDesCArrayFlat* items;
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        items = new ( ELeave ) CDesCArrayFlat( KGSNrOfDelays + 4 );
+        CleanupStack::PushL( items );
+        CreateRestrictedCallDivertDelayTimeItemsL( *items );
+        }
+    else
+        {
+        items = new ( ELeave ) CDesCArrayFlat( KGSNrOfDelays );
+        CleanupStack::PushL( items );
+        CreateDelayTimeItemsL( *items );
+        }
+    CTextListBoxModel* model = list->Model();
+    model->SetItemTextArray( items );
+    model->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop(); //items
+    list->HandleItemAdditionL();
+
+    //set focus according to file read by phonesettings
+    //set delay timer field value
+    TInt currIndex = KErrNone;
+    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+        {
+        TInt itemCount = items->Count();
+        if (( iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep ) > ( itemCount - 4))
+            {
+            // Within 60, 90, 120 range
+            switch ( iModel->DivertHandler()->GetTimerValueL() )
+                {
+                case 60:
+                    currIndex = itemCount - 3;
+                    break;
+                case 90:
+                    currIndex = itemCount - 2;
+                    break;
+                case 120:
+                    currIndex = itemCount - 1;
+                    break;
+                }
+            }
+        else
+            {
+            currIndex = iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep;
+            }
+        }
+    else
+        {
+        currIndex = ( iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep ) - 1;
+        }
+    __GSLOGSTRING1( "[CGSCallDivertView::CreateTimeListL] currIndex: %d", currIndex );
+
+    list->SetCurrentItemIndex( currIndex );
+    //if possible show topmost item
+    list->SetTopItemIndex(0);
+
+    TInt keyPress = popupList->ExecuteLD();
+    CleanupStack::Pop( popupList );
+    if ( keyPress )
+        {
+        TInt index = list->CurrentItemIndex();
+        __GSLOGSTRING1( "[CGSCallDivertView::CreateTimeListL] index: %d", index );
+
+        if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
+            {
+            TInt itemCount = items->Count();
+            if ( index > ( itemCount - 4))
+                {
+                // Within 60, 90, 120 range
+                if ( index == itemCount - 3)
+                    {
+                    iModel->DivertHandler()->SetTimerValueL( 60 );
+                    }
+                else if ( index == itemCount - 2 )
+                    {
+                    iModel->DivertHandler()->SetTimerValueL( 90 );
+                    }
+                else if ( index == itemCount - 1 )
+                    {
+                    iModel->DivertHandler()->SetTimerValueL( 120 );
+                    }
+                }
+            else
+                {
+                // first entry is 0 seconds
+                currIndex = iModel->DivertHandler()->SetTimerValueL( index * KCFDelayStep );
+                }
+            }
+        else
+            {
+            //save to file the correct value calculated from index
+            iModel->DivertHandler()->SetTimerValueL( ( index + 1 ) * KCFDelayStep );
+            }
+        }
+    CleanupStack::PopAndDestroy( list );
+    return keyPress;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSLocalBaseView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base view for all the views in General Settings
+*
+*/
+
+
+// INCLUDE FILES
+#include    "GSLocalBaseView.h"
+
+#include <aknViewAppUi.h>
+#include <akntitle.h>
+#include <barsread.h>
+#include <aknnavi.h>
+#include <akntabgrp.h>
+#include <aknnavide.h>
+#include <AknUtils.h>
+#include <bldvariant.hrh>
+#include <gsbasecontainer.h>
+#include <GSTelPluginRsc.rsg>
+
+//Disabling warning caused by KGSDoActivateError constant
+#pragma diag_suppress 177
+// CONSTANTS
+_LIT( KGSDoActivateError, "DoActivateL" );
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::CGSLocalBaseView
+//
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CGSLocalBaseView::CGSLocalBaseView()
+    {
+    iAppUi = iAvkonViewAppUi;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::~CGSLocalBaseView
+//
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CGSLocalBaseView::~CGSLocalBaseView()
+    {
+    if ( iContainer && iAppUi )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::SetCurrentItem
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::SetCurrentItem( TInt aIndex )
+    {
+    iCurrentItem = aIndex;
+    if( iContainer )
+        {
+        iContainer->SetSelectedItem( aIndex );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::HandleListBoxEventL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::HandleListBoxEventL( CEikListBox* /*aListBox*/,
+                                            TListBoxEvent aEventType )
+    {
+    switch ( aEventType )
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemSingleClicked:
+            HandleListBoxSelectionL();
+            break;
+        default:
+           break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::SetNaviPaneL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::SetNaviPaneL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::CreateNaviPaneContextL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::CreateNaviPaneContextL( TInt /*aResourceId*/ )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::HandleClientRectChange
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::HandleClientRectChange()
+    {
+    if ( iContainer && iContainer->iListBox )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::DoActivateL
+// Activates the view.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
+                              TUid /*aCustomMessageId*/,
+                              const TDesC8& /*aCustomMessage*/)
+    {
+    if( iContainer )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+
+    CreateContainerL();
+
+    iAppUi->AddToViewStackL( *this, iContainer );
+    iContainer->iListBox->SetListBoxObserver( this );
+
+    SetNaviPaneL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSLocalBaseView::CreateContainerL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSLocalBaseView::CreateContainerL()
+    {
+    NewContainerL();
+    __ASSERT_DEBUG( iContainer,
+        User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) );
+    iContainer->SetMopParent( this );
+
+    TRAPD( error, iContainer->ConstructL( ClientRect() ) );
+
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSRestrictedDivertContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Restricted Call Divert's view.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSRestrictedDivertContainer.h"
+#include "CallDivertPlugin.hrh"
+
+#include <aknlists.h>
+#include <GSCallDivertPluginRsc.rsg>
+#include <featmgr.h>
+#include <csxhelp/cp.hlp.hrh>          // for help context of Divert
+#include <gslistbox.h>
+#include <gsfwviewuids.h>
+
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::ConstructL
+// Symbian OS two phased constructor
+//
+// ---------------------------------------------------------------------------
+void CGSRestrictedDivertContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+    BaseConstructL( aRect, R_CF_MAIN_VIEW_TITLE, R_CF_RESTRICTED_MAIN_LBX );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::~CGSRestrictedDivertContainer
+// Destructor
+//
+// ---------------------------------------------------------------------------
+CGSRestrictedDivertContainer::~CGSRestrictedDivertContainer()
+    {
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::GetHelpContext
+// This function is called when Help application is launched.
+// Only available, when __SERIES60_HELP is defined.
+// ---------------------------------------------------------------------------
+//
+void CGSRestrictedDivertContainer::GetHelpContext(
+    TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KDIV_HLP_CALL_FORW_MAIN;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::ConstructListBoxL
+// Creates list box from resources.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSRestrictedDivertContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
+        *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    CreateListBoxItemsL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::CreateListBoxItemsL
+// Creates List box items
+//
+// ---------------------------------------------------------------------------
+void CGSRestrictedDivertContainer::CreateListBoxItemsL()
+    {
+    MakeRestrictedDivertItemL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::UpdateListBoxL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSRestrictedDivertContainer::UpdateListBoxL( TInt aFeatureId )
+    {
+    switch( aFeatureId )
+        {
+        case EGSSettIdVoiceDivert:
+            MakeRestrictedDivertItemL();
+            break;
+        default:
+            break;
+        }
+
+    // Update the listbox
+    iListBox->HandleItemAdditionL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::CurrentFeatureId
+//
+//
+// ---------------------------------------------------------------------------
+TInt CGSRestrictedDivertContainer::CurrentFeatureId() const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSRestrictedDivertContainer::MakeVoiceDivertsItemL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSRestrictedDivertContainer::MakeRestrictedDivertItemL()
+    {
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdVoiceDivert,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building 
+*                GSGenPlugin.
+*                
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSCallDivertPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gscalldivertplugin.iby )
+../rom/GSCallDivertPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gscalldivertpluginresources.iby )
+loc/cf.loc MW_LAYER_LOC_EXPORT_PATH( cf.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gscalldivertplugin.mif
+  OPTION HEADERFILE gscalldivertplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_div_sub
+END
+
+
+PRJ_MMPFILES
+GSCallDivertPlugin.mmp    
+
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSCallDivertPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/loc/cf.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,261 @@
+/*
+* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       This file contains the localised strings for call forward folder in gs
+*
+*/
+
+
+//d: title for call settings folder
+//l: list_single_large_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_folder_divert "Call Divert"
+
+//d: title for call divert settings folder
+//l: title_pane_t2/opt9
+//
+#define qtn_div_heading_cf "Call divert"
+
+//d: option in call forward's list, divert all voice calls
+//l: list_double2_pane
+//
+#define qtn_div_dlist_all "All voice calls"
+
+//d: option in call forward's list, divert all video calls
+//l: list_double2_pane
+//
+#define qtn_div_dlist_all_video "All video calls"
+
+//d: option in call forward's list, divert all voice calls
+//l: list_double2_pane
+//
+#define qtn_div_dlist_busy "If busy"
+
+//d: option in call forward's list, divert when not answered
+//l: list_double2_pane
+//
+#define qtn_div_dlist_noreply "If not answered"
+
+//d: option in call forward's list, divert when off or no coverage
+//l: list_double2_pane
+//
+#define qtn_div_dlist_notavail "If not available"
+
+//d: option in call forward's list, divert busy, no answer, off or no coverage
+//l: list_double2_pane
+//
+#define qtn_div_dlist_outreach "If out of reach"
+
+//d: option in call forward's list, divert all fax calls
+//l: list_double2_pane
+//
+#define qtn_div_dlist_faxall "All fax calls"
+
+//d: option in call forward's list, divert all data calls
+//l: list_double2_pane
+//
+#define qtn_div_dlist_dataall "All data calls"
+
+//d: activating highlighted call forward
+//l: list_single_pane_t1_cp2
+//
+#define text_activate_divert "Activate"
+
+//d: cancelling highlighted call forward
+//l: list_single_pane_t1_cp2
+//
+#define text_cancel_divert "Cancel"
+
+//d: checking status of highlighted call forward
+//l: list_single_pane_t1_cp2
+//
+#define text_check_status "Check status"
+
+//d: option in call forward's list, cancelling all diverts
+//l: list_single_pane_t1_cp2
+//
+#define text_cancel_all_diverts "Cancel all diverts"
+
+//d: heading to call forward's menu list, divert all voice calls  
+//l: heading_pane_t1
+//
+#define qtn_div_title_all "All voice calls"
+
+//d: heading to call forward's menu list, divert all video calls  
+//l: heading_pane_t1
+//
+#define qtn_div_title_all_video "All video calls"
+
+//d: heading to call forward's menu list, divert all voice calls  
+//l: heading_pane_t1
+//
+#define qtn_div_title_busy "If busy"
+
+//d: heading to call forward's menu list, divert when not answered  
+//l: heading_pane_t1
+//
+#define qtn_div_title_not_answered "If not answered"
+
+//d: heading to call forward's menu list, divert when off or no coverage
+//l: heading_pane_t1
+//
+#define qtn_div_title_not_reach "If out of reach"
+
+//d: heading to call forward's menu list; CFB, CFNRly or CFNRch
+//l: heading_pane_t1
+//
+#define qtn_div_title_not_available "If not available"
+
+//d: heading to call forward's menu list, divert all fax calls
+//l: heading_pane_t1
+//
+#define qtn_div_title_all_fax "All fax calls"
+
+//d: heading to call forward's menu list, divert all data calls
+//l: heading_pane_t1
+//
+#define qtn_div_title_all_data "All data calls"
+
+//d: diverting call to the voice mailbox
+//l: list_single_pane_t1_cp2
+//
+#define text_divert_to_voice_mail "To voice mailb."
+
+//d: diverting call to some other number
+//l: list_single_pane_t1_cp2
+//
+#define text_divert_to_number "To other No."
+
+//d: entering number to which the forward is targeted, prompt to data query
+//l: popup_query_data_window
+//
+#define qtn_div_prmpt_number "Number: "
+
+//d: entering number to which the fax divert is targeted, prompt to data query
+//l: popup_query_data_window
+//
+#define qtn_div_prmpt_fax_number "Enter number: "
+
+//d: entering number to which the data divert is targeted, prompt to data query
+//l: popup_query_data_window
+//
+#define qtn_div_prmpt_data_number "Enter number: "
+
+//d: entering number to which the video divert is targeted, prompt to data query
+//l: popup_query_data_window_t3/opt2
+//
+#define qtn_ss_prmpt_video_number "Number: "
+
+//d: information note when divert succesfully deactivated
+//l: heading_pane_t1
+//
+#define qtn_div_heading_delay "Select delay time"
+
+//d: list to choose from when activating divert with possible timing
+//d: %N stands for numbers 5,10,15,20,25,30
+//l: list_single_pane_t1_cp2
+//
+#define qtn_div_slist_seconds "%N seconds"
+
+//d: error note text when entering invalid phone number
+//l: popup_note_window
+//
+#define text_invalid_number "Phone number not valid"
+
+//d: title for voice call divert settings sub-folder
+//l: title_pane_t2/opt9
+//
+#define qtn_div_heading_voice "Voice call diverts"
+
+//d: title for data call divert settings sub-folder
+//l: title_pane_t2/opt9
+//
+#define qtn_div_heading_data "Data call diverts"
+
+//d: title for data and video call divert settings sub-folder
+//l: title_pane_t2/opt9
+//
+#define qtn_div_heading_data_video "Data and video call diverts"
+
+//d: title for video call divert settings sub-folder
+//l: title_pane_t2/opt9
+//
+#define qtn_div_heading_video "Video call diverts"
+
+//d: title for fax call divert settings sub-folder
+//l: title_pane_t2/opt9
+//
+#define qtn_div_heading_fax "Fax call diverts"
+
+//d: selection in call divert menu, divert voice calls
+//l: list_double2_pane
+//
+#define qtn_div_voice_calls "Voice calls"
+
+//d: selection in call divert menu, divert data calls
+//l: list_double2_pane
+//
+#define qtn_div_data_calls "Data calls"
+
+//d: selection in call divert menu, divert data and video calls
+//l: list_double2_pane
+//
+#define qtn_div_data_video_calls "Data and video calls"
+
+//d: selection in call divert menu, divert fax calls
+//l: list_double2_pane
+//
+#define qtn_div_fax_calls "Fax calls"
+
+//d: data & video calls selection in call forward's selection list
+//l: list_double2_pane
+//
+#define qtn_div_dlist_all_data_video "All data and video calls"
+
+//d: selection in call divert menu, divert video calls
+//l: list_double2_pane
+//
+#define qtn_div_video_calls "Video calls"
+
+//d: diverting video call to the video mailbox
+//l: list_single_pane_t1_cp2
+//w:
+//r:3.1    
+//
+#define qtn_ss_divert_to_video_mailbox "To video mailbox"
+
+//d: diverting video call to other number user defined number
+//l: list_single_pane_t1_cp2
+//w:
+//r:3.1    
+//
+#define qtn_ss_divert_vcall_to_other_number "To other number"
+
+//d: selection in restricted call divert menu, call forward settings
+//l: list_double2_pane
+//w:
+//r:3.1
+//
+#define qtn_div_restricted "Call forward settings"
+
+//d: Title for forwarding all data and video calls popup menu
+//l: heading_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_div_title_all_data_and_videocalls "All data & video calls"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/GSCallPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallPlugin project file.
+*
+*/
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+// To get the MW_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gscallplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x102824A1
+VENDORID            VID_DEFAULT
+
+SOURCEPATH  src  // /GSCallPlugin
+SOURCE      GSCallPluginImplementationTable.cpp
+SOURCE      GSCallPluginContainer.cpp
+SOURCE      GSCallPlugin.cpp
+SOURCE      GSCallPluginModel.cpp
+
+//User include paths
+USERINCLUDE     inc
+USERINCLUDE     data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Data
+USERINCLUDE     ../Cenrep
+USERINCLUDE     ../Logger
+USERINCLUDE     ../GSTelPlugin/Inc
+
+// The above include is required becasue of secuicodequerydialog.h
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      data
+
+START RESOURCE  102824A1.rss
+TARGET          gscallplugin.rsc
+END
+
+START RESOURCE  GSCallPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+START RESOURCE  SoftReject.rss
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   centralrepository.lib
+LIBRARY   cenrepnotifhandler.lib
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   cone.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   egul.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   eikctl.lib
+LIBRARY   etelmm.lib            // security, network, call
+LIBRARY   euser.lib
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   gsecomplugin.lib
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   numbergrouping.lib
+LIBRARY   phonesettings.lib
+LIBRARY   psui.lib              // phone settings notes UI
+LIBRARY   sssettings.lib        // Supplementary settings
+LIBRARY   flogger.lib // For GSLogger
+
+// still image related libraries
+LIBRARY   backgroundimage.lib
+LIBRARY   mgfetch.lib           // for image selection list
+LIBRARY   drmcommon.lib
+LIBRARY   imageconversion.lib
+
+LIBRARY   secui.lib             // security
+LIBRARY   aknnotify.lib         // for CAknGlobalNote.h
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   eikdlg.lib phoneclient.lib            // eikon dialogs
+
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+LIBRARY serviceprovidersettings.lib
+#endif // __VOIP && RD_VOIP_REL_2_2
+
+SOURCEPATH      data
+DOCUMENT        102824A1.rss
+DOCUMENT        GSCallPluginRsc.rss
+DOCUMENT        SoftReject.rss
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building 
+*                GSCallPlugin.
+*                
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSCallPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gscallplugin.iby )
+../rom/GSCallPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gscallpluginresources.iby )
+loc/GSCallPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gscallplugin.loc )
+loc/SoftReject.loc MW_LAYER_LOC_EXPORT_PATH( softreject.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gscallplugin.mif
+  OPTION HEADERFILE gscallplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_call_sub.bmp -c8,8 qgn_prop_set_call_tab4.bmp
+END
+PRJ_MMPFILES
+GSCallPlugin.mmp    
+
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSCallPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/data/102824A1.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Call Settings plugin.
+*
+*/
+
+
+// INCLUDES
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x102824A1;
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x102824A2;
+					version_no          = 1;
+					display_name        = "Call Settings Plugin";
+					default_data        = "0x1020723D";//Parent UID
+					opaque_data         = "10";//Order number
+					}
+				};
+			}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/data/GSCallPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1340 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSCallPlugin
+*
+*/
+
+//  RESOURCE IDENTIFIER
+NAME    CALP // 4 letter ID
+
+//  INCLUDES
+#include     <bldvariant.hrh>
+
+#include    <gscallplugin.loc>
+#include    <softreject.loc>
+#include    "GSCallPlugin.hrh"
+
+#include    <gs.loc>
+#include    <gscommon.hrh>
+#include    <gscommon.rh>
+#include    <GSApp.rsg>
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+//#include    <GSCallPlugin.mbg>
+#include    <uikon.rh>
+
+// CONSTANTS
+//#define KGsCallPluginIcons      "Z:"APP_RESOURCE_DIR"\\gscallplugin.mbm"
+
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+RESOURCE TBUF
+    {
+    buf="CALL";
+    }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+
+//----------------------------------------------------
+//  r_gs_call_view_caption
+//
+// Telephony view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_call_plugin_caption
+    {
+    buf = qtn_set_folder_call;
+    }
+
+
+//----------------------------------------------------
+//  r_gs_call_view_title
+//
+// Telephony view title
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_tel_view_title
+    {
+    txt = qtn_set_title_settings_telephone;
+    }
+
+
+//CALL
+
+//----------------------------------------------------
+//
+//    r_gs_call_wait_view_menu
+//    Call Wait sub-menupane
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_call_wait_view_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EGSCmdCallWaitActivate;
+            txt = text_activate_waiting;
+            },
+        MENU_ITEM
+            {
+            command = EGSCmdCallWaitDeactivate;
+            txt = text_cancel_waiting;
+            },
+        MENU_ITEM
+            {
+            command = EGSCmdCallWaitInquiry;
+            txt = text_status_waiting;
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_menubar_call_view
+//    Call sub-menubar
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_gs_menubar_call_view
+    {
+    titles =
+        {
+        MENU_TITLE { menu_pane = r_gs_call_view_menu; }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_call_view
+//    Call sub-menu view
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_call_view
+    {
+    menubar = r_gs_menubar_call_view;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_EMPTY;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_call_view_menu
+//    Call sub-menupane
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_gs_call_view_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EAppCmdCreatePopupList;
+            txt = qtn_set_options_change;
+            flags = EEikMenuItemAction; // action command
+            
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdHelp;
+            txt = qtn_options_help;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_call_view_title
+//    Call sub-menu title
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_call_view_title
+    {
+    txt = qtn_set_title_settings_call;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_own_number_sending_heading
+//    Title to own number sending setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_own_number_sending_heading
+    {
+    buf = qtn_own_number_sending_heading;
+    }
+
+//----------------------------------------------------
+//
+//    r_cli_sending_default
+//    CLI setting value to own number sending setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cli_sending_default
+    {
+    buf = text_cli_sending_default;
+    }
+
+//----------------------------------------------------
+//
+//    r_cli_sending_on
+//    CLI setting value to own number sending setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cli_sending_on
+    {
+    buf = text_cli_sending_on;
+    }
+
+//----------------------------------------------------
+//
+//    r_cli_sending_off
+//    CLI setting value to own number sending setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cli_sending_off
+    {
+    buf = text_cli_sending_off;
+    }
+
+//----------------------------------------------------
+//
+//    r_cterm_setting
+//    Call Termination Note setting page resources
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cterm_setting
+    {
+    buf = text_cterm_setting;
+    }
+
+//----------------------------------------------------
+//
+//    r_call_termination_note_on
+//    Call Termination Note setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_call_termination_note_on
+    {
+    buf = text_call_termination_note_on;
+    }
+
+//----------------------------------------------------
+//
+//    r_call_termination_note_off
+//    Call Termination Note setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_call_termination_note_off
+    {
+    buf = text_call_termination_note_off;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_show_call_duration_setting_page
+//    Show Call Duration setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_show_call_duration_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_logs_lda3_time;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_show_call_duration_setting_page_lbx
+//    setting page items for show call duration
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_show_call_duration_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_logs_ldv3_timer_on;
+            },
+        LBUF
+            {
+            txt = qtn_logs_ldv3_timer_off;
+            }
+        };
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_call_lbx_resource
+//    Call listbox resource
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_call_lbx_resource
+    {
+    array_id = r_call_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_call_lbx
+//    Call listbox items
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_call_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = "\t"qtn_cp_setting_opening_slide"\t\t";
+            item = EGSOpeningSlideAnswerCallItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_cp_setting_closing_slide"\t\t";
+            item = EGSClosingSlideEndCallItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"text_clir"\t\t";
+            item = EGSCliItemId;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_clir_voip"\t\t";
+            item = EGSICSendIntCallIdItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"text_call_waiting"\t\t";
+            item = EGSCallWaitingItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_voip_call_waiting"\t\t";
+            item = EGSICWaitingItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_voip_do_not_disturb"\t\t";
+            item = EGSDndItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+#ifndef RD_VOIP_REL_2_2 
+        GS_FEATURE
+            {
+            txt = "\t"qtn_set_voip_settings_preferred_tel"\t\t";
+            item = EGSICPreferredTelephonyId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+#endif // !RD_VOIP_REL_2_2
+        GS_FEATURE
+            {
+            txt = "\t"qtn_gs_soft_reject_text"\t\t";
+            item = EGSSoftRejectTextItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_gs_long_press_call_key"\t\t";
+            item = EGSLongPressCallKeyItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_gs_own_image_vt_call"\t\t";
+            item = EGSOwnImageVtCallItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_gs_still_image_vt_call"\t\t";
+            item = EGSStillImageItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },           
+        GS_FEATURE //NEW
+            {
+            txt = "\t"qtn_gs_auto_redial_to_voice"\t\t";
+            item = EGSAutoRedialToVoiceItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_set_replace_prefix"\t\t";
+            item = EGSReplacePrefixItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        /*GS_FEATURE
+            {
+            txt = "\t"qtn_ccbs_setting_item"\t\t";
+            item = EGSCCBSItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },*/
+            
+        GS_FEATURE
+            {
+            txt = "\t"qtn_logs_lda3_time"\t\t";
+            item = EGSShowCallDurationItemId;
+            },    
+        GS_FEATURE
+            {
+            txt = "\t"text_cterm_setting"\t\t";
+            item = EGSSummaryAfterCallItemId;
+            },          
+        GS_FEATURE
+            {
+            txt = "\t"qtn_als_phoneline_in_use"\t\t";
+            item = EGSLineChangeItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_als_phonelinet_blocking"\t\t";
+            item = EGSALSBlockItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_still_image_setting_page
+//    VT still image setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_still_image_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_gs_still_image_vt_call;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_still_image_setting_page_lbx
+//    "Not used" option for Still Image feature
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_still_image_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_gs_still_image_notused;
+            },
+        LBUF
+            {
+            txt = qtn_gs_still_image_define;
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_replace_prefix_setting_page
+//    Japanese replace prefix setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_replace_prefix_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_replace_prefix;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_replace_prefix_setting_page_lbx
+//    setting page items for Japanese replace prefix
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_replace_prefix_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_replace_prefix_on;
+            },
+        LBUF
+            {
+            txt = qtn_set_replace_prefix_off;
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_replace_prefix_data_query
+//    Replace prefix data query.
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_replace_prefix_data_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            itemflags=EEikDlgItemTakesEnterKey;
+            control = AVKON_DATA_QUERY
+                {
+                layout = EPhoneLayout;
+                label = qtn_set_prefix_data_query;
+                control = EDWIN
+                    {
+                    flags=EEikEdwinNoHorizScrolling;
+                    width=10;
+                    lines=1;
+                    maxlength=10;
+                    numeric_keymap = EAknEditorStandardNumberModeKeymap;
+                    allowed_input_modes = EAknEditorNumericInputMode;
+                    default_input_mode = EAknEditorNumericInputMode;
+                    };
+                };
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_drm_not_allowed
+//    DRM protected image cannot be selected as VT still iamge.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_drm_not_allowed
+    {
+    buf = qtn_drm_not_allowed;
+    }
+
+
+//-----------------------------------------------------------------------------
+//
+//    r_als_line_selection_mode
+//    ALS: Line in use
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_line_selection_mode
+    {
+    buf = qtn_als_line_selection_mode;
+    }
+
+
+//-----------------------------------------------------------------------------
+//
+//    r_als_line1
+//    ALS: Line in use item
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_line1
+    {
+    buf = qtn_als_line1;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_als_line2
+//    ALS: Line in use item
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_line2
+    {
+    buf = qtn_als_line2;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_als_phoneline_block_mode
+//    ALS: Line block mode
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_phoneline_block_mode
+    {
+    buf = qtn_als_phoneline_block_mode;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_als_line_blocking_on_sel
+//    ALS: Line block mode
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_line_blocking_on_sel
+    {
+    buf = text_als_line_blocking_on_sel;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    text_als_line_blocking_off_sel
+//    ALS: Line block mode
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_line_blocking_off_sel
+    {
+    buf = text_als_line_blocking_off_sel;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_als_line_blocking_on
+//    ALS: Line block mode
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_line_blocking_on
+    {
+    buf = text_als_line_blocking_on;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_als_line_blocking_off
+//    ALS: Line block mode
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_als_line_blocking_off
+    {
+    buf = text_als_line_blocking_off;
+    }
+
+
+// **COMMON RESOURCES FOR CALL, BARRING AND NETWORK
+
+//----------------------------------------------------
+//
+//    r_requesting_note
+//    Note layout when requesting something from network
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_requesting_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons | EEikDialogFlagWait;
+    buttons = r_softkeys_empty_quit;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = ERequestingNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = text_sending;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_softkeys_empty_quit
+//    Softkeys for requesting notes: empty-quit
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_softkeys_empty_quit
+    {
+    buttons =
+        {
+        CBA_BUTTON {txt = "";},
+        CBA_BUTTON {id = EGSSoftkeyQuit; txt = text_softkey_quit;}
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_image_corrupted
+//    Image corrupted information note.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_image_corrupted
+    {
+    buf = qtn_set_image_format_wrong;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_image_too_large
+//    Image corrupted information note.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_image_too_large
+    {
+    buf = qtn_set_image_too_large;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_image_load_wait_note
+//    Image loading wait note.
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_image_load_wait_note
+    {
+    flags = EAknWaitNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EImageLoadWaitNote;
+            control= AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = qtn_set_loading_image;
+                imagefile = AVKON_ICON_FILE;
+                imageid = EMbmAvkonQgn_note_progress;
+                imagemask = EMbmAvkonQgn_note_progress_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+// VOIP SETTINGS
+
+// **INTERNET CALL CLIR
+
+//----------------------------------------------------
+//
+//    r_set_ic_clir
+//    Internet call CLIR setting page resources
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_clir
+    {
+    buf = qtn_clir_voip;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_clir_on
+//    Internet call CLIR setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_clir_on
+    {
+    buf = text_cli_sending_on;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_clir_off
+//    Internet call CLIR setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_clir_off
+    {
+    buf = text_cli_sending_off;
+    }
+
+//----------------------------------------------------
+//
+//    r_ic_clir_setting_page_lbx
+//    On/Off setting page's listbox, used by
+//    Internet call CLIR.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_ic_clir_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = text_cli_sending_on;
+            },
+        LBUF
+            {
+            txt = text_cli_sending_off;
+            }
+        };
+    }
+
+// **INTERNET CALL WAITING
+
+//----------------------------------------------------
+//
+//    r_set_ic_waiting
+//    Internet call waiting setting page resources
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_waiting
+    {
+    buf = qtn_voip_call_waiting;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_waiting_on
+//    Internet call waiting setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_waiting_active
+    {
+    buf = qtn_voip_waiting_active;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_waiting_off
+//    Internet call waiting setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_waiting_not_active
+    {
+    buf = qtn_voip_waiting_not_active;
+    }
+
+//----------------------------------------------------
+//
+//    r_ic_waiting_setting_page_lbx
+//    Active/Not active setting page's listbox, used by
+//    Internet call waiting.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_ic_waiting_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_voip_waiting_active;
+            },
+        LBUF
+            {
+            txt = qtn_voip_waiting_not_active;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_qtn_voip_sccp_no_clir
+//    Note is shown IC clir is activated and sccp is
+//    installed
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_qtn_voip_sccp_no_clir
+    {
+    buf = qtn_voip_sccp_no_clir;
+    }
+
+// **PREFERRED TELEPHONY
+
+//----------------------------------------------------
+//
+//    r_set_ic_preferred_telephony
+//    Preferred telephony setting page resources
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_preferred_telephone
+    {
+    buf = qtn_set_voip_settings_preferred_tel;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_preferred_telephony_cs
+//    Preferred telephony setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_preferred_telephone_cs
+    {
+    buf = qtn_set_voip_preferred_tel_cs;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_preferred_telephony_ps
+//    Preferred telephony setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_preferred_telephone_ps
+    {
+    buf = qtn_set_voip_preferred_tel_ps;
+    }
+
+//----------------------------------------------------
+//
+//    r_ic_preferred_call_type_setting_page_lbx
+//    CS/PS setting page's listbox, used by
+//    Preferred type.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_ic_preferred_call_type_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_voip_preferred_tel_cs;
+            },
+        LBUF
+            {
+            txt = qtn_set_voip_preferred_tel_ps;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_ic_preferred_telephone_query_text
+//    Message query's text when activating 
+//    Internet telephony
+//
+//----------------------------------------------------
+//  
+RESOURCE TBUF r_ic_preferred_telephone_query_text
+    {
+    buf = qtn_voip_pref_teleph_set_note;
+    } 
+
+//----------------------------------------------------
+//   
+//    r_ic_preferred_telephone_query
+//    Message query when activating Internet telephony
+//
+//----------------------------------------------------
+// 
+RESOURCE DIALOG r_ic_preferred_telephone_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items=
+        {
+        DLG_LINE 
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                };
+            }
+        };
+    }
+
+// **DO NOT DISTURB
+
+//----------------------------------------------------
+//
+//    r_set_ic_dnd
+//    Internet call do not disturb setting page resources
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_dnd
+    {
+    buf = qtn_voip_do_not_disturb;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_dnd_active
+//    Internet call dnd setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_dnd_active
+    {
+    buf = qtn_voip_do_not_disturb_on;
+    }
+
+//----------------------------------------------------
+//
+//    r_set_ic_dnd_not_active
+//    Internet call dnd setting page item
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_set_ic_dnd_not_active
+    {
+    buf = qtn_voip_do_not_disturb_off;
+    }
+
+    //----------------------------------------------------
+//
+//    r_ic_dnd_setting_page_lbx
+//    Active/Not active setting page's listbox, used by
+//    Internet call dnd.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_ic_dnd_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_voip_do_not_disturb_on;
+            },
+        LBUF
+            {
+            txt = qtn_voip_do_not_disturb_off;
+            }
+        };
+    }
+
+
+//MSK Labels and Resources
+
+
+// -----------------------------------------------------------------------------
+//   
+//    r_call_msk_change
+//    Middle softkey label: change.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_call_msk_change
+    {
+    buf = qtn_msk_change;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_call_softkey_option
+//    Middle softkey label: Options.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_call_softkey_option
+    {
+    buf = text_softkey_option;
+    }
+
+RESOURCE TBUF r_text_active_call          {buf = qtn_info_during_call;}
+
+//----------------------------------------------------
+//
+//    r_setting_page
+//    Setting page for Network selection mode/MCN items
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type =  EAknSetListBox;
+    editor_resource_id= r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_msk_contextmenubar
+//    Options menu with 'Open' and SetasDefault items .
+//    Context Menu Options for MSK key handling
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_call_divert_msk_contextmenubar
+    {
+    titles =
+        {
+        MENU_TITLE {menu_pane = r_cf_msk_div_view_menu;}
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_cf_msk_div_view_menu
+//    Menu pane for Context Options.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_cf_msk_div_view_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = ECFCmdActivate;
+            txt = text_activate_divert;
+            },
+        MENU_ITEM
+            {
+            command = ECFCmdCancel;
+            txt = text_cancel_divert;
+            },
+        MENU_ITEM
+            {
+            command = ECFCmdCheckStatus;
+            txt = text_check_status;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_long_press_call_setting_page
+//    Long Press Call Key setting page.
+//
+//----------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_long_press_call_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_gs_long_press_call_key;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_long_press_call_setting_page_lbx
+//    Options: Inactive and Video call
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_long_press_call_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_gs_long_press_call_key_inactive;
+            },
+        LBUF
+            {
+            txt = qtn_gs_long_press_call_key_video;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_own_image_vt_call_setting_page
+//    Own image vt call setting page.
+//
+//----------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_own_image_vt_call_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_gs_own_image_vt_call;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_own_image_vt_call_setting_page_lbx
+//    Options: Ask first, No, Yes
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_own_image_vt_call_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_gs_own_image_ask_first;
+            },
+        LBUF
+            {
+            txt = qtn_gs_own_image_no;
+            },
+        LBUF
+            {
+            txt = qtn_gs_own_image_yes;
+            }
+        };
+    }  
+
+//----------------------------------------------------
+//
+//    r_cp_setting_title_opening_slide
+//    Title to opening slide answer setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cp_setting_title_opening_slide
+    {
+    buf = qtn_cp_setting_title_opening_slide;
+    }
+
+//----------------------------------------------------
+//
+//    r_cp_setting_opening_slide_answer
+//    value to opening slide answer setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cp_setting_opening_slide_answer
+    {
+    buf = qtn_cp_setting_opening_slide_answer;
+    }
+
+//----------------------------------------------------
+//
+//    r_cp_setting_opening_slide_not_answer
+//    value to opening slide answer setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cp_setting_opening_slide_not_answer
+    {
+    buf = qtn_cp_setting_opening_slide_not_answer;
+    }
+
+//----------------------------------------------------
+//
+//    r_cp_setting_title_closing_slide
+//    Title to colsing slide end setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cp_setting_title_closing_slide
+    {
+    buf = qtn_cp_setting_title_closing_slide;
+    }
+
+//----------------------------------------------------
+//
+//    r_cp_setting_closing_slide_end
+//    value to colsing slide end setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cp_setting_closing_slide_end 
+    {
+    buf = qtn_cp_setting_closing_slide_end;
+    }
+
+//----------------------------------------------------
+//
+//    r_cp_setting_closing_slide_not_end
+//    value to colsing slide end setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_cp_setting_closing_slide_not_end
+    {
+    buf = qtn_cp_setting_closing_slide_not_end;
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/data/SoftReject.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for Soft Reject
+*
+*/
+
+//  RESOURCE IDENTIFIER
+NAME    PHSR // 4 letter ID
+
+//  INCLUDES
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+#include <eikcore.rsg>
+#include <eikon.rsg>
+#include <softreject.loc>
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_on
+//    Soft reject: "On"
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_on
+    {
+    buf = qtn_gs_soft_on;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_off
+//    Soft reject: "Off"
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_off
+    {
+    buf = qtn_gs_soft_off;
+    }
+
+//----------------------------------------------------
+//   
+//    qtn_gs_soft_reject_text_title
+//    Soft Reject Text setting page resources
+//    "Soft Reject"
+//----------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_text
+    {
+    buf = qtn_gs_soft_reject_text_title;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_default_txt
+//    Default text for Soft reject.
+//    "Hi, I?m busy at the moment, but I contact you a bit later."
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_default_txt
+    {
+    buf = qtn_gs_soft_default_text;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_soft_reject_txt_title
+//    Default text title.
+//    "Text for Soft reject"
+//-----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject_txt_title
+    {
+    buf = qtn_gs_soft_reject_text;
+    }
+
+//----------------------------------------------------
+//    
+//    r_setting_app_edwin    
+//    Text editor for Soft Reject text.
+//
+//----------------------------------------------------
+//
+RESOURCE EDWIN r_setting_app_edwin 
+    {
+    flags = 0;
+    width = 9;
+    lines = 5;
+    maxlength = 160;
+    }
+
+//----------------------------------------------------
+//    
+//    r_text_setting_page    
+//    Setting page for Soft Reject text.
+//    "Text for Soft reject"
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_text_setting_page
+    {    
+    label= qtn_gs_soft_reject_text_title;
+    type = EEikCtEdwin;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    editor_resource_id = r_setting_app_edwin;
+    }
+
+//----------------------------------------------------
+//   
+//    qtn_mocal_sett_softrej_title
+//    Soft Reject setting page resources
+//    "Soft reject"
+//----------------------------------------------------
+//
+RESOURCE TBUF r_soft_reject
+    {
+    buf = qtn_mocal_sett_softrej_title;
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,479 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Call sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSCALLPLUGIN_H
+#define GSCALLPLUGIN_H
+
+// INCLUDES
+#include "GSCallPluginModel.h"
+#include "MGsFWMSKLabelObserver.h"
+
+#include <MSSSettingsObserver.h> //for MSSSettingsObserver
+#include <MMGFetchVerifier.h>
+#include <mgsasyncimagehandlingobserver.h>
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+#include <ConeResLoader.h>
+
+#include <gsbaseview.h>
+#include <gsfwviewuids.h>
+#include <gsplugininterface.h>
+
+// FORWARD DECLARATIONS
+class CGSCallPluginContainer;
+class CAknRadioButtonSettingPage;
+class CPsetContainer;
+class CPsuiContainer;
+class CPsuiWaitingObs;
+class CPsetCallWaiting;
+class CAknPopupList;
+class CGSTelPluginModel;
+class CGSCcbsHandler;
+class CAknWaitDialog;
+class CAknViewAppUi;
+
+// Constants
+const TUid KCallPluginUID = { 0x102824A2 };
+
+// Resource file name
+_LIT( KGSCallPluginResourceFileName, "z:GSCallPluginRsc.rsc" );
+
+_LIT( KGSCallPluginIconDirAndName, "z:GSCallPlugin.mbm");
+
+// CLASS DECLARATION
+/**
+*  CGSCallPlugin view class 
+*/
+class CGSCallPlugin : public CGSBaseView, 
+                      public MSSSettingsObserver,
+                      public MMGFetchVerifier,
+                      public MGSAsyncImageHandlingObserver,
+                      public MGsFWMSKObserver
+    {
+    public: // Constructor and destructor
+
+        /* C++ Constructor */
+        CGSCallPlugin();
+        
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSCallPlugin* NewL( TAny* aInitParams );
+
+        /* Symbian OS two-phase Constructor 
+        *
+        * @return pointer to CGSCallPlugin object
+        */
+        static CGSCallPlugin* NewLC();
+
+        /**
+        * Destructor.
+        */
+        ~CGSCallPlugin();
+
+    public: // Functions from CAknView
+        
+        /**
+        * From CAknView, returns the views id.
+        *
+        * @return Returns id of the view.
+        */
+        TUid Id() const;
+        
+        /**
+        * See base class.
+        */
+        void HandleClientRectChange();
+        
+        /**
+        * See base class.
+        */
+        void HandleStatusPaneSizeChange();
+
+        /**
+        * From MEikCommandObserver, handles the menu based commands.
+        *
+        * @param aCommand identifies the given command.
+        */
+        void HandleCommandL( TInt aCommand );
+        
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From base classes
+        /*
+        * From MSSSettingsObserver, observer function 
+        * @param aSetting Current setting
+        * @param aNewValue New value for the setting
+        */
+        void PhoneSettingChanged( TSSSettingsSetting aSetting, 
+                                  TInt aNewValue );
+
+        /**
+        * Updates specific value to container 
+        * @param aListItem item index to update
+        * @param aNewValue new value for the setting
+        */
+        void UpdateListBoxL( const TInt& aListItem, TInt aNewValue );
+        
+        /**
+        * From MEikCommandObserver, handles the commands.
+        *
+        * @param aCommand identifies the command given.
+        */
+        void ProcessCommandL( TInt aCommand );
+      
+        /**
+        * Checks if the MSK label needs to be adjusted.
+        */
+        void CheckMiddleSoftkeyLabelL();
+        
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+        
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+        
+    public: //new
+        /**
+        * Remove command and label from MSK.
+        */
+        void RemoveCommandFromMSK( const TBool flag);
+        
+        /**
+        * Adds given resource text as MSK to CBA.
+        * 
+        * @param aResourceId middle softkey label.
+        * @param aCommandId command that should be performed when MSK
+        *        is pressed.
+        * @since S60 v3.1
+        */
+        void SetMiddleSoftKeyLabelL( const TInt aResourceId,const TInt aCommandId );
+        
+    protected: // from CGSBaseView
+        /**
+        * See base class.
+        */
+        void NewContainerL();
+
+        /**
+        * See base class.
+        */
+        void HandleListBoxSelectionL();
+
+    protected: //from MMGFetchVerifier
+        
+        /**
+        * Display Backlight setting page
+        */
+        TBool VerifySelectionL( const MDesCArray* aSelectedFiles );
+
+    protected: //from MGSSyncImageHandlingObserver
+        
+        /**
+        * Method derived from MGSSyncImageHandlingObserver
+        * Run when the asynchronous image converting is complete.
+        */
+        void ImageHandlingCompleteL( TInt aError );
+
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected: //new
+
+        /**
+        * Symbian OS default constructor. 
+        */
+        void ConstructL();
+
+        /**
+        * Shows settingpage for on-off settings.
+        *
+        * @param aPage reveals what page should be displayed.
+        */
+        void ShowSettingPageL( TGSCallItemIds aPage );
+
+        /**
+        * Responsible for showing als related settingpage.
+        * Separate method is needed because als settings differ quite
+        * a bit from the other on/off settings.
+        *
+        * @param aPage reveals what page should be displayed.
+        */
+        void ShowAlsSettingPageL( TGSCallItemIds aPage );
+
+        /**
+        * Processes user's selection
+        * @param aSetting tells which value to switch
+        * Used when Central Repository is enabled
+        */
+        void SwitchOnOffSetting( TCallSettId aSetting );
+
+        /**
+        * Adds item to a list
+        * @param aList reference to a list
+        * @param aItem resource ID of the item to be added
+        */
+        void AppendItemL( CDesCArrayFlat& aList, TInt aItem );
+
+
+        /**
+        * Selects what kind of menu to create next
+        *
+        * @param aIndex currently selected item
+        */
+        virtual void HandleCreatePopupL( TInt aIndex );
+
+        /**
+        * Sets title to a setting page.
+        *
+        * @param aDlg reference to a setting page
+        * @param aTitleID resource ID of title
+        */
+        void SetTitleToSettingL( CAknRadioButtonSettingPage& aDlg, 
+                                 TInt aTitleID );
+        
+        /**
+        * Sets title to status pane.
+        *
+        * @param aTitleID resource ID of title
+        */
+        /*void SetTitleL( TInt aTitleID );*/
+
+        /**
+        * Switches value between shared data (0 = off, 1 = on)
+        * and setting page (1 = off, 0 = on).
+        * @param aValue value to switch
+        * @return switched value
+        */
+        TInt SwitchValue( TInt& aValue );
+
+        /**
+        * Shows notes when Als Block value has been changed.
+        */
+        void ShowAlsBlockNoteL();
+
+        /**
+        * Converts value between setting page and SsSettings.
+        * @param aValue value to convert
+        */
+        void AlsBlockConvertValue( TInt& aValue );
+
+        /**
+        * Converts value between setting page and SsSettings.
+        * @param aValue value to convert
+        */
+        void CliConvertValue( TInt& aValue );
+
+        /**
+        * Calls Security to make a Pin2 query.
+        *
+        * @return KPSPinQueryOk if query OK, otherwise 0.
+        */
+        TInt MakePin2QueryL();
+
+        /**
+        * Calls Security to make a Security code query.
+        *
+        * @return ETrue if query OK.
+        */
+        TBool MakeSecCodeQueryL();
+
+        /**
+        * Changes value in shared data for Als or Als Blocking.
+        */
+        void SwitchAlsSettingL();
+
+
+        /**
+        * Shows Soft reject setting page.
+        */
+        void ShowSoftRejectSettingPageL();
+
+
+
+        /**
+        * Display the Setting page for Replace Prefix item
+        * @param aCurrentValue currently selected value in the setting page.
+        * @return ETrue if the setting page selection has changed.
+        */
+        TBool ShowPrefixSettingPageL( TInt& aCurrentValue );
+
+        /**
+        * Toggles the Replace prefix between ON & OFF
+        * @param aSettingPage Tells whether to display the setting page
+        */
+        void ChangePrefixSettingL( TBool aSettingPage );
+        
+        /**
+        * Set the new changes to VOIP variables.
+        * @param aPage one of the TGSCallItemIds value w.r.t VOIP
+        * @param aCurrentSetting currently selected setting page item
+        */
+        void SetVoipSettingBasedSelectedLine( 
+            const TGSCallItemIds aPage, 
+            TInt aCurrentSetting );
+
+        /**
+        * Gets line for selected VoIP setting.
+        * @param aPage one of the TGSCallItemIds value w.r.t VOIP
+        * @return line for selected VoIP setting.
+        */
+        TInt GetLineForSelectedVoipSetting( const TGSCallItemIds aPage );
+
+        /**
+        * Display background image list from media gallery.
+        */
+        void ShowVTStillImageSettingPageL();
+
+        /**
+        *
+        */
+        void ShowStillImageListL();
+
+        /**
+        * Display image load wait note dialog.
+        */
+        void ShowImageLoadWaitNoteL();
+
+        /**
+        * Hide image load wait note dialog.
+        */
+        void HideImageLoadWaitNoteL();
+
+        /**
+        * Prompt image related errors to the user.
+        * @param aError system wide Symbian errors
+        */
+        void HandleImageErrorsL( TInt aError );
+
+        /**
+        * Check if the input file is DRM protected
+        * @param aOriginalFileName Path of the bitmap file
+        * @return ETrue if file is DRM protected.
+        *         EFalse otherwise.
+        */
+        TBool CheckDRMProtectionL( const TDesC& aOriginalFileName );
+        
+        TBool ShowCallDurationSettingPageL( TInt& aCurrentValue );
+        
+        void ChangeCallDurationSettingL( TBool aSettingPage );
+
+        /**
+        * Shows note if preferred call setting 
+        * was changed to the Internet Telephone.
+        */
+        void ShowPreferredTelephonyNoteL();
+        
+        /*
+        *  Toggles between the setting values based on aShowSettingPage
+        *  @param aShowSettingPage is ETrue then setting page is shown
+        */
+        void ChangeLongPressCallKeySettingL( const TBool aShowSettingPage );
+        
+        /*
+        * Launches setting page with the LongPressCallKey setting items
+        * @Param gets the updated value set
+        */
+        TBool ShowLongPressCallKeySettingPageL( TInt& aCurrentValue );
+
+        /**
+        * Launches settings page for Own Image during video call setting  
+        */
+        void ShowOwnImageVtCallSettingPageL();
+        
+    private:
+        //Retrieves container pointer.
+        CGSCallPluginContainer*  Container();
+        
+        /*
+        * Checks call state.
+        * @return one of the call states from P&S key
+        */
+        TInt CheckCallStateL();
+
+    protected: // Member Variables
+        //CGSCallPluginModel class variable
+        CGSCallPluginModel*         iModel;
+        //General access class for phonesettings.
+        CPsetContainer*             iSettings;
+        //Call waiting SS handler
+        CPsetCallWaiting*           iWaiting;
+        //General access class for PSUI.
+        CPsuiContainer*             iObsContainer;
+        //Call waiting note handler
+        CPsuiWaitingObs*            iCwObserver;
+        //Fetches ss related phone settings.
+        RSSSettings*                iSsSettings;
+        //Value of als.
+        TInt                        iAls;
+        //Value of ALS Blocking.
+        TInt                        iAlsBlock;
+        //Value of Clir
+        TInt                        iClir;
+        //Has the rocker been pressed.
+        TBool                       iRockerPress;
+        //Creates and handles calls to CCBS Manager.
+        CGSCcbsHandler*             iCcbsHandler;
+        
+    private:
+        // for image handling
+        CGSAsyncImageHandling*      iImageHandler;
+        // for load wait dialog
+        CAknWaitDialog*             iWaitDialog;
+        // local variation for restricted CLIR
+        TBool                       iRestrictedClir;
+        // local variation for secure CLIR
+        TBool                       iSecureClir;
+        // video Telephony Still Image state
+        TInt                        iVtStillImage;
+        // Previous video Telephony Still Image state
+        TInt                        iPreviousVtStillImage;
+        // check if which command MSK is set during destruction
+        TBool                       iMskCommandFlag;
+        //Lock for VT still image listbox item
+        TBool iVTImageSelectionOngoing;
+           
+    };
+
+
+#endif  //GSCALLPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,214 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains definition of constants used in GSCallPlugin.
+*
+*/
+
+#ifndef GSCALLPLUGIN_HRH
+#define GSCALLPLUGIN_HRH
+
+
+enum TGSCallNotes
+    {
+    ECWActivateNote = 1,
+    ECWCancelNote,
+    ECWNotActiveNote,
+    ERequestCancelledNote,
+    ERequestingNote,
+    EAlsDisabledNote,
+    EAlsEnabledNote,
+    ECallInProgress,
+    ECugIndexErrorNote,
+    EImageLoadWaitNote
+    };
+
+enum TGSCallMenuCommands
+    {
+    EAppCmdCreatePopupList = 4,
+    EAppCmdChange,
+    EGSCmdCallWaitActivate,
+    EGSCmdCallWaitInquiry,
+    EGSCmdCallWaitDeactivate,
+    EGSCmdOwnNumberSendOn,
+    EGSCmdOwnNumberSendOff,
+    EGSCmdOwnNumberSendDefault,
+    //EGSCmdCCBSInquiry,
+    EGSCmdStillImage
+    };
+
+
+enum TCallSettId
+    {
+    EGSNotSet,
+    EGSOpeningSlideAnswerCall,
+    EGSClosingSlideEndCall,
+    EGSSoftRejectDefault,
+    EGSSummaryAfterCall,
+    EGSCallDuration
+    };
+
+enum TGSCallSettingActions
+    {
+    EGSAlsSetPrimary = 0,
+    EGSAlsBlockingOn = 0,
+    EGSClirPreset = 0,
+    EGSCallWaitingOn = 0,
+    EGSCallWaitingOff = 1,
+    EGSClirOn = 1,
+    EGSAlsSetAlternate = 1,
+    EGSAlsBlockingOff = 1,
+    EGSSettingDlgNumber = 1,
+    EGSClirOff = 2,
+    EGSCallWaitingStatus = 2
+    };
+
+enum TGSCustomerServiceGroups
+    {
+    EGSCSPCallWaiting = 1,
+    EGSCSPAlternateLine,
+    EGSCenRepSoftReject
+    };
+
+enum TCugPopupIndex
+    {
+    EGSCugNetworkDefault = 0,
+    EGSCugOn = 1,
+    EGSCugOff = 2
+    };
+
+
+enum TGSSoftKeys
+    {
+    EGSSoftkeyQuit = 1,
+    EGSSoftkeyEmpty
+    };
+
+
+//Call view's list items.
+enum TGSCallItemIds
+    {
+    EGSOpeningSlideAnswerCallItemId,
+    EGSClosingSlideEndCallItemId,
+    EGSCliItemId,
+    EGSCallWaitingItemId,
+    //EGSCCBSItemId,
+    EGSSummaryAfterCallItemId,
+    EGSSoftRejectTextItemId,
+    EGSStillImageItemId,
+    EGSAutoRedialToVoiceItemId,
+    EGSReplacePrefixItemId,
+    EGSLineChangeItemId,
+    EGSALSBlockItemId,
+    EGSICSendIntCallIdItemId,
+    EGSICWaitingItemId,
+    EGSICPreferredTelephonyId,
+    EGSDndItemId,
+    EGSShowCallDurationItemId,
+    EGSLongPressCallKeyItemId,
+    EGSOwnImageVtCallItemId
+    };
+
+// VoIP specific setting id's
+enum TGSVoIPSetting
+    {
+    EGSVoIPSendIntCallId = 0,
+    EGSVoIPCW,
+    EGSVoIPPreType,
+    EGSVoIPDnd,
+    EGSVoIPBarring
+    };
+
+// Send my Internet call caller id
+enum TGSSendIntCallId
+    {
+    EGSSendIntCallIdOn = 0,     // Default
+    EGSSendIntCallIdOff,
+    EGSSendIntCallIdDefault
+    };
+
+// Internet call waiting    
+enum TGSVoIPCallWaiting
+    {
+    EGSCSCallWaitingOff = 0,    // Default
+    EGSCSCallWaitingOn
+    };
+
+// Preferred call type
+enum TGSVoIPPreferredType
+    {
+    EGSPreferredCS = 0,         // Default
+    EGSPreferredPS
+    };        
+
+// Internet call do not disturb
+enum TGSVoIPCallDnd
+    {
+    EGSCSCallDndOff = 0,        // Default
+    EGSCSCallDndOn
+    };
+
+//VT still image in use lbx indexes
+enum TGSVtStillImage
+    {
+    EGSVtStillImageNotInUse = 0,
+    EGSVtStillImageInUse
+    };
+
+//Listbox item indexes for Actions
+enum
+    {
+    ECFCmdActivate = 5001,
+    ECFCmdCancel,
+    ECFCmdCheckStatus,
+    ECFCmdCancelAll
+    };
+
+//Listbox item index for Long Press Call Key
+// NOTE : EGSLongPressCallKeyVoiceCall is the default value normally
+// NOTE: When Restore Factory Settings is done, the default value 
+//       is set to EGSLongPressCallKeyInActive
+// Three key values are used for a CenRep key though we have two
+// two setting items because these values are also been used by
+// CallUi and Phone Application.
+enum
+    {
+    EGSLongPressCallKeyNotSet = 0, // Value mapped to "InActive"
+    EGSLongPressCallKeyVoiceCall, // Value mapped to "InActive"
+    EGSLongPressCallKeyVideoCall // Value mapped to "Video Call"
+    };
+
+//slide settings are shown or not
+enum TGSShowSlideSettings
+    {
+    EGSNotShowSlideSettings = 0,
+    EGSShowSlideSettings
+    };
+
+//opening slide answer call
+enum TGSOpeningSlideAnswerCall
+    {
+    EGSOpeningSlideAnswerCallOff = 0,
+    EGSOpeningSlideAnswerCallOn
+    };
+
+//closing slide end call
+enum TGSClosingSlideEndCall
+    {
+    EGSClosingSlideEndCallOff = 0,
+    EGSClosingSlideEndCallOn
+    };
+
+#endif // GSCALLPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,259 @@
+/*
+* Copyright (c) 2002 - 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     Container for Call sub-menu in General Settings.
+*
+*/
+
+
+#ifndef GSCALLPLUGINCONTAINER_H
+#define GSCALLPLUGINCONTAINER_H
+
+// INCLUDES
+#include "MGsFWMSKLabelObserver.h"
+#include "GSPhoneSettingConstants.h"
+
+#include <RSSSettings.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <bautils.h>
+#include <SoftReject.rsg>
+#include <gsbasecontainer.h>
+#include <gssettingid.h>
+
+// FORWARD DECLARATIONS
+class RSSSettings;
+class CGSListBoxItemTextArray;
+class CGSCallPluginModel;
+
+// CONSTANTS
+// this is required also by the view class implementation.
+_LIT( KGSSoftRejectResource, "z:softreject.rsc" );
+
+
+// CLASS DECLARATION
+/**
+*  CGSCallPluginContainer container class
+*/
+class CGSCallPluginContainer  : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        *
+        * @param aRect gives the correct TRect for construction.
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CGSCallPluginContainer();
+
+    public:
+
+        /**
+        * Updates list box
+        *
+        * @param aItemId is a updated list box item
+        * @param aNewValue is a new value to be used for settings
+        */
+        virtual void UpdateListBoxL( TInt aItemId, TInt aNewValue );
+
+        /**
+        * Creates list box
+        *
+        * @param aResLbxId is resource number to create.
+        */  
+        void ConstructListBoxL( TInt aResLbxId );
+
+        /**
+        * Retrieves the currently selected listbox feature id
+        * @return feature id.
+        * @since 2.5
+        */
+        TInt CurrentFeatureId( ) const;
+
+        /**
+        * Retrieves soft reject text.
+        * @param aSoftRejectTxt retrieved text.
+        * @since 2.5
+        */
+        void GetSoftRejectTextL( TDes& aSoftRejectTxt );
+
+        /** 
+        * Reads from soft reject resource file.
+        * @param aResourceId reource ID to read.
+        * @return read resource text.
+        * @since 2.5
+        */
+        HBufC* ReadFromResourceL( TInt aResourceId );
+
+        /**
+        * Defines observer for the middle softkey label changes.
+        * Can only be set once. Further attempts are ignored.
+        * @since S60 v3.1
+        */
+        void SetMiddleSoftkeyObserver( MGsFWMSKObserver* aObserver );
+        
+        /**
+        * OfferKeyEvent to this Call Container class for updating the label
+        * Up and Down rocker keys are handled 
+        * @since S60 v3.1
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
+                                                    TEventCode aType );
+
+    protected: //new
+
+        /**
+        * Creates list box items
+        */  
+        virtual void CreateListBoxItemsL();
+
+        
+        /**
+        * Creates Still Image list box item.
+        */  
+        virtual void MakeStillImageItemL();
+
+        /**
+        * Creates Own Number sending list box item.
+        */  
+        virtual void MakeONSItemL();
+
+        /**
+        * Creates Call Waiting list box item
+        */  
+        virtual void MakeCWItemL();
+
+        /**
+        * Creates Phone line used list box item
+        * @param aAlsValue value of setting
+        */  
+        virtual void MakePLUItemL( TInt& aAlsValue);
+
+        /**
+        * Creates Phone line blocked list box item
+        * @param aAlsBlockValue value of setting
+        */  
+        void MakePLBItemL( TInt& aAlsBlockValue );
+
+        /**
+        * Creates Speed Dialing, Anykey Answer, Summary After Call
+        * and Automatic redial items.
+        * @param aIndex which item to create 
+        */  
+        virtual void MakeCallItemL( TInt aIndex );
+
+
+
+        /**
+        * Creates Soft reject text item.
+        */
+        void MakeSoftRejectTxtItemL();               
+
+        /**
+        * Required for help.
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+
+        /**
+        * Creates Replace Prefix list box item
+        */
+        void MakeReplacePrefixItemL();
+
+        /**
+        * Create IC CLIR item.
+        * @since 3.0
+        */
+        void MakeICClirItemL();
+
+        /**
+        * Create IC waiting item.
+        * @since 3.0
+        */
+        void MakeICWaitingItemL();
+
+        /**
+        * Create Preferred call type item.
+        * @since 3.0
+        */
+        void MakeICPreferredCallTypeItemL();
+        
+        /**
+        * Create DND item.
+        * @since 3.0
+        */
+        void MakeDndItemL();
+        
+        /**
+        * Create Call Duration item.
+        * @since 3.1
+        */
+        void MakeCallDurationItemL();
+        
+        /**
+        * Create Long press call key items.
+        * @since 4.0
+        */
+        void MakeLongPressCallKeyItemL();
+        
+        /**
+        * Creates Own Image during video call item
+        * @since 3.2 
+        */
+        void MakeOwnImageVtCallItemL();
+        
+        /**
+         * Create "Opening slide to answer call" and "Closing slide to end call" item
+         * @since 5.1
+         */
+        void MakeSlideSettingsItem( TInt aItemId );
+        
+    protected: // Member variables
+        //SsSettings engine for CLI.
+        RSSSettings* iSsSettings;
+        //Resource based features.
+        CGSListBoxItemTextArray* iListboxItemArray;
+        //user selection for still image
+        CDesCArrayFlat* iStillImgValues;
+        //replace prefix items
+        CDesCArrayFlat* iChangeModeItems;
+        // List items in Internet Call CLIR. 
+        CDesCArrayFlat* iClirItems;  
+        // List items in Internet Call waiting. 
+        CDesCArrayFlat* iCWItems;  
+        // List items in Preferred call type.
+        CDesCArrayFlat* iPCTItems;  
+        // List items in do not disturb.
+        CDesCArrayFlat* iDndItems;
+        // Call Plugin model object
+        CGSCallPluginModel* iModel;
+        // List items in call duration item.
+        CDesCArrayFlat* iCallDurationItems;
+        // List items in call duration item.
+        CDesCArrayFlat* iLongPressCallKeyItems;
+        // List items in own image vt call item.
+        CDesCArrayFlat* iOwnImageVtCallItems;
+        /**
+        * Middle softkey label observer.
+        * Own.
+        */
+        MGsFWMSKObserver* iMSKObserver;
+        
+    };
+
+#endif //GSCALLPLUGINCONTAINER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Call Settings plugin model.
+*
+*/
+
+
+#ifndef GSCALLPLUGINMODEL_H
+#define GSCALLPLUGINMODEL_H
+
+// INCLUDES
+#include "GSCallPlugin.hrh"
+
+#include <e32base.h>
+#include <centralrepository.h>
+#include <backgroundimage.h>
+
+
+// CONSTANTS
+// Panic codes for used in this compilation unit
+enum KGSCallPluginModelPanicCodes
+    {
+    EGSCallPluinModelPanicNullPtr = 1
+    };
+
+const TInt KGSVTStillImageValue = 0;
+
+// FORWARD DECLARATIONS
+class CPsetCustomerServiceProfile;
+class CGSBackgroundImage;
+
+class CSPSettings;
+
+// CLASS DEFINITION
+/**
+*  CGSCallPluginModel is the model class of GS app.
+*  It provides functions to get and set setting values.
+*/
+class   CGSCallPluginModel : public CBase
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CGSCallPluginModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSCallPluginModel();
+
+    public: //new 
+        
+        
+        /* 
+        * Returns one of the call related values from shared data.
+        * @param aKeyName name of the shared data key to fetch
+        * @param aId value of shared data key
+        * @return ETrue: no errors
+        *         EFalse: an error has occurred
+        */
+        TBool GetCallSettingValue( const TCallSettId aCallId, TInt& aId );        
+                
+        /* 
+        * Sets one of the call related values from shared data.
+        * @param aKeyName name of the shared data key to set
+        * @param aId value of shared data key
+        * @return ETrue: no errors
+        *         EFalse: an error has occurred
+        */
+        TInt SetCallSettingValue( const TCallSettId aCallId, TInt aId );
+        
+        /**
+        * Gets CSP status
+        * 
+        * @return ETrue: CSP is set
+        *         EFalse: CSP is not set
+        */
+        TBool GetCSPStatus();
+
+        /**
+        * Sets CSP Active
+        * @param aValue TBool
+        * @return ETrue: CSP is set
+        *         EFalse: CSP is not set
+        */
+        void SetCSPActiveL( TBool aValue );
+
+        /**
+        * Returns if CSP setting is supported
+        * @param aSettingNumber TInt
+        * @return ETrue: CSP is supported
+        *         EFalse: CSP is not supported
+        */
+        TBool IsSettingSupported( TInt aSettingNumber );
+
+		/**
+        * Gets soft reject text from shared data.
+        * @param aText User defined text for soft reject. 
+        */
+        TBool GetSoftRejectText( TDes& aText );
+
+        /**
+        * Sets user defined text to shared data for soft reject.
+        * @param aText User defined text for soft reject.
+        */
+        TBool SetSoftRejectText( TDes& aText );
+
+        //Still Image functions
+        /**
+        * Get the current value for Still Image
+        * from Shared Data
+        */
+        TInt VTStillImageL();
+
+        /**
+        * Set the current value for Still Image
+        * to Shared Data
+        */
+        void SetVTStillImageL( const TInt aValue );        
+
+        /**
+        * Get the Japanese prefix change mode value from shared data
+        * @return mode
+        */
+        TInt PrefixChangeModeL();
+
+        /**
+        * Set the Japanese prefix change mode value to shared data
+        * @param aMode integer value (0/1)
+        */
+        void SetPrefixChangeModeL( TInt aMode );
+
+        /**
+        * Get the Japanese prefix data from shared data
+        * @param aText the edited value from data query
+        */
+        void PrefixChangeDataL( TDes& aText );
+
+        /**
+        * Set the Japanese prefix data to shared data
+        * @param aText the edited value from data query
+        */
+        void SetPrefixChangeDataL( const TDesC& aText );
+
+        /**
+        * Check if Restricted Send Caller Id is supported.
+        * This is handled using GS local variation
+        * @return ETrue if supported.
+        */
+        TBool RestrictedSendCallerIdSupportedL();
+        
+        /**
+        * Check if Secure Send Caller Id is supported.
+        * This is handled using GS local variation
+        * @return ETrue if supported.
+        */
+        TBool SecureSendCallerIdSupportedL();
+        
+        /** 
+        * Returns one of the VoIP call related values from Cent. Repository
+        * @param aVoipSettingId name of the Cent. Repository key to fetch
+        * @param aVoipId value of Cent. Repository key
+        * @return KErrNone if successful
+        */
+        TInt GetVoIPCallSettingValue( 
+            const TGSVoIPSetting aVoipSettingId, 
+            TInt& aVoipId );        
+                
+        /** 
+        * Sets one of the VoIP call related values from Cent. Repository
+        * @param aVoipSettingId name of the Cent. Repository key to set
+        * @param aVoipId value of Cent. Repository key
+        * @return KErrNone if successful
+        */
+        TInt SetVoIPCallSettingValue( 
+            const TGSVoIPSetting aVoipSettingId, 
+            TInt aVoipId ); 
+            
+        /**
+        * Gets SCCP status from Central Repository
+        * @param aStatus value of Cent. Repository key
+        * @return KErrNone if successful
+        */    
+        TInt GetSCCPStatus( TInt& aStatus );    
+              
+        /**
+        * Switches value between CenRep (0 = off, 1 = on)
+        * and setting page (1 = off, 0 = on).
+        * @param aValue value to switch
+        * @return switched value
+        */
+        void SwitchValue( TInt& aValue );
+        
+        /**
+        * Get Call Duration value from CenRep
+        */
+        TInt CallDurationL();
+        
+        /**
+        * Set Call Duration value to CenRep key.
+        * @param aValue value to set
+        */
+        void SetCallDurationL( TInt aValue );
+        
+        /**
+        * Get Long Press Call Key value
+        */
+        TInt LongPressCallKeyL();
+        
+        /**
+        * Set Long Press Call Key value to CenRep key.
+        * @param aValue value to set
+        */
+        void SetLongPressCallKeyL( const TInt aValue );
+        
+        /**
+        * Maps the Long Press Call Key setting value
+        * @Param value to be mapped
+        **/
+        void MapLongPressKeyCallKeyValue( TInt &aValue );
+        
+        
+        /**
+        * Check if VoIP features are supported
+        * This is done using Central Repository
+        * @return ETrue if VoIP is supported
+        */       
+        TBool VoIPSupported();
+
+        /**
+        * Get own image vt call status
+        */
+        TInt OwnImageVtCallStatusL();
+        
+        /**
+        * Set Own Image video call value to CenRep key.
+        * @param aValue value to set
+        */
+        void SetOwnImageVtCallStatusL( const TInt aValue );
+        
+        /**
+        * Check if slide settings items should be shown
+        * @return ETrue if slide settings items should be shown
+        */
+        TBool SlideSettingsShownL() const;
+
+    private: // Private constructors
+        /**
+        * Default C++ contructor
+        */
+        CGSCallPluginModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+
+
+    private: // new
+		void InitializeCentralRepositoryL();
+		void UninitializeCentralRepository();
+
+    public: // data members
+        CGSBackgroundImage* iBackgroundApi;
+
+	private:
+		CPsetCustomerServiceProfile* iCSP; //check if CSP is active
+
+        //Central repository objects
+        CRepository* iTelephonyRepository;
+        CRepository* iCommonCallephonyRepository;
+        CRepository* iGSVariationRepository;
+        CRepository* iRichCallRepository;
+        CRepository* iLogsRepository;
+        CRepository* iCommonTelephonyRepository;
+        
+        TInt iLocalVariationValues; //local variated constants
+		CSPSettings* iSpSettings;
+
+    };
+
+#endif // GSCALLPLUGINMODEL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/inc/MGsFWMSKLabelObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Indicates that MSK label might be in need of update.
+*
+*/
+
+
+#ifndef M_GSFWMSKLABELOBSERVER_H
+#define M_GSFWMSKLABELOBSERVER_H
+
+#include <e32std.h>
+
+/**
+ *  Observer interface to enable observer to verify currently displayed 
+ *  middle softkey label. The inherited method should be called when 
+ *  the middle softkey label is in need of updating after a navigation 
+ *  event has been detected.
+ *  @since S60 v3.1
+ */
+class MGsFWMSKObserver
+    {
+
+public:
+
+    /**
+     * Observer interface to verify currently displayed middle softkey label.
+     */
+    virtual void CheckMiddleSoftkeyLabelL() = 0;
+
+    };
+
+
+#endif // M_GSFWMSKLABELOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/loc/GSCallPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,514 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSCallPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d: title for call settings folder
+//l: title_pane_t2/opt9
+//w:
+//r: 3.1
+#define qtn_set_title_settings_call "Call settings"
+
+//d: title for call settings folder
+//l: list_single_large_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_set_folder_call "Call"
+
+//-----------------------------still image-----------------------------------
+//d: Command in general settings call folder, opens Video call's still image
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_gs_still_image_vt_call "Video call's still image"
+
+//d: command concerning video call's still image not used
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_gs_still_image_notused "Not used"
+
+//d: command concerning video call's still image user defined
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_gs_still_image_define "User defined"
+
+//d: error note text when user selects a DRM protected VT Still image
+//d: connection active
+//l: popup_note_window
+//w:
+//r: 3.1
+#define qtn_drm_not_allowed "Unable to select a copyright protected item"
+
+//--------------------------end still image-----------------------------------
+
+
+//d: Command in general settings call folder, opens 'Open slide to answer calls' view
+//l: list_setting_pane_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_opening_slide "Open slide to answer calls"
+
+//d: Command in general settings call folder, opens 'Close slide to end calls' view
+//l: list_setting_pane_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_closing_slide "Close slide to end calls"
+
+//d: Command in general settings call folder, opens sending own number
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define text_clir "Own number sending"
+
+//d: Command in general settings call folder, opens call waiting
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define text_call_waiting "Call waiting"
+
+//d: automatic redial-setting item in call folder
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_call_repeat "Automatic redial"
+
+//d: Command in general settings call folder, opens summary after call
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define text_cterm_setting "Summary after call"
+
+//d: Command in general settings call folder, opens one key calling
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_mocal_setting_onekey "One key calling"
+
+//d: Command in general settings call folder, opens any key answering
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_anykey_answer "Anykey answer"
+
+//d: phone line selection list item in general settings call folder
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_als_phoneline_in_use "Phone line in use"
+
+//d: phone line blocking list item in general settings call folder
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_als_phonelinet_blocking "Phone line blocking"
+
+//d: heading in one key calling view
+//l: main_pane_set_t1
+//w:
+//r: 3.1
+#define qtn_mocal_sett_onekey_title "One key calling"
+
+//d: heading in automatic redial view
+//l: main_pane_set_t1
+//w:
+//r: 3.1
+#define qtn_mocal_sett_redial_title "Automatic redial"
+
+
+//
+// SHOW CALL DURATION
+//
+
+//d: heading in 'Open slide to answer calls' view
+//l: main_pane_set_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_title_opening_slide "Open slide to answer calls"
+
+//d: setting item text for opening slide answer call
+//l: list_set_graphic_pane_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_opening_slide_answer "On"
+
+//d: setting item text for opening slide not answer call
+//l: list_set_graphic_pane_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_opening_slide_not_answer "Off"
+
+//d: heading in 'Close slide to end calls' view
+//l: main_pane_set_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_title_closing_slide "Close slide to end calls"
+
+//d: setting item text for closing slide end call
+//l: list_set_graphic_pane_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_closing_slide_end "On"
+
+//d: setting item text for closing slide not end cal
+//l: list_set_graphic_pane_t1
+//w:
+//r: 5.1
+#define qtn_cp_setting_closing_slide_not_end "Off"
+
+
+//d:Show call duration list item in call folder
+//l:list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_logs_lda3_time "Show call duration"
+
+//d: setting item text for show call duration
+//d: setting item value ON
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_logs_ldv3_timer_on "Yes"
+
+//d: setting item text for show call duration
+//d: setting item value OFF
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_logs_ldv3_timer_off "No"
+
+//d:Information note when call duration setting is to be changed and
+//d:a call is active.
+//l:popup_note_window
+//w:
+//r: 3.1
+#define qtn_info_during_call "End active call first"
+
+//CLIR
+//d: command concerning own number sending
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define text_cli_sending_default "Set by network"
+
+//d: command concerning own number sending
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define text_cli_sending_on "On"
+
+//d: command concerning own number sending
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define text_cli_sending_off "Off"
+
+//d: heading in own number sending view
+//l: list_setting_pane_t1 
+//w:
+//r: 3.1
+#define qtn_own_number_sending_heading "Own number sending"
+
+
+//d: command concerning call waiting
+//l: list_single_pane_t1_cp2
+//w:
+//r: 3.1
+#define text_activate_waiting "Activate"
+
+//d: command concerning call waiting
+//l: list_single_pane_t1_cp2
+//w:
+//r: 3.1
+#define text_cancel_waiting "Cancel"
+
+//d: command concerninc call waiting
+//l: list_single_pane_t1_cp2
+//w:
+//r: 3.1
+#define text_status_waiting "Check status"
+
+// ON-OFF FEATURES
+//d: automatic redial setting item text when feature on
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_call_repeat_on "On"
+
+//d: automatic redail setting item text when feature off
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_call_repeat_off "Off"
+
+//d: onekey calling setting item text when feature on
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_one_key_call_on "On"
+
+//d: onekey calling setting item text when feature off
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_one_key_call_off "Off"
+
+//d: anykey answer setting item text when feature on
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_anykey_on "On"
+
+//d: anykey answer setting item text when feature off
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_anykey_off "Off"
+
+//d: summary after call setting item text when feature off
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define text_call_termination_note_on "On"
+
+//d: summary after call setting item text when feature off
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define text_call_termination_note_off "Off"
+
+//ALS FEATURES
+//d: setting item heading when selecting line
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_als_line_selection_mode "Line selection mode:"
+
+//d: setting item text for primary line
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_als_line1 "Line 1"
+
+//d: setting item text for alternate line
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_als_line2 "Line 2"
+
+//d: setting item heading in phone line blocking 
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_als_phoneline_block_mode "Phone line blocking mode:"
+
+//d: confirmation note when line change disabled 
+//l: popup_note_window
+//w:
+//r: 3.1
+#define text_als_line_blocking_on_sel "Line change disabled"
+
+//d: confirmation note when line change enabled
+//l: popup_note_window
+//w:
+//r: 3.1
+#define text_als_line_blocking_off_sel "Line change enabled"
+
+//d: line blocking disabled selection (OFF) in the settings page
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define text_als_line_blocking_off "Off"
+
+//d: line blocking enabled selection (ON) in the settings page
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define text_als_line_blocking_on "On"
+
+// JAPANESE: Replace Prefix
+
+//d: Command in general settings call folder, opens Replace calling prefix
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_replace_prefix "Replace calling prefix"
+
+//d: command concerning Replace calling prefix
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_replace_prefix_on "On"
+
+//d: command concerning Replace calling prefix
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_replace_prefix_off "Off"
+
+//d: text to the code query which opens when one is about to enter 
+//d: replacement for '+'
+//l: popup_query_data_window
+//w:
+//r: 3.1
+#define qtn_set_prefix_data_query "For not-81 country code: "
+
+
+// ********* VOIP *********** //
+//d: heading in internet call clir view
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_clir_voip "Send my Int. call caller ID"
+
+//d: heading in internet call waiting view
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_voip_call_waiting "Internet call waiting"
+
+//d: internet call waiting setting item text when feature on
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_voip_waiting_active "Active"
+
+//d: internet call waiting setting item text when feature off
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_voip_waiting_not_active "Not active"
+
+//d: heading in preferred telephony view
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_voip_settings_preferred_tel "Preferred telephone"
+
+//d: preferred telephony item text when feature cellural telephony
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_voip_preferred_tel_cs "Cellular telephone"
+
+//d: preferred telephony item text when feature internet telephony
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_voip_preferred_tel_ps "Internet telephone"
+
+//d: preferred telephony note text when selecting internet telephony
+//l: popup_info_list_pane_t1
+//w:
+//r: 3.1
+#define qtn_voip_pref_teleph_set_note "Regardless of this setting, creating a call via Call creation key makes always a cellular call if internet call service is not available"
+
+//d: Command in general settings call folder, opens call waiting
+//l: list_setting_pane_t1
+//w:
+//r: 3.1
+#define qtn_voip_do_not_disturb "Internet call do not disturb"
+
+//d: Command in general settings call folder, opens call waiting
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_voip_do_not_disturb_on "On"
+
+//d: Command in general settings call folder, opens call waiting
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_voip_do_not_disturb_off "Off"
+
+//d: note is shown when CLIR settings is changed and and SCCP software is installed
+//l: popup_note_window
+//w:
+//r: 3.1
+#define qtn_voip_sccp_no_clir "Note that Send Int. call caller ID does not affect SCCP based Internet calls"
+
+//d: activating highlighted call forward
+//l: list_single_pane_t1_cp2
+//
+#define text_activate_divert "Activate"
+
+//d: cancelling highlighted call forward
+//l: list_single_pane_t1_cp2
+//
+#define text_cancel_divert "Cancel"
+
+//d: checking status of highlighted call forward
+//l: list_single_pane_t1_cp2
+//
+#define text_check_status "Check status"
+
+/*********************************************************************
+*  LONG.PRESS.OF.SEND.LAUNCH.VIDEO.CALL
+*********************************************************************/
+//d:Text of a list item in Call view's list
+//d:Long press of Call key item
+//l:list_setting_pane_t1
+//w:
+//r: 4.0
+#define qtn_gs_long_press_call_key "Long press of Call key"
+
+//d:Item in Long press of Call key setting page's list
+//d:Setting value Inactive
+//l:list_set_graphic_pane_t1
+//w:
+//r: 4.0
+#define qtn_gs_long_press_call_key_inactive "Inactive"
+
+//d:Item in Long press of Call key setting page's list
+//d:Setting value Video call
+//l:list_set_graphic_pane_t1
+//w:
+//r: 4.0
+#define qtn_gs_long_press_call_key_video "Video call"
+
+
+//Video call mute status item
+
+//d: Command in general settings call folder, opens sending own video
+//l: list_setting_pane_t1
+//w:
+//r: 3.2
+#define qtn_gs_own_image_vt_call "Own video in answered call"
+
+//d: option for own video sending
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.2
+#define qtn_gs_own_image_ask_first "Ask first"
+
+//d: option for own video sending
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.2
+#define qtn_gs_own_image_no "No"
+
+//d: option for own video sending
+//l: list_set_graphic_pane_t1
+//w:
+//r: 3.2
+#define qtn_gs_own_image_yes "Yes"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/loc/SoftReject.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Resource file for Phone Application
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d: heading in soft reject settings menu
+//l: list_setting_pane_t1
+//
+#define qtn_mocal_sett_softrej_title "Reject call with message"
+
+//d: heading in soft reject text settings menu
+//l: list_setting_pane_t1
+//
+#define qtn_gs_soft_reject_text_title "Message text"
+
+//d:  Command in general settings call folder, opens soft reject menu
+//l:  list_setting_pane_t1
+//
+#define qtn_gs_soft_reject "Reject call with message"
+
+//d:  Command in general settings call folder, opens soft reject text menu
+//l:  list_setting_pane_t1
+// 
+#define qtn_gs_soft_reject_text "Message text"
+
+
+//d: soft reject selection (ON) in the settings page
+//l: list_set_graphic_pane_t1
+//
+#define qtn_gs_soft_on "On"
+
+//d: soft reject selection (OFF) in the settings page
+//l: list_set_graphic_pane_t1
+//
+#define qtn_gs_soft_off "Off"
+
+// d: It is used as softkey text. If pressed, the call isn't rejected,
+// d: but an SMS editor with soft reject default text is opened.
+// l: control_pane_t1/opt7
+//
+#define qtn_softkey_soft_reject "Soft Reject"
+
+//d: soft reject text in the settings page
+//l: list_set_graphic_pane_t1
+//
+#define qtn_gs_soft_default_text "Hi, I’m busy at the moment, but I contact you a bit later."
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,2177 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Call submenu in General Settings.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSCallPlugin.h"         //for CGSCallPlugin
+#include "GSCallPluginContainer.h"    //for CGSCallPluginContainer
+#include "GsLogger.h"
+#include "GSCallPlugin.h"             //for pluginUID
+#include <akntitle.h>                // for title pane
+#include <coeaui.h>
+#include <hlplch.h>                     // For HlpLauncher
+#include <aknnotewrappers.h>            //for Note Wrappers
+#include <aknradiobuttonsettingpage.h>  //for Radiobutton pages
+#include <akntextsettingpage.h>         //for TextSettings pages
+#include <aknmessagequerydialog.h>      //for Message Query Dialog
+#include <aknViewAppUi.h>
+#include <aknnotedialog.h>
+#include <AknWaitDialog.h>
+#include <gscommon.hrh>
+
+// headers for still image
+#include <imageconversion.h>
+#include <MGFetch.h>                    // Image selection
+#include <DRMCommon.h>
+
+#include <eikmenup.h>                   //for menu bar
+#include <PsetContainer.h>              //for container
+#include <PsuiContainer.h>              //for CPsuiContainer
+#include <featmgr.h>
+#include <SecUiSecurityHandler.h>       //for PIN2 query
+#include <SecUi.h>                      //for TSecUi
+#include <SecUiSecuritySettings.h>      //for CSecuritySettings
+#include <GSCallPluginRsc.rsg>           //for resource IDs
+#include <gscallplugin.mbg>
+#include <gsfwviewuids.h>
+#include <gslistbox.h>                  //for CGSListBoxItemTextArray
+
+#include <settingsinternalcrkeys.h>
+#include    <ctsydomainpskeys.h>
+#include <gsprivatepluginproviderids.h>
+
+// LOCAL CONSTANTS
+_LIT( KGSNameOfClass, "GSCallPlugin" );
+_LIT( KGSVTStillImgPath, "" );
+//Use default values for external calls.
+const TInt KGSUseDefault = 0;
+//Call Prefix setting page items
+const TInt KGSSettingItemOff = 1;
+const TInt KGSSettingItemOn = 0;
+//Lines in setting page.
+const TInt KGSFirstLine = 0;
+const TInt KGSSecondLine = 1;
+// Middle Softkey control ID.
+const TInt KGSMSKControlID = 3;
+
+// VT still image values. Basically everything above 0 should be considered as
+// 'On' value so do not compare with 1
+const TInt KGSVTStillImageOff = 0;
+
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+//
+// Constructor.
+//
+// ---------------------------------------------------------------------------
+CGSCallPlugin::CGSCallPlugin()
+    :iMskCommandFlag( ETrue )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two-phased constructor (second phase)
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::ConstructL()
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::ConstructL");
+    OpenLocalizedResourceFileL( KGSCallPluginResourceFileName,
+                                iResourceLoader );
+                                
+    BaseConstructL( R_GS_CALL_VIEW );
+
+    iModel = CGSCallPluginModel::NewL();
+    iRestrictedClir = iModel->RestrictedSendCallerIdSupportedL();
+    iSecureClir = iModel->SecureSendCallerIdSupportedL();
+    __GSLOGSTRING("[GSCallPlugin]--> ConstructL - Model created");
+    iSettings = CPsetContainer::NewL();
+    __GSLOGSTRING("[GSCallPlugin]--> ConstructL - PSetContainer created");
+    iObsContainer = CPsuiContainer::NewL();
+    __GSLOGSTRING("[GSCallPlugin]--> ConstructL - PsuiContainer created");
+    iCwObserver = iObsContainer->CreateCWObsL();
+    __GSLOGSTRING("[GSCallPlugin]--> ConstructL - CreateCWObsL done");
+    iWaiting = iSettings->CreateCWObjectL( *iCwObserver );
+    __GSLOGSTRING("[GSCallPlugin]--> ConstructL - CreateCWObjectL done");
+    iSsSettings = new (ELeave) RSSSettings;
+    __GSLOGSTRING("[GSCallPlugin]--> ConstructL - SSSettings created");
+
+    User::LeaveIfError( iSsSettings->Open() );
+    User::LeaveIfError( iSsSettings->RegisterAll( *this ) );
+    __GSLOGSTRING("[GSCallPlugin]--> ConstructL - SSSettings opening successful");
+
+#ifndef __WINS__
+    iSsSettings->Get( ESSSettingsAls, iAls );
+    iSsSettings->Get( ESSSettingsAlsBlocking, iAlsBlock );
+#endif //__WINS__
+    
+    iVTImageSelectionOngoing = EFalse;
+    
+    __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two-phased constructor (first phase)
+//
+// ---------------------------------------------------------------------------
+CGSCallPlugin* CGSCallPlugin::NewLC()
+    {
+    CGSCallPlugin* self = new ( ELeave ) CGSCallPlugin;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSCallPlugin* CGSCallPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSCallPlugin* self = new(ELeave) CGSCallPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Destructor
+//
+// ---------------------------------------------------------------------------
+CGSCallPlugin::~CGSCallPlugin()
+    {
+    __GSLOGSTRING("[GSCallPlugin] ~CGSCallPlugin()|->");
+    
+    delete iObsContainer;
+    delete iCwObserver;
+    if ( iWaiting )
+        {
+        delete iWaiting;	
+        }
+    delete iSettings;
+
+    if ( iSsSettings )
+        {
+        iSsSettings->CancelAll( *this );
+        iSsSettings->Close();
+        delete iSsSettings;
+        }
+
+    if( iModel )
+        {
+        delete iModel;
+        }
+
+    if( iImageHandler )
+        {
+        delete iImageHandler;
+        }
+
+    __GSLOGSTRING("[GSCallPlugin] ~CGSCallPlugin()-|");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Returns Id of the Call submenu
+//
+// ---------------------------------------------------------------------------
+TUid CGSCallPlugin::Id() const
+    {
+    return KCallPluginUID;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Handles user inputs in Options menu
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::HandleCommandL( TInt aCommand )
+    {
+    __GSLOGSTRING1("[GSCallPlugin] HandleCommandL(%d)|->", aCommand );
+    switch ( aCommand )
+        {
+        case EGSMSKCmdAppChange:
+             HandleListBoxSelectionL();
+             break;
+            // Command Obtained from Context Options
+            // set in ProcessCommandL()
+        case ECFCmdActivate:
+        case EGSCmdCallWaitActivate:
+            iWaiting->SetCallWaitingL( MPsetCallWaiting::EActivateCallWaiting,
+                                       EAllTeleAndBearer );
+            break;
+            // Command Obtained from Context Options
+            // set in ProcessCommandL()
+        case ECFCmdCheckStatus:
+        case EGSCmdCallWaitInquiry:
+            iWaiting->GetCallWaitingStatusL();
+            break;
+            // Command Obtained from Context Options
+            // set in ProcessCommandL()
+        case ECFCmdCancel: 
+        case EGSCmdCallWaitDeactivate:
+            iWaiting->SetCallWaitingL( MPsetCallWaiting::EDeactivateCallWaiting,
+                                       EAllTeleAndBearer );
+            break;
+        case EAppCmdCreatePopupList:
+            {
+            const TInt currentFeatureId = Container()->CurrentFeatureId();
+            HandleCreatePopupL( currentFeatureId );
+            }
+            break;
+        case EAknSoftkeyBack:
+            iAppUi->ActivateLocalViewL( KGSTelPluginUid );
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    __GSLOGSTRING("[CGSCallPlugin] HandleCommandL()-|");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Handles user inputs in Options menu
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::ProcessCommandL( TInt aCommand )
+    {
+    MenuBar()->SetContextMenuTitleResourceId( R_CALL_DIVERT_MSK_CONTEXTMENUBAR );
+    // Call base class
+    CAknView::ProcessCommandL( aCommand );
+    }
+// ---------------------------------------------------------------------------
+//
+// Activates the view
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::DoActivateL( const TVwsViewId&  aPrevViewId ,
+                                       TUid  aCustomMessageId,
+                                       const TDesC8&  aCustomMessage  )
+    {
+    __GSLOGSTRING( "[GSCallPlugin] DoActivateL()|->" );
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+    Container()->SetMiddleSoftkeyObserver( this );
+    SetMiddleSoftKeyLabelL( R_CALL_MSK_CHANGE, EGSMSKCmdAppChange );
+    // This way we set which command is set for MSK
+    iMskCommandFlag = ETrue;
+//    iContainer->iListBox->SetTopItemIndex( iTopItemIndex );
+
+//    if ( iCurrentItem >= 0 &&
+//         iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() )
+//        {
+//        iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem );
+//        }
+    CheckMiddleSoftkeyLabelL();
+    
+	// If AppUid is different or placeholderview is used, this view has been launched from outside GS
+	if ( iPrevViewId.iAppUid != KUidGS || iPrevViewId.iViewUid == TUid::Uid(0x0DEADBED ) )
+		{
+		CEikButtonGroupContainer* cbaGroup = Cba();
+		if( cbaGroup )
+			{
+			HBufC* rightSKText = StringLoader::LoadLC ( R_GS_CBA_EXIT );
+			TPtr rskPtr = rightSKText->Des();
+			cbaGroup->SetCommandL( 2, EAknSoftkeyExit, *rightSKText );
+			CleanupStack::PopAndDestroy( rightSKText );
+			}
+	}
+    
+    __GSLOGSTRING( "[GSCallPlugin] DoActivateL()-|" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Deactivates the view
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> DoDeactivate");
+    if ( iContainer )
+        {
+        if ( iContainer->iListBox && iContainer->iListBox->View() )
+            {
+            iTopItemIndex = iContainer->iListBox->TopItemIndex();
+            iCurrentItem = iContainer->iListBox->CurrentItemIndex();
+            }
+        CGSBaseView::DoDeactivate();
+        }
+    __GSLOGSTRING("[GSCallPlugin] <--DoDeactivate");
+    }
+
+
+
+// ---------------------------------------------------------------------------
+//
+// Handle status pane size changed
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::HandleStatusPaneSizeChange()
+	{
+		if ( Container() )
+			Container()->SetRect( ClientRect());
+	}
+
+
+// ---------------------------------------------------------------------------
+//
+// Shows setting page - for ON/OFF setting items
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::ShowSettingPageL( TGSCallItemIds aPage )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::ShowSettingPageL");
+
+    CDesCArrayFlat* items =
+          new ( ELeave ) CDesCArrayFlat( KGSCallPopupMenuItems );
+    CleanupStack::PushL( items );
+
+    TInt titleID = 0;
+    TInt currentSettingItem = KErrNone;
+    TCallSettId keyName = EGSNotSet;
+
+    switch ( aPage )
+        {
+        case EGSOpeningSlideAnswerCallItemId:
+            keyName = EGSOpeningSlideAnswerCall;
+            titleID = R_CP_SETTING_TITLE_OPENING_SLIDE;
+            AppendItemL( *items, R_CP_SETTING_OPENING_SLIDE_ANSWER );
+            AppendItemL( *items, R_CP_SETTING_OPENING_SLIDE_NOT_ANSWER );
+            break;
+        case EGSClosingSlideEndCallItemId:
+            keyName = EGSClosingSlideEndCall;
+            titleID = R_CP_SETTING_TITLE_CLOSING_SLIDE;
+            AppendItemL( *items, R_CP_SETTING_CLOSING_SLIDE_END );
+            AppendItemL( *items, R_CP_SETTING_CLOSING_SLIDE_NOT_END );
+            break;        
+        case EGSICSendIntCallIdItemId:
+            titleID = R_SET_IC_CLIR;
+            AppendItemL( *items, R_SET_IC_CLIR_ON );
+            AppendItemL( *items, R_SET_IC_CLIR_OFF );
+            break;
+        case EGSICWaitingItemId:
+            titleID = R_SET_IC_WAITING;
+            AppendItemL( *items, R_SET_IC_WAITING_ACTIVE );
+            AppendItemL( *items, R_SET_IC_WAITING_NOT_ACTIVE );
+            break;
+        case EGSICPreferredTelephonyId:
+            titleID = R_SET_IC_PREFERRED_TELEPHONE;
+            AppendItemL( *items, R_SET_IC_PREFERRED_TELEPHONE_CS );
+            AppendItemL( *items, R_SET_IC_PREFERRED_TELEPHONE_PS );
+            break;
+        case EGSDndItemId:
+            titleID = R_SET_IC_DND;
+            AppendItemL( *items, R_SET_IC_DND_ACTIVE );
+            AppendItemL( *items, R_SET_IC_DND_NOT_ACTIVE );
+            break;
+        case EGSCliItemId:
+            titleID = R_OWN_NUMBER_SENDING_HEADING;
+
+            // Restrict the default option if necessary
+            if ( !iRestrictedClir )
+                {
+                AppendItemL( *items, R_CLI_SENDING_DEFAULT );
+                }
+
+            AppendItemL( *items, R_CLI_SENDING_ON );
+            AppendItemL( *items, R_CLI_SENDING_OFF );
+            break;           
+        case EGSSummaryAfterCallItemId:
+            keyName = EGSSummaryAfterCall;
+            titleID = R_CTERM_SETTING;
+            AppendItemL( *items, R_CALL_TERMINATION_NOTE_ON );
+            AppendItemL( *items, R_CALL_TERMINATION_NOTE_OFF );
+            break;   
+        default:
+            Panic( KGSNameOfClass, EInvalidIndex );
+            break;
+    }
+
+    if ( aPage == EGSICSendIntCallIdItemId  ||
+         aPage == EGSICWaitingItemId        ||
+         aPage == EGSICPreferredTelephonyId ||
+         aPage == EGSDndItemId )
+        {
+        currentSettingItem = GetLineForSelectedVoipSetting( aPage );
+        }
+    // CLI item does not have a keyName and/or literal, hence
+    // this additional checking for CLI item.
+    else if ( aPage != EGSCliItemId && keyName != EGSNotSet )    
+        {
+        iModel->GetCallSettingValue( keyName, currentSettingItem );
+        __GSLOGSTRING1("[GSCallPlugin]    ShowSettingPageL: currentSettingItem: %d", currentSettingItem);
+        // switch value to settings page value
+        SwitchValue( currentSettingItem );
+        }
+    else
+        {
+        TInt err = iSsSettings->Get( ESSSettingsClir, currentSettingItem );
+        __GSLOGSTRING1("[GSCallPlugin]    ShowSettingPageL: currentSettingItem1: %d", currentSettingItem);
+        if ( err == KErrNone )
+            {
+            CliConvertValue( currentSettingItem );
+
+            if ( iRestrictedClir )
+                {
+                // For indexing listbox which does not include KGSCliDefault
+                currentSettingItem--;
+                }
+            }
+        }
+
+    HBufC* buffer = NULL;
+
+    buffer = HBufC::NewLC( KGSMaxStringLength );
+    TPtr str = buffer->Des();
+    StringLoader::Load( str, titleID );
+
+    TPtr string = buffer->Des();
+    const TInt oldSettingItem = currentSettingItem;
+    CAknRadioButtonSettingPage* dlg = new ( ELeave )
+        CAknRadioButtonSettingPage(
+            &string,
+            EAknSettingPageNoOrdinalDisplayed,
+            KGSUseDefault,
+            KGSUseDefault,
+            R_SETTING_PAGE,
+            currentSettingItem,
+            items );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        const TBool settingItemChanged = oldSettingItem != currentSettingItem;
+
+        if ( aPage == EGSICSendIntCallIdItemId  ||
+             aPage == EGSICWaitingItemId        ||
+             aPage == EGSICPreferredTelephonyId ||
+             aPage == EGSDndItemId )
+            {
+            // Change new VoIP setting based selected line.
+            SetVoipSettingBasedSelectedLine( aPage, currentSettingItem );
+            }
+        else
+            {
+            if ( aPage != EGSCliItemId && keyName != EGSNotSet )
+                {
+                // switch settings page value to shared data value
+                SwitchValue( currentSettingItem );
+                iModel->SetCallSettingValue( keyName, currentSettingItem );
+                __GSLOGSTRING1("[GSCallPlugin]    ShowSettingPageL: currentSettingItem2: %d", currentSettingItem);
+                }
+            else
+                {
+                if ( iRestrictedClir )
+                    {
+                    // For indexing listbox which does not include KGSCliDefault
+                    currentSettingItem++;
+                    }
+
+                CliConvertValue( currentSettingItem );
+
+                // Secure setting of Send Caller Id if required
+                if ( !iSecureClir )
+                    {
+                    iSsSettings->Set( ESSSettingsClir, currentSettingItem );
+                    }
+                else
+                    {
+                    if ( settingItemChanged && MakeSecCodeQueryL() )
+                        {
+                        iSsSettings->Set( ESSSettingsClir, currentSettingItem );
+                        }
+                    }
+                __GSLOGSTRING1("[GSCallPlugin]    ShowSettingPageL: currentSettingItem3: %d", currentSettingItem);
+                }
+            }
+
+        UpdateListBoxL( aPage, currentSettingItem );
+        }
+
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( items );
+    __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::ShowSettingPageL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Shows ALS setting page - either line blocking or line selected
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::ShowAlsSettingPageL( TGSCallItemIds aPage  )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::ShowAlsSettingPageL");
+    CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( KGSCallPopupMenuItems );
+    CleanupStack::PushL( items );
+
+    TInt currentItem = 0;
+
+    switch ( aPage )
+        {
+        case EGSLineChangeItemId:
+            //causes PIN2 query to launch, if necessary
+            if ( iAlsBlock == ESSSettingsAlsBlockingOn )
+                {
+                TInt pin = MakePin2QueryL();
+                if (  pin != KGSPinQueryOk )
+                    {
+                    CleanupStack::PopAndDestroy( items );
+                    return; //User failed in Pin2 Query
+                    }
+                }
+            AppendItemL( *items, R_ALS_LINE1 );
+            AppendItemL( *items, R_ALS_LINE2 );
+            currentItem = iAls - 1;
+            break;
+        case EGSALSBlockItemId:
+            {
+                TInt pin = MakePin2QueryL();
+                if ( pin != KGSPinQueryOk )
+                    {
+                    CleanupStack::PopAndDestroy( items );
+                    return; //User failed in Pin2 Query
+                    }
+                AppendItemL( *items, R_ALS_LINE_BLOCKING_ON );
+                AppendItemL( *items, R_ALS_LINE_BLOCKING_OFF );
+                if ( iAlsBlock == ESSSettingsAlsBlockingOn )
+                    {
+                    currentItem = KGSAlsBlockOn;
+                    }
+                else
+                    {
+                    currentItem = KGSAlsBlockOff;
+                    }
+                break;
+            }
+        default:
+            Panic( KGSNameOfClass, EInvalidIndex );
+            break;
+        }
+    HBufC* buffer =
+        HBufC::NewLC( KGSMaxStringLength );
+    TPtr string( buffer->Des() );
+    StringLoader::Load(
+        string,
+        ( aPage == EGSLineChangeItemId ) ?
+            R_ALS_LINE_SELECTION_MODE :
+            R_ALS_PHONELINE_BLOCK_MODE );
+
+    CAknRadioButtonSettingPage* dlg = new ( ELeave )
+        CAknRadioButtonSettingPage(
+            &string,
+            EAknSettingPageNoOrdinalDisplayed,
+            KGSUseDefault,
+            KGSUseDefault,
+            R_SETTING_PAGE,
+            currentItem,
+            items );
+
+    // handle als and blocking separately...
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        if ( aPage == EGSALSBlockItemId )
+            {
+            AlsBlockConvertValue( currentItem );
+            iSsSettings->Set( ESSSettingsAlsBlocking, iAlsBlock );
+            }
+        else if ( aPage == EGSLineChangeItemId )
+            {
+            iAls = currentItem + 1;
+            iSsSettings->Set( ESSSettingsAls, iAls );
+            }
+        }
+    CleanupStack::PopAndDestroy( 2 ); // items, string
+    __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::ShowAlsSettingPageL");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Changes value from 0 to 1 and vice versa
+// Used when Central Repository is enabled
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::SwitchOnOffSetting( TCallSettId aSetting )
+    {
+    TInt value = KGSSettingOff;
+    // Reads a value and switches value (0 -> 1, 1 -> 0).
+    iModel->GetCallSettingValue( aSetting, value );
+    SwitchValue( value );
+    iModel->SetCallSettingValue( aSetting, value );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Appends given item to given list
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::AppendItemL( CDesCArrayFlat& aList, TInt aItem )
+    {
+    HBufC* string = StringLoader::LoadLC( aItem );
+    aList.AppendL( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Selects what kind of menu is created
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::HandleCreatePopupL( TInt aIndex )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::HandleCreatePopupL");
+    switch ( aIndex )
+        {
+        case EGSCallWaitingItemId:
+            break;
+        case EGSLineChangeItemId:
+            ShowAlsSettingPageL( EGSLineChangeItemId );
+            break;
+        case EGSALSBlockItemId:
+            ShowAlsSettingPageL( EGSALSBlockItemId );
+            break;
+        case EGSSoftRejectTextItemId:
+            ShowSoftRejectSettingPageL();
+            UpdateListBoxL( EGSSoftRejectTextItemId, KGSNotUsed );
+            break;
+        case EGSStillImageItemId:
+            if ( FeatureManager::FeatureSupported(
+                                 KFeatureIdCsVideoTelephony ) )
+                {
+                ShowVTStillImageSettingPageL();
+                }
+            break;
+        case EGSOwnImageVtCallItemId:
+            if ( FeatureManager::FeatureSupported(
+                                 KFeatureIdCsVideoTelephony ) )
+                {
+                ShowOwnImageVtCallSettingPageL();
+                }
+            break;
+        case EGSReplacePrefixItemId:
+            if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) )
+                {
+                ChangePrefixSettingL( ETrue );
+                UpdateListBoxL( EGSReplacePrefixItemId, KGSNotUsed );
+                }
+            break;
+        case EGSShowCallDurationItemId:
+            ChangeCallDurationSettingL( ETrue );
+            UpdateListBoxL( EGSShowCallDurationItemId, KGSNotUsed );
+            break;
+        case EGSLongPressCallKeyItemId:
+        #ifdef RD_VT_LONG_SEND_KEY 
+        	ChangeLongPressCallKeySettingL( ETrue );
+        #endif
+        	break;
+        default:
+            ShowSettingPageL( static_cast<TGSCallItemIds> ( aIndex ) );
+            break;
+        }
+    __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::HandleCreatePopupL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Sets title text to a setting page
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::SetTitleToSettingL( CAknRadioButtonSettingPage& aDlg,
+                                            TInt aTitleID )
+    {
+    HBufC* title = StringLoader::LoadLC ( aTitleID );
+    aDlg.SetSettingTextL( *title );
+    CleanupStack::PopAndDestroy( title );
+    }
+
+
+/*// ---------------------------------------------------------------------------
+//
+// Sets title text to a status pane
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::SetTitleL( TInt aTitleID )
+    {
+    CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
+    CleanupStack::PushL(statusPane);
+	CAknTitlePane* titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(
+			EEikStatusPaneUidTitle));
+	CleanupStack::PushL( titlePane );
+	
+    TResourceReader reader;
+    iCoeEnv->CreateResourceReaderLC( reader, aTitleID );
+    titlePane->SetFromResourceL( reader ); 
+    
+    CleanupStack::PopAndDestroy();//reader
+	
+	CleanupStack::Pop(titlePane);
+	CleanupStack::Pop(statusPane);
+    }
+*/
+
+// ---------------------------------------------------------------------------
+//
+// Switches value between setting page and shared data.
+//  Values in shared data do not map nicely to values in setting menu,
+//  therefore sharedData:SettingOn(1) => settingPage:IndexOn(0).
+// ---------------------------------------------------------------------------
+TInt CGSCallPlugin::SwitchValue( TInt& aValue )
+    {
+    if ( aValue == KGSSettingOn )
+        {
+        aValue = KGSIndexOn;
+        }
+    else if ( aValue == KGSSettingOff )
+        {
+        aValue = KGSIndexOff;
+        }
+    return aValue;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Observes changes to ALS, ALS Block and CLIR values.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::PhoneSettingChanged( TSSSettingsSetting aSetting,
+    TInt aNewValue )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::PhoneSettingChanged");
+    TInt updateMe = KErrNone;
+    switch( aSetting )
+        {
+        case ESSSettingsClir:
+            iClir = aNewValue;
+            updateMe = EGSCliItemId;
+            break;
+        case ESSSettingsAls:
+            iAls = aNewValue;
+            updateMe = EGSLineChangeItemId;
+            break;
+        case ESSSettingsAlsBlocking:
+            iAlsBlock = aNewValue;
+            updateMe = EGSALSBlockItemId;
+            TRAP_IGNORE( ShowAlsBlockNoteL() );
+            break;
+        default:
+            break;
+        }
+    __GSLOGSTRING1("[GSCallPlugin]    PhoneSettingChanged: aNewValue: %d", aNewValue);
+    if ( ( iContainer ) && ( updateMe != KErrNone ) )
+        {
+        TRAP_IGNORE( UpdateListBoxL( updateMe, aNewValue ) );
+        }
+    __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::PhoneSettingChanged");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Shows notes when Als Block value has been changed.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::ShowAlsBlockNoteL()
+    {
+    TInt noteText;
+    if ( iAlsBlock == ESSSettingsAlsBlockingOn )
+        {
+        noteText = R_ALS_LINE_BLOCKING_ON_SEL;
+        }
+    else
+        {
+        noteText = R_ALS_LINE_BLOCKING_OFF_SEL;
+        }
+
+    HBufC* string = StringLoader::LoadLC( noteText );
+    CAknInformationNote* note = new ( ELeave ) CAknInformationNote();
+    note->ExecuteLD( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates new iContainer.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::NewContainerL()
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> NewContainerL");
+    iContainer = new (ELeave) CGSCallPluginContainer;
+    __GSLOGSTRING("[GSCallPlugin] <--NewContainerL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::HandleListBoxSelectionL
+//
+// Handle user selection in the listbox to perform an associated action
+// ---------------------------------------------------------------------------
+void CGSCallPlugin::HandleListBoxSelectionL()
+    {
+    TBool updateValue = EFalse;
+    TInt value( KErrNone );
+    CEikMenuBar* menuBar = this->MenuBar();
+
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+
+    TBool featureVoipSupported = iModel->VoIPSupported();
+
+    switch ( currentFeatureId )
+        {
+        case EGSOpeningSlideAnswerCallItemId:
+            SwitchOnOffSetting( EGSOpeningSlideAnswerCall );
+            updateValue = ETrue;
+            break;
+        case EGSClosingSlideEndCallItemId:
+            SwitchOnOffSetting( EGSClosingSlideEndCall );
+            updateValue = ETrue;
+            break;
+        case EGSCliItemId:
+            ShowSettingPageL( EGSCliItemId );
+            break;
+        case EGSCallWaitingItemId:
+            iRockerPress = ETrue;
+            menuBar->SetMenuType(CEikMenuBar::EMenuContext);
+            menuBar->TryDisplayMenuBarL();
+            menuBar->SetMenuType(CEikMenuBar::EMenuOptions);
+            iRockerPress = EFalse;
+            break;
+        case EGSICSendIntCallIdItemId:  // Send my Internet call id.
+            if ( featureVoipSupported )
+                {
+                iModel->GetVoIPCallSettingValue( EGSVoIPSendIntCallId, value );
+
+                if ( value == EGSSendIntCallIdOff )
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPSendIntCallId, EGSSendIntCallIdOn );
+                    }
+                else
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPSendIntCallId, EGSSendIntCallIdOff );
+
+                    TInt status( KErrNone );
+                    iModel->GetSCCPStatus( status );
+
+                    if ( status == 1 )
+                        {
+                        HBufC* prompt = StringLoader::
+                            LoadLC( R_QTN_VOIP_SCCP_NO_CLIR );
+                        CAknInformationNote* note =
+                            new(ELeave) CAknInformationNote( ETrue );
+                        note->ExecuteLD( *prompt );
+                        CleanupStack::PopAndDestroy( prompt );
+                        }
+                    }
+                updateValue = ETrue;
+                }
+            break;
+        case EGSICWaitingItemId:  // Internet call waiting item.
+            if ( featureVoipSupported )
+                {
+                iModel->GetVoIPCallSettingValue( EGSVoIPCW, value );
+
+                if ( value == EGSCSCallWaitingOff )
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPCW, EGSCSCallWaitingOn );
+                    }
+                else
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPCW, EGSCSCallWaitingOff );
+                    }
+                updateValue = ETrue;
+                }
+            break;
+        case EGSICPreferredTelephonyId: // Preferred call type.
+            if ( featureVoipSupported )
+                {
+                iModel->GetVoIPCallSettingValue( EGSVoIPPreType, value );
+
+                if ( value == EGSPreferredCS )
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPPreType, EGSPreferredPS );
+                    
+                    // Show message query dialog if preferred call
+                    // setting was changed to the Int. Telephone.
+                    ShowPreferredTelephonyNoteL();     
+                    }
+                else
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPPreType, EGSPreferredCS );
+                    }
+                updateValue = ETrue;
+                }
+            break;
+        case EGSDndItemId: // Do not disturb.
+            if ( featureVoipSupported )
+                {
+                iModel->GetVoIPCallSettingValue( EGSVoIPDnd, value );
+
+                if ( value == EGSCSCallDndOff )
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPDnd, EGSCSCallDndOn );
+                    }
+                else
+                    {
+                    iModel->SetVoIPCallSettingValue(
+                        EGSVoIPDnd, EGSCSCallDndOff );
+                    }
+                updateValue = ETrue;
+                }
+            break;
+        case EGSSoftRejectTextItemId:
+            ShowSoftRejectSettingPageL();
+            updateValue = ETrue;
+            break;
+        case EGSSummaryAfterCallItemId:
+            SwitchOnOffSetting( EGSSummaryAfterCall );
+            updateValue = ETrue;
+            break;
+        case EGSLineChangeItemId:
+            SwitchAlsSettingL();
+            break;
+        case EGSALSBlockItemId:
+            ShowAlsSettingPageL( EGSALSBlockItemId );
+            break;
+        //Still image listbox creating
+        case EGSStillImageItemId:
+            if ( FeatureManager::FeatureSupported(
+                                 KFeatureIdCsVideoTelephony ) && 
+                                 !iVTImageSelectionOngoing )
+                {
+                //Locking listbox selection so user cannot click
+                //VT still image item twice
+                iVTImageSelectionOngoing = ETrue;
+                
+                //This takes some time
+                ShowVTStillImageSettingPageL();
+                
+                //Releasing lock
+                iVTImageSelectionOngoing = EFalse;
+                }
+            break;
+        case EGSOwnImageVtCallItemId:
+            if ( FeatureManager::FeatureSupported(
+                                 KFeatureIdCsVideoTelephony ) )
+                {
+                ShowOwnImageVtCallSettingPageL();
+                }
+            break;
+        case EGSReplacePrefixItemId:
+            if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) )
+                {
+                ChangePrefixSettingL( EFalse );
+                updateValue = ETrue;
+                }
+            break;
+        case EGSShowCallDurationItemId:
+            ChangeCallDurationSettingL( EFalse );
+            updateValue = ETrue;
+            break;
+        case EGSLongPressCallKeyItemId:
+        #ifdef RD_VT_LONG_SEND_KEY
+        	ChangeLongPressCallKeySettingL( EFalse );
+        #endif
+        	break;
+        default:
+            break;
+        }
+    if ( updateValue )
+        {
+        UpdateListBoxL( currentFeatureId, KGSNotUsed );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Converts value from setting page to SsSettings:
+// settin page: line change disabled(0) => ESSSettingsAlsBlockingOn(2)
+// settin page: line change enabled(1) => ESSSettingsAlsBlockingOff(1)
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::AlsBlockConvertValue( TInt& aValue )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::AlsBlockConvertValue");
+    __GSLOGSTRING1("[GSCallPlugin]    AlsBlockConvertValue: aValue: %d", aValue);
+    if ( aValue == KGSAlsBlockOn )
+        {
+        iAlsBlock = ESSSettingsAlsBlockingOn;
+        }
+    else
+        {
+        iAlsBlock = ESSSettingsAlsBlockingOff;
+        }
+    __GSLOGSTRING1("[GSCallPlugin]    AlsBlockConvertValue: aValue: %d", aValue);
+    __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::AlsBlockConvertValue");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Converts value from setting page to SsSettings:
+// settin page: own number sending default(0) =>
+//                               SsSettings: ESSSettingsClirNetworkDefault(0)
+// settin page: own number sending on (1) =>
+//                               SsSettings: ESSSettingsClirExplicitSuppress(2)
+// settin page: own number sending off (2) =>
+//                               SsSettings: ESSSettingsClirExplicitInvoke(1)
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::CliConvertValue( TInt& aValue )
+    {
+    switch ( aValue )
+        {
+        case KGSCliDefault:
+            aValue = ESSSettingsClirNetworkDefault;
+            break;
+        case KGSCliOn:
+            aValue = ESSSettingsClirExplicitSuppress;
+            break;
+        case KGSCliOff:
+            aValue = ESSSettingsClirExplicitInvoke;
+            break;
+        default:
+            //error, return to-be converted value w/o changes
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Updates specific value to container.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::UpdateListBoxL( const TInt& aListItem,
+                                          TInt aNewValue )
+    {
+    /*if ( aListItem == EGSStillImageItemId )
+    	{
+        TRAP_IGNORE( iAvkonAppUi->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ) );
+        SetTitleL( R_GS_CALL_VIEW_TITLE );
+        TRAP_IGNORE( iAvkonAppUi->StatusPane()->DrawNow() );
+    	}*/
+    if ( Container() )
+        {
+        Container()->UpdateListBoxL( aListItem, aNewValue );
+        }
+    CheckMiddleSoftkeyLabelL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Before showing a options menu
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                      CEikMenuPane* aMenuPane )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> DynInitMenuPaneL");
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+    CEikMenuBar* menuBar = this->MenuBar();
+    if ( aResourceId == R_GS_CALL_VIEW_MENU )
+        {
+        if ( currentFeatureId == EGSCallWaitingItemId  )
+            {
+            //add CW menu
+            if (MenuBar()->ItemSpecificCommandsEnabled() || MenuBar()->GetMenuType() == CEikMenuBar::EMenuContext)
+            	{
+            	aMenuPane->AddMenuItemsL( R_GS_CALL_WAIT_VIEW_MENU,EAppCmdCreatePopupList );
+            	}
+            
+            //hide Change if call waiting is selected
+            aMenuPane->SetItemDimmed( EAppCmdCreatePopupList, ETrue );
+            
+            if ( iRockerPress )
+                {
+                aMenuPane->SetItemDimmed( EAknCmdExit, ETrue );
+                }
+            
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp )
+                 && !iRockerPress )
+                {
+                aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+                }
+            else
+                {
+                aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+                }
+            }
+        else
+            {
+            //for other items than call waiting
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+                }
+            else
+                {
+                aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+                }
+            }
+        }
+    
+    __GSLOGSTRING("[GSCallPlugin] <--DynInitMenuPaneL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Requests user to enter PIN2
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSCallPlugin::MakePin2QueryL()
+    {
+    TInt retValue = KErrNone;
+    TSecUi::InitializeLibL();
+
+    CSecuritySettings* settings = CSecuritySettings::NewL();
+    CleanupStack::PushL( settings );
+
+    if ( settings->AskPin2L() )
+        {
+        retValue = KGSPinQueryOk;
+        }
+
+    CleanupStack::PopAndDestroy( settings );
+    TSecUi::UnInitializeLib();
+
+    return retValue;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Requests user to enter security code
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSCallPlugin::MakeSecCodeQueryL()
+    {
+    TBool retValue = EFalse;
+    TSecUi::InitializeLibL();
+
+    CSecuritySettings* settings = CSecuritySettings::NewL();
+    CleanupStack::PushL( settings );
+
+    retValue = settings->AskSecCodeL();
+
+    CleanupStack::PopAndDestroy( settings );
+    TSecUi::UnInitializeLib();
+
+    return retValue;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Changes value in shared data for Als
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::SwitchAlsSettingL()
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::SwitchAlsSettingL");
+    //causes PIN2 query to launch, if necessary
+    if ( iAlsBlock == ESSSettingsAlsBlockingOn )
+        {
+        TInt pin = MakePin2QueryL();
+        if (  pin != KGSPinQueryOk )
+            {
+            __GSLOGSTRING("[GSCallPlugin]    SwitchAlsSettingL: User failed in Pin2 Query");
+            return; //User failed in Pin2 Query
+            }
+        }
+    iSsSettings->Get( ESSSettingsAls, iAls );
+    if ( iAls == ESSSettingsAlsPrimary )
+        {
+        iAls = ESSSettingsAlsAlternate;
+        }
+    else
+        {
+        iAls = ESSSettingsAlsPrimary;
+        }
+    iSsSettings->Set( ESSSettingsAls, iAls );
+    __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::SwitchAlsSettingL");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Show Soft Reject Text setting page
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ShowSoftRejectSettingPageL()
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ShowSoftRejectSettingPageL");
+    HBufC* dynamicText = HBufC::NewLC( KGSSMSTxtEditorLength );
+    TPtr string( dynamicText->Des() );
+
+    Container()->GetSoftRejectTextL( string );
+
+    HBufC* title = Container()->ReadFromResourceL( R_SOFT_REJECT_TXT_TITLE );
+    CleanupStack::PushL( title );
+
+    // Open resource file, to get the resource texts for setting page.
+    // Find the resource file
+    RConeResourceLoader loader( *iCoeEnv );
+    TParse parse;
+    parse.Set( KGSSoftRejectResource, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+
+    // Open resource file
+    TInt err = loader.Open( fileName );
+    if ( err == KErrNotFound )
+        {
+        User::Leave( KErrGeneral );
+        }
+    CleanupClosePushL( loader );
+
+    CAknSettingPage* dlg = new( ELeave )CAknTextSettingPage(
+        title,
+        EAknSettingPageNoOrdinalDisplayed,
+        KGSUseDefault,
+        KGSUseDefault,
+        R_TEXT_SETTING_PAGE,
+        string,
+        CAknTextSettingPage::EZeroLengthAllowed |
+        CAknTextSettingPage::EPredictiveTextEntryPermitted );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        TInt value = KGSSettingOn;
+        iModel->SetCallSettingValue( EGSSoftRejectDefault, value );
+        AknTextUtils::StripCharacters( string, KAknStripTabs );
+        iModel->SetSoftRejectText( string );
+        }
+
+    CleanupStack::PopAndDestroy( 3 ); //title, dynamicText, loader
+    __GSLOGSTRING("[GSCallPlugin] <--ShowSoftRejectSettingPageL");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Show Replace Prefix setting page
+//
+// ---------------------------------------------------------------------------
+//
+TBool CGSCallPlugin::ShowPrefixSettingPageL( TInt& aCurrentValue )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ShowPrefixSettingPageL");
+    CDesCArrayFlat* items =
+        iCoeEnv->ReadDesC16ArrayResourceL( R_GS_REPLACE_PREFIX_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg =
+        new (ELeave) CAknRadioButtonSettingPage( R_GS_REPLACE_PREFIX_SETTING_PAGE,
+                                                aCurrentValue, items );
+
+    TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+    CleanupStack::PopAndDestroy( items );
+
+    __GSLOGSTRING1("[GSCallPlugin]    ShowPrefixSettingPageL: aCurrentValue: %d", aCurrentValue);
+    __GSLOGSTRING("[GSCallPlugin] <--ShowPrefixSettingPageL");
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ChangePrefixSettingL
+//
+// Change replace prefix setting.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ChangePrefixSettingL( TBool aSettingPage )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ChangePrefixSettingL");
+
+    TInt changeMode = iModel->PrefixChangeModeL();
+    TInt prevChangeMode = changeMode;
+    TBool updateValue = ETrue;
+    TBool rockerPress = EFalse;
+
+    __GSLOGSTRING1("[GSCallPlugin]    ChangePrefixSettingL: prevChangeMode: %d", prevChangeMode);
+    if ( aSettingPage )
+        {
+        updateValue = ShowPrefixSettingPageL( changeMode );
+        }
+    else
+        {
+        rockerPress = ETrue;
+        if( changeMode == KGSSettingItemOff )
+            {
+            changeMode = KGSSettingItemOn;
+            }
+        else
+            {
+            changeMode = KGSSettingItemOff;
+            }
+        }
+
+    __GSLOGSTRING1("[GSCallPlugin]    ChangePrefixSettingL: changeMode: %d", changeMode);
+    if ( updateValue )
+        {
+        //if the value is changed and is set to ON, display the query dialog
+        if ( changeMode == KGSSettingItemOn )
+            {
+            HBufC* replacePrefix = HBufC::NewLC( KGSReplacePrefixTextLength );
+            TPtr string( replacePrefix->Des() );
+            string.Zero();
+
+            iModel->PrefixChangeDataL( string );
+
+            CAknTextQueryDialog* dlg = new( ELeave ) CAknTextQueryDialog( string );
+
+            TBool ret = dlg->ExecuteLD( R_REPLACE_PREFIX_DATA_QUERY );
+            if( ret )
+                {
+                rockerPress = ETrue;
+                iModel->SetPrefixChangeDataL( string );
+                }
+            else
+                {
+                rockerPress = EFalse;
+                }
+            CleanupStack::PopAndDestroy( replacePrefix );
+
+            }
+        else
+            {
+            rockerPress = ETrue;
+            }
+        }
+
+    if ( prevChangeMode != changeMode && rockerPress )
+        {
+        iModel->SetPrefixChangeModeL( changeMode );
+        }
+
+    __GSLOGSTRING("[GSCallPlugin] <--ChangePrefixSettingL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::SetVoipSettingBasedSelectedLine
+//
+// Set the new changes to VOIP variables.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::SetVoipSettingBasedSelectedLine(
+    const TGSCallItemIds aPage, TInt aCurrentSetting )
+    {
+    switch ( aPage )
+        {
+        case EGSICSendIntCallIdItemId:
+            if ( aCurrentSetting == KGSFirstLine )
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPSendIntCallId, EGSSendIntCallIdOn );
+                }
+            else
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPSendIntCallId, EGSSendIntCallIdOff );
+                }
+            break;
+        case EGSICWaitingItemId:
+            if ( aCurrentSetting == KGSFirstLine )
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPCW, EGSCSCallWaitingOn );
+                }
+            else
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPCW, EGSCSCallWaitingOff );
+                }
+            break;
+        case EGSICPreferredTelephonyId:
+            if ( aCurrentSetting == KGSFirstLine )
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPPreType, EGSPreferredCS );
+                }
+            else
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPPreType, EGSPreferredPS );
+                           
+                // Show message query dialog if preferred call
+                // setting was changed to the Int. Telephone.
+                TRAP_IGNORE( ShowPreferredTelephonyNoteL() );
+                }
+            break;
+        case EGSDndItemId:
+            if ( aCurrentSetting == KGSFirstLine )
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPDnd, EGSCSCallDndOn );
+                }
+            else
+                {
+                iModel->SetVoIPCallSettingValue(
+                    EGSVoIPDnd, EGSCSCallDndOff );
+                }
+            break;
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::Container
+//
+// Returns call container item
+// ---------------------------------------------------------------------------
+//
+CGSCallPluginContainer* CGSCallPlugin::Container()
+    {
+    return static_cast <CGSCallPluginContainer*> ( iContainer );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::GetLineForSelectedVoipSetting
+//
+// Returns selected line based on setting value.
+// ---------------------------------------------------------------------------
+//
+TInt CGSCallPlugin::GetLineForSelectedVoipSetting(
+    const TGSCallItemIds aPage )
+    {
+    if ( !iModel->VoIPSupported() )
+        {
+        return KErrNone;
+        }
+
+    TInt value( KErrNone );
+
+    // Get value based from setting page.
+    switch ( aPage )
+        {
+        case EGSICSendIntCallIdItemId:  // No swap.
+            iModel->GetVoIPCallSettingValue( EGSVoIPSendIntCallId, value );
+            break;
+        case EGSICWaitingItemId:
+            iModel->GetVoIPCallSettingValue( EGSVoIPCW, value );
+            break;
+        case EGSICPreferredTelephonyId: // No swap.
+            iModel->GetVoIPCallSettingValue( EGSVoIPPreType, value );
+            break;
+        case EGSDndItemId:
+            iModel->GetVoIPCallSettingValue( EGSVoIPDnd, value );
+            break;
+        default:
+            break;
+        }
+
+    // Swap items.
+    if ( aPage != EGSICPreferredTelephonyId &&
+        aPage != EGSICSendIntCallIdItemId )
+        {
+        if ( value == KGSSecondLine )
+            {
+            value = KGSFirstLine;
+            }
+        else
+            {
+            value = KGSSecondLine;
+            }
+        }
+
+    return value;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ShowVTStillImageSettingPageL
+//
+// Display Video Telephony Still Image setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ShowVTStillImageSettingPageL()
+    {
+    iVtStillImage = iModel->VTStillImageL();
+    // Store previous in case something goes wrong.
+    iPreviousVtStillImage = iVtStillImage;
+    
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                                     R_GS_STILL_IMAGE_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    // Map CenRep value to lbx items:
+    TInt dialogSelection = EGSVtStillImageNotInUse;
+    if ( iVtStillImage != KGSVTStillImageOff ) dialogSelection = EGSVtStillImageInUse;
+
+    CAknRadioButtonSettingPage* dlg =
+        new( ELeave ) CAknRadioButtonSettingPage( R_GS_STILL_IMAGE_SETTING_PAGE,
+                                                  dialogSelection, items );
+
+    TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+
+    if ( ret )
+        {
+        if ( dialogSelection == EGSVtStillImageNotInUse )
+            {
+            // Still image not used
+            iModel->SetVTStillImageL( KGSVTStillImageOff );
+            }
+        else
+            {
+            // User decided to update still image
+            ShowStillImageListL();
+            }
+            
+        // Update VT item in CGSCallPlugin listbox. iVtStillImage value is 
+        // irrelevant as UpdateListBoxL actually reads the new value from 
+        // CenRep and converts it to lbx item value correctly (Off/On).
+        UpdateListBoxL( EGSStillImageItemId, iVtStillImage );
+        }
+    CleanupStack::PopAndDestroy( items );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ShowStillImageListL()
+//
+// Display background image list from media gallery.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ShowStillImageListL()
+    {
+    CDesCArray* selectedFiles = new ( ELeave ) CDesCArrayFlat( 1 );
+    CleanupStack::PushL( selectedFiles );
+
+    TBool ret = MGFetch::RunL( *selectedFiles, EImageFile, EFalse, this );
+
+    if ( ret && selectedFiles->MdcaCount() == 1 )
+        {
+        iImageHandler = CGSAsyncImageHandling::NewL( iCoeEnv->FsSession(),
+                                               this, KGSVTStillImgPath );
+
+        TPtrC imagePath = selectedFiles->MdcaPoint( 0 );
+
+        TRAPD( error, iModel->iBackgroundApi->SetVTStillImagePathL( imagePath,
+                                             *iImageHandler ) );
+        if ( error == KErrNone )
+            {
+            // Show wait note
+            ShowImageLoadWaitNoteL();
+            }
+        else
+            {
+            HandleImageErrorsL( error );
+            }
+        }
+    CleanupStack::PopAndDestroy( selectedFiles );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ImageHandlingComplete()
+//
+// Method derived from MGSSyncImageHandlingObserver
+// Run when the asynchronous image converting is complete
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ImageHandlingCompleteL( TInt aError )
+    {
+    if ( aError != KErrNone )
+        {
+        HandleImageErrorsL( aError );
+        }
+    else
+        {
+        // Needs to increment iVtStillImage value so CenRep will send 
+        // notificatios to VT (only changing value will fire notification).
+        iModel->SetVTStillImageL( ++iVtStillImage );
+        UpdateListBoxL( EGSStillImageItemId, EGSVtStillImageInUse );
+        }
+
+    HideImageLoadWaitNoteL();
+
+    delete iImageHandler;
+    iImageHandler = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ShowImageLoadWaitNoteL()
+//
+// Display image load wait note dialog.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ShowImageLoadWaitNoteL()
+    {
+    if ( !iWaitDialog )
+        {
+        iWaitDialog = new( ELeave ) CAknWaitDialog(
+                      ( REINTERPRET_CAST(CEikDialog**,
+                      &iWaitDialog ) ), ETrue );
+
+        iWaitDialog->ExecuteDlgLD( CAknNoteDialog::ENoTone,
+                                   R_IMAGE_LOAD_WAIT_NOTE );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::HideImageLoadWaitNoteL()
+//
+// Hide image load wait note dialog.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::HideImageLoadWaitNoteL()
+    {
+    if ( iWaitDialog )
+        {
+        iWaitDialog->ProcessFinishedL(); // deletes the dialog
+        iWaitDialog = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::HandleImageErrorsL
+//
+// Prompt image related errors to the user
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::HandleImageErrorsL( TInt aError )
+    {
+    TInt resourceId;
+    switch( aError )
+        {
+        case KErrNotSupported:
+        case KErrUnderflow:
+            // Image is corrupted or in wrong format
+            resourceId = R_GS_IMAGE_CORRUPTED;
+            break;
+        case KErrDiskFull:
+        case KErrNoMemory:
+            // Image is too large
+            resourceId = R_GS_IMAGE_TOO_LARGE;
+            break;
+        default:
+            // Better to give some error message than result in CONE5 panic:
+            resourceId = R_GS_IMAGE_CORRUPTED;
+            break;
+        }
+    // Show information note
+    HBufC* prompt = iCoeEnv->AllocReadResourceLC( resourceId );
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue );
+    note->ExecuteLD( *prompt );
+
+    // Setting previous VT still image value (rollback)
+    iModel->SetVTStillImageL( iPreviousVtStillImage );
+    UpdateListBoxL( EGSStillImageItemId, iPreviousVtStillImage );
+    CleanupStack::PopAndDestroy( prompt );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::VerifySelectionL()
+//
+// An overloaded method from MMGFetchVerifier interface class
+// ---------------------------------------------------------------------------
+//
+TBool CGSCallPlugin::VerifySelectionL( const MDesCArray* aSelectedFiles )
+    {
+    const TBool KGSDrmProtectedContent = ETrue;
+
+    TBool ret = ETrue;
+    //
+    if ( aSelectedFiles->MdcaCount() == 1 )
+        {
+        const TPtrC fileName( aSelectedFiles->MdcaPoint( 0 ) );
+
+        // First, check if the selected file is DRM protected
+        if  ( ret && CheckDRMProtectionL( fileName ) ==
+                    KGSDrmProtectedContent )
+            {
+            // display the note to user
+            // Show information note
+            HBufC* prompt = iCoeEnv->AllocReadResourceLC(
+                                          R_GS_DRM_NOT_ALLOWED );
+
+            CAknInformationNote* note =
+                new( ELeave ) CAknInformationNote( ETrue );
+            note->ExecuteLD( *prompt );
+
+            CleanupStack::PopAndDestroy( prompt );
+            ret = EFalse;
+            }
+
+        // Next, check whether the image header is valid
+        if  ( ret )
+            {
+            CImageDecoder* imageDecoder = NULL;
+            TRAPD( err, imageDecoder = CImageDecoder::FileNewL(
+                  iCoeEnv->FsSession(), fileName, ContentAccess::EPeek ) );
+
+            if  ( err != KErrNone )
+                {
+                // Show information note
+                HBufC* prompt = iCoeEnv->AllocReadResourceLC(
+                                                  R_GS_IMAGE_CORRUPTED );
+                CAknInformationNote* note =
+                    new( ELeave ) CAknInformationNote( ETrue );
+                note->ExecuteLD(*prompt);
+                CleanupStack::PopAndDestroy( prompt );
+
+                ret = EFalse;
+                }
+            delete imageDecoder;
+            }
+        }
+
+    return ret;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::CheckDRMProtectionL
+//
+// Check if the selected image file is DRM protected.
+// ---------------------------------------------------------------------------
+//
+TBool CGSCallPlugin::CheckDRMProtectionL( const TDesC& aOriginalFileName )
+    {
+    TBool isProtected( EFalse );
+    DRMCommon* drmClient = DRMCommon::NewL();
+    CleanupStack::PushL( drmClient );
+    TInt error = drmClient->Connect();
+    if ( error != DRMCommon::EOk )
+        {
+        User::Leave( KErrCorrupt );
+        }
+
+    if ( aOriginalFileName != KNullDesC )
+        {
+        error = drmClient->IsProtectedFile( aOriginalFileName, isProtected );
+        if ( error != DRMCommon::EOk )
+            {
+            User::Leave( KErrCorrupt );
+            }
+        }
+
+    CleanupStack::PopAndDestroy( drmClient );
+    return isProtected;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Show Call Duration setting page
+//
+// ---------------------------------------------------------------------------
+//
+TBool CGSCallPlugin::ShowCallDurationSettingPageL( TInt& aCurrentValue )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ShowCallDurationSettingPageL");
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                            R_GS_SHOW_CALL_DURATION_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
+                                R_GS_SHOW_CALL_DURATION_SETTING_PAGE,
+                                aCurrentValue, items );
+
+    TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+    CleanupStack::PopAndDestroy( items );
+
+    __GSLOGSTRING("[GSCallPlugin] <--ShowCallDurationSettingPageL");
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ChangeCallDurationSettingL
+//
+// Change Call Duration setting.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ChangeCallDurationSettingL( TBool aSettingPage )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ChangeCallDurationSettingL");
+
+    TInt callState = CheckCallStateL();
+
+    // Get information of whether there are open connections or not
+    if ( callState != EPSCTsyCallStateUninitialized &&
+         callState != EPSCTsyCallStateNone )
+        {
+        HBufC* prompt = iCoeEnv->AllocReadResourceLC( R_TEXT_ACTIVE_CALL );
+
+        CAknInformationNote* note =
+            new( ELeave ) CAknInformationNote( ETrue );
+
+        note->ExecuteLD( *prompt );
+
+        CleanupStack::PopAndDestroy( prompt );
+
+        return;
+        }
+        
+    TInt duration = iModel->CallDurationL();
+    TBool updateValue = ETrue;
+    
+    if ( aSettingPage )
+        {
+        updateValue = ShowCallDurationSettingPageL( duration );
+        }
+    else
+        {
+        if( duration == KGSSettingItemOff )
+            {
+            duration = KGSSettingItemOn;
+            }
+        else
+            {
+            duration = KGSSettingItemOff;
+            }
+        }
+
+    if ( updateValue )
+        {
+        iModel->SetCallDurationL( duration );
+        UpdateListBoxL( EGSShowCallDurationItemId, KGSNotUsed );
+        }
+
+    __GSLOGSTRING("[GSCallPlugin] <--ChangePrefixSettingL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::CheckCallStateL
+// 
+// Check call state using PubSub or SA
+// ---------------------------------------------------------------------------
+//
+TInt CGSCallPlugin::CheckCallStateL()
+    {
+    TInt callState = KErrNone;
+    //here are open connections or not
+    RProperty::Get( KPSUidCtsyCallInformation,
+                    KCTsyCallState,
+                    callState );
+    return callState;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ShowPreferredTelephonyNoteL
+// 
+// Shows note if preferred call setting was changed to the Int. Telephone.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ShowPreferredTelephonyNoteL()
+    {
+    // Create message query dialog.
+    HBufC* text = StringLoader::LoadLC( R_IC_PREFERRED_TELEPHONE_QUERY_TEXT );
+    CAknMessageQueryDialog* query = CAknMessageQueryDialog::NewL( *text );
+    query->SetMessageTextL( text->Des() );
+    
+    // Show message query dialog.
+    query->ExecuteLD( R_IC_PREFERRED_TELEPHONE_QUERY );
+    
+    CleanupStack::PopAndDestroy( text );
+    }
+
+
+// -----------------------------------------------------------------------------
+// When this method is called, view checks based on highlight focus, if the MSK
+// label is correct.
+// -----------------------------------------------------------------------------
+//
+void CGSCallPlugin::CheckMiddleSoftkeyLabelL()
+    {
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+    RemoveCommandFromMSK( iMskCommandFlag );
+    if ( currentFeatureId == EGSCallWaitingItemId )
+        {
+            // First remove any prevous commands.
+        SetMiddleSoftKeyLabelL( R_CALL_SOFTKEY_OPTION,
+                                EAknSoftkeyContextOptions );
+        // This way we set which command is set for MSK
+        iMskCommandFlag = EFalse;
+        }
+     else
+        {
+         //Set middle softkey as Change. 
+        SetMiddleSoftKeyLabelL( R_CALL_MSK_CHANGE,
+                                EGSMSKCmdAppChange );
+        // This way we set which command is set for MSK
+        iMskCommandFlag = ETrue;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Remove unnecessary commands from Middle softkey.
+// @flag = ETrue means presently MSK value is "Change" so we remove that
+// @flag = EFalse means presently MSK value is "Context Options" so we remove that
+// -----------------------------------------------------------------------------
+//
+void CGSCallPlugin::RemoveCommandFromMSK(const TBool flag )
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        if ( flag )
+            {
+                cbaGroup->RemoveCommandFromStack( 
+                                KGSMSKControlID, EGSMSKCmdAppChange );
+            }
+        else
+            {
+                cbaGroup->RemoveCommandFromStack( 
+                                KGSMSKControlID, EAknSoftkeyContextOptions );
+            }
+        }
+    }
+// ---------------------------------------------------------------------------
+// Sets middle softkey label.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::SetMiddleSoftKeyLabelL( 
+    const TInt aResourceId, const TInt aCommandId )
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        HBufC* middleSKText = StringLoader::LoadLC( aResourceId );
+        TPtr mskPtr = middleSKText->Des();
+        cbaGroup->AddCommandToStackL( 
+            KGSMSKControlID, 
+            aCommandId, 
+            mskPtr );
+        CleanupStack::PopAndDestroy( middleSKText );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSCallPlugin::HandleClientRectChange
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSCallPlugin::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ========================= From CGSPluginInterface ==================
+
+// -----------------------------------------------------------------------------
+// CGSCallPlugin::GetCaptionL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSCallPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    HBufC* result = StringLoader::LoadL( R_GS_CALL_PLUGIN_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSCallPlugin::PluginProviderCategory
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSCallPlugin::PluginProviderCategory() const
+    {
+    //This plugin is created by 3rd party.
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSCallPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSCallPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSCallPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetCallSub,
+        fp->FullName(),
+        EMbmGscallpluginQgn_prop_set_call_sub,
+        EMbmGscallpluginQgn_prop_set_call_sub_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSCallPlugin::ChangeLongPressCallKeySettingL
+//
+// Change Long Press Call Key setting.
+// values:  0,1  --> Inactive (Default Value is 1 and when RFS default value is 0) 
+// 			2 --> Video call
+// ---------------------------------------------------------------------------
+//
+void CGSCallPlugin::ChangeLongPressCallKeySettingL( const TBool aShowSettingPage )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ChangeLongPressCallKeySettingL");
+    TInt statusLongPressCallKey = iModel->LongPressCallKeyL();
+    TBool updateValue = ETrue;
+    
+    if ( aShowSettingPage )
+        {
+       	// If the status of Long Key is not active then we decrement to
+       	// the value of statusLongPressCallKey so that the values are
+       	// then tuned to launch the setting page normally with two setting
+       	// items InActive and Video Call
+       	// Refer to GSCallPlugin.hrh file for more info for the  description
+       	iModel->MapLongPressKeyCallKeyValue( statusLongPressCallKey );
+       	updateValue = ShowLongPressCallKeySettingPageL( 
+        						       statusLongPressCallKey );
+        
+        // Here if the selected index is 1 it means Video Call from the setting page
+        // we then again map this value back to 2 which is EGSLongPressCallKeyVideoCall
+        // Refer to GSCallPlugin.hrh for more details					       
+  		if ( statusLongPressCallKey == EGSLongPressCallKeyVoiceCall )
+  			{
+  			statusLongPressCallKey = EGSLongPressCallKeyVideoCall;
+  			}
+  		else // If selected index in setting page is InActive ( 0) we map
+  		     // this to EGSLongPressCallKeyVoiceCall which is 1
+  			{
+  			statusLongPressCallKey = EGSLongPressCallKeyVoiceCall;
+  			}
+        }
+	else // switch the value
+		{
+   		if ( statusLongPressCallKey == EGSLongPressCallKeyNotSet ||
+   			 statusLongPressCallKey == EGSLongPressCallKeyVoiceCall )
+			{
+        	statusLongPressCallKey = EGSLongPressCallKeyVideoCall;
+        	}
+   		else
+    		{
+        	statusLongPressCallKey = EGSLongPressCallKeyVoiceCall;
+        	}
+        }
+    if ( updateValue )
+        {
+        iModel->SetLongPressCallKeyL( statusLongPressCallKey );
+        UpdateListBoxL( EGSLongPressCallKeyItemId, KGSNotUsed );
+        }
+
+    __GSLOGSTRING("[GSCallPlugin] <--ChangeLongPressCallKeySettingL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// 		Launching Long Press Key setting page
+//
+// ---------------------------------------------------------------------------
+//
+TBool CGSCallPlugin::ShowLongPressCallKeySettingPageL( TInt& aCurrentValue )
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ShowLongPressCallKeySettingPageL");
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                            R_GS_LONG_PRESS_CALL_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
+                                R_GS_LONG_PRESS_CALL_SETTING_PAGE,
+                                aCurrentValue, items );
+
+    TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+    CleanupStack::PopAndDestroy( items );
+
+    __GSLOGSTRING("[GSCallPlugin] <--ShowLongPressCallKeySettingPageL");
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPlugin::ShowOwnImageVtCallSettingPageL
+// 
+// Displaying settings page for Own Image during video call setting
+// ----------------------------------------------------------------------------
+//
+void CGSCallPlugin::ShowOwnImageVtCallSettingPageL()
+    {
+    __GSLOGSTRING("[GSCallPlugin]--> ShowOwnImageVtCallSettingPageL");
+    TInt currentValue = iModel->OwnImageVtCallStatusL();
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                            R_GS_OWN_IMAGE_VT_CALL_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
+                                R_GS_OWN_IMAGE_VT_CALL_SETTING_PAGE,
+                                currentValue, items );
+
+    TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+    
+    if( ret )
+        {
+        iModel->SetOwnImageVtCallStatusL( currentValue );
+        UpdateListBoxL( EGSOwnImageVtCallItemId, currentValue );
+        }
+    
+    CleanupStack::PopAndDestroy( items );
+
+    __GSLOGSTRING("[GSCallPlugin] <--ShowOwnImageVtCallSettingPageL");
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1064 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Call folder
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "GSCallPluginContainer.h"  //for CGSCallPluginContainer
+#include "GsLogger.h"               //for logging traces
+#include "gssettingid.h"            //for constants
+#include "GSCallPluginModel.h"      //plug-in model
+#include "GSCallPlugin.h"
+
+
+#include <aknlists.h>               //for CAknSettingStyleListBox
+#include <PsetCli.h>                //for CPsetCli
+#include <PsetSAObserver.h>         //for CPsetSAObserver
+#include <PsetCSP.h>                //for CSP features
+#include <GSCallPluginRsc.rsg>      //for resource IDs
+#include <csxhelp/cp.hlp.hrh>
+#include <featmgr.h>
+#include <bldvariant.hrh>
+#include <gslistbox.h>              //for listbox clases
+#include <aknViewAppUi.h>
+#include <eikappui.h>
+#include <gsfwviewuids.h>
+
+//LOCAL CONSTANTS
+_LIT( KGSNameOfClass, "CGSCallPluginContainer" );
+_LIT(KGSReplaceListControlChars, "\n\t\x2029");
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two phased constructor
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::ConstructL( const TRect& aRect )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::ConstructL");
+
+    __GSLOGSTRING("[CGSCallPluginContainer] Creating model...");
+    iModel = CGSCallPluginModel::NewL();
+    __GSLOGSTRING("[CGSCallPluginContainer] Model created.");
+
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+
+    __GSLOGSTRING("[CGSCallPluginContainer]--> ConstructL - Model created");
+    
+    iSsSettings = new (ELeave) RSSSettings;
+    User::LeaveIfError( iSsSettings->Open() );
+    __GSLOGSTRING("[CGSCallPluginContainer]--> ConstructL - SSSettings created & opened");
+
+    BaseConstructL( aRect,
+                    R_GS_CALL_VIEW_TITLE,
+                    R_CALL_LBX );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Destructor
+//
+// ---------------------------------------------------------------------------
+CGSCallPluginContainer::~CGSCallPluginContainer()
+    {
+    if ( iSsSettings )
+        {
+        iSsSettings->Close();
+        }
+    delete iSsSettings;
+
+        delete iClirItems;
+        delete iCWItems;
+        delete iPCTItems;
+        delete iDndItems;
+
+    if ( iStillImgValues )
+        {
+        delete iStillImgValues;
+        }
+    if ( iChangeModeItems &&
+         FeatureManager::FeatureSupported ( KFeatureIdJapanPrefixChange ) )
+        {
+        delete iChangeModeItems;
+        }
+    if ( iCallDurationItems )
+        {
+        delete iCallDurationItems;
+        }
+    if ( iLongPressCallKeyItems )
+    	{
+    	delete iLongPressCallKeyItems;
+    	}
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    if ( iOwnImageVtCallItems )
+        {
+        delete iOwnImageVtCallItems;
+        }
+    if ( iModel )
+        {
+        delete iModel;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates list box
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::ConstructListBoxL");
+
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
+        *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    iStillImgValues =  iCoeEnv->ReadDesC16ArrayResourceL(
+        R_GS_STILL_IMAGE_SETTING_PAGE_LBX );
+
+    if ( iModel->VoIPSupported() )
+        {
+        iClirItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                             R_IC_CLIR_SETTING_PAGE_LBX );
+        iCWItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                             R_IC_WAITING_SETTING_PAGE_LBX );
+        iPCTItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                             R_IC_PREFERRED_CALL_TYPE_SETTING_PAGE_LBX );
+        iDndItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                             R_IC_DND_SETTING_PAGE_LBX );
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) )
+        {
+        iChangeModeItems = iCoeEnv->ReadDesC16ArrayResourceL(
+            R_GS_REPLACE_PREFIX_SETTING_PAGE_LBX );
+        }
+
+    iCallDurationItems = iCoeEnv->ReadDesC16ArrayResourceL(
+            R_GS_SHOW_CALL_DURATION_SETTING_PAGE_LBX );
+    
+    iLongPressCallKeyItems = iCoeEnv->ReadDesC16ArrayResourceL(
+            R_GS_LONG_PRESS_CALL_SETTING_PAGE_LBX );
+            
+    iOwnImageVtCallItems = iCoeEnv->ReadDesC16ArrayResourceL(
+            R_GS_OWN_IMAGE_VT_CALL_SETTING_PAGE_LBX );
+            
+    CreateListBoxItemsL();
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::ConstructListBoxL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates List box items
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::CreateListBoxItemsL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::CreateListBoxItemsL");
+// do not get check CSP if not using WINS
+#ifndef __WINS__
+    //Set CSP on, if it is not already
+    if ( !iModel->GetCSPStatus() )
+        {
+        iModel->SetCSPActiveL( ETrue );
+        }
+#endif //__WINS__
+
+    //create slide settings items
+    if ( iModel->SlideSettingsShownL() )
+        {
+        MakeSlideSettingsItem( EGSOpeningSlideAnswerCallItemId );
+        MakeSlideSettingsItem( EGSClosingSlideEndCallItemId );
+        }
+    
+    //Create own number sending, call waiting soft-reject items and ccbs
+    MakeONSItemL();
+    MakeCWItemL();
+
+    if ( iModel->VoIPSupported() )
+        {
+        MakeICClirItemL();
+        MakeICWaitingItemL();
+#ifndef RD_VOIP_REL_2_2 
+        MakeICPreferredCallTypeItemL();
+#endif // !RD_VOIP_REL_2_2
+        MakeDndItemL();
+        }
+
+
+    MakeSoftRejectTxtItemL();
+
+    if ( FeatureManager::FeatureSupported(
+                                 KFeatureIdCsVideoTelephony ) )
+        {
+        MakeStillImageItemL(); //Still Image item
+        MakeOwnImageVtCallItemL(); //VT call own image mute item
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) )
+        {
+        MakeReplacePrefixItemL();
+        }
+
+    // Create on/off settings
+    MakeCallItemL( KGSSettIdSummaryAfterCall );
+    
+    //Create line in use
+    TInt als = ESSSettingsAlsNotSupported;
+    TInt alsError = iSsSettings->Get( ESSSettingsAls, als );
+
+    if ( als != ESSSettingsAlsNotSupported && alsError == KErrNone )
+        {
+        MakePLUItemL( als );
+
+        //Create Line blocking
+        TInt alsBlock = ESSSettingsAlsBlockingNotSupported;
+        alsError = iSsSettings->Get( ESSSettingsAlsBlocking, alsBlock );
+        if ( alsBlock != ESSSettingsAlsBlockingNotSupported &&
+             alsError == KErrNone )
+            {
+            MakePLBItemL( alsBlock );
+            }
+        }
+    MakeCallDurationItemL();
+    
+  #ifdef RD_VT_LONG_SEND_KEY
+    MakeLongPressCallKeyItemL();
+  #endif
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::CreateListBoxItemsL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Updates list box with a changed item
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::UpdateListBoxL( TInt aFeatureId, TInt aNewValue )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::UpdateListBoxL");
+    switch( aFeatureId )
+        {
+        case EGSOpeningSlideAnswerCallItemId:
+        case EGSClosingSlideEndCallItemId:
+            if ( iModel->SlideSettingsShownL() )
+                {
+                MakeSlideSettingsItem( aFeatureId );
+                }
+            break;
+        case EGSCliItemId:
+            MakeONSItemL();
+            break;
+//        case EGSCCBSItemId:
+        case EGSCallWaitingItemId:
+            return; //CW and CCBS does not have a value => no need to update
+        case EGSICSendIntCallIdItemId:
+            if ( iModel->VoIPSupported() )
+                {
+              MakeICClirItemL();
+                }
+            break;
+        case EGSICWaitingItemId:
+            if ( iModel->VoIPSupported() )
+                {
+              MakeICWaitingItemL();
+                }
+            break;
+        case EGSICPreferredTelephonyId:
+            if ( iModel->VoIPSupported() )
+                {
+              MakeICPreferredCallTypeItemL();
+                }
+            break;
+        case EGSDndItemId:
+            if ( iModel->VoIPSupported() )
+                {
+              MakeDndItemL();
+                }
+            break;
+        case EGSSummaryAfterCallItemId:
+            MakeCallItemL( KGSSettIdSummaryAfterCall );
+            break;
+        case EGSALSBlockItemId:
+            MakePLBItemL( aNewValue );
+            break;
+        case EGSLineChangeItemId:
+            MakePLUItemL( aNewValue );
+            break;
+
+        case EGSSoftRejectTextItemId:
+            MakeSoftRejectTxtItemL();
+            break;
+        case EGSStillImageItemId:
+            if ( FeatureManager::FeatureSupported(
+                                 KFeatureIdCsVideoTelephony ) )
+                {
+                MakeStillImageItemL();
+                }
+            break;
+        case EGSReplacePrefixItemId:
+            if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) )
+                {
+                MakeReplacePrefixItemL();
+                }
+                break;
+        case EGSShowCallDurationItemId:
+            MakeCallDurationItemL();
+            break;
+        case EGSLongPressCallKeyItemId:
+		#ifdef RD_VT_LONG_SEND_KEY 
+   			MakeLongPressCallKeyItemL();
+		#endif
+    		break;
+        case EGSOwnImageVtCallItemId:
+            if ( FeatureManager::FeatureSupported(
+                                 KFeatureIdCsVideoTelephony ) )
+                {
+                MakeOwnImageVtCallItemL();
+                }
+            break;
+        default:
+            Panic( KGSNameOfClass, EInvalidIndex );
+            break;
+        }
+
+    //iListBox->HandleItemAdditionL();
+    iListBox->DrawDeferred();
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::UpdateListBoxL");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Creates StillImage list item.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::MakeStillImageItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeStillImageItemL");
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+    
+    TInt dialogSelection = EGSVtStillImageNotInUse;
+    if ( iModel->VTStillImageL() )
+        dialogSelection = EGSVtStillImageInUse;
+    ptrBuffer = (*iStillImgValues)[ dialogSelection ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSStillImageItemId, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSStillImageItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeStillImageItemL");
+    }
+
+
+
+// ---------------------------------------------------------------------------
+//
+// Creates OwnNumberSending list item.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::MakeONSItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeONSItemL");
+    HBufC16* dynamicText = NULL;
+
+    TInt clir = ESSSettingsClirNetworkDefault;
+    //to allow emulator usage without phone, do not retrieve values.
+    TInt err = iSsSettings->Get( ESSSettingsClir, clir );
+    __GSLOGSTRING2("[CGSCallPluginContainer]    MakeONSItemL: clir: %d, Error: %d", clir, err);
+    if ( err != KErrNone )
+        {
+        return;
+        }
+
+    switch( clir )
+        {
+        case ESSSettingsClirExplicitSuppress:
+            dynamicText = StringLoader::LoadL( R_CLI_SENDING_ON );
+            break;
+        case ESSSettingsClirExplicitInvoke:
+            dynamicText = StringLoader::LoadL( R_CLI_SENDING_OFF );
+            break;
+        default:
+            if ( iModel->RestrictedSendCallerIdSupportedL() )
+                {
+                //set initially to ON if restricted CLIR is supported
+                dynamicText = StringLoader::LoadL( R_CLI_SENDING_ON );
+                TInt err = iSsSettings->Set( 
+                    ESSSettingsClir, ESSSettingsClirExplicitSuppress );
+                if ( err != KErrNone )
+                    {
+                    delete dynamicText;
+                    return;
+                    }
+                }
+            else
+                {
+                dynamicText = StringLoader::LoadL( R_CLI_SENDING_DEFAULT );
+                }
+            break;
+        }
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSCliItemId, *dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSCliItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    delete dynamicText;
+    dynamicText = NULL;
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeONSItemL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates CallWaiting list item.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::MakeCWItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeCWItemL");
+#ifndef __WINS__
+    //Create call waiting
+    if ( iModel->IsSettingSupported( EGSCSPCallWaiting ) )
+        {
+#endif //__WINS__
+    iListboxItemArray->SetItemVisibilityL( EGSCallWaitingItemId,
+        CGSListBoxItemTextArray::EVisible );
+#ifndef __WINS__
+        }
+#endif //__WINS__
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeCWItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPluginContainer::MakeICClirItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeICClirItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeICClirItemL");
+    TInt value( KErrNone );
+    iModel->GetVoIPCallSettingValue( EGSVoIPSendIntCallId, value );
+
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    ptrBuffer = ( *iClirItems )[ value ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSICSendIntCallIdItemId, ptrBuffer );
+
+    iListboxItemArray->SetItemVisibilityL( EGSICSendIntCallIdItemId, 
+      CGSListBoxItemTextArray::EVisible );
+
+    CleanupStack::PopAndDestroy( dynamicText );
+    
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeICClirItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPluginContainer::MakeICWaitingItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeICWaitingItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeICWaitingItemL");
+    TInt value( KErrNone );
+    iModel->GetVoIPCallSettingValue( EGSVoIPCW, value );
+    
+    // Swap items because of different order.
+    if ( value == EGSCSCallWaitingOff )
+        {
+        value = EGSCSCallWaitingOn;
+        }
+    else
+        {
+        value = EGSCSCallWaitingOff;
+        }
+
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    ptrBuffer = ( *iCWItems )[ value ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSICWaitingItemId, ptrBuffer );
+    iListboxItemArray->SetItemVisibilityL( EGSICWaitingItemId, 
+        CGSListBoxItemTextArray::EVisible );
+    
+    CleanupStack::PopAndDestroy( dynamicText );
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeICWaitingItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPluginContainer::MakeICPreferredCallTypeItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeICPreferredCallTypeItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeICPreferredCallTypeItemL");
+    TInt value( KErrNone );
+    iModel->GetVoIPCallSettingValue( EGSVoIPPreType, value );
+    
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    ptrBuffer = ( *iPCTItems )[ value ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSICPreferredTelephonyId, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    iListboxItemArray->SetItemVisibilityL( EGSICPreferredTelephonyId,
+      CGSListBoxItemTextArray::EVisible );
+
+  __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeICPreferredCallTypeItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPluginContainer::MakeDndItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeDndItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeDndItemL");
+    TInt value( KErrNone );
+    iModel->GetVoIPCallSettingValue( EGSVoIPDnd, value );
+    
+    // Swap items because of different order.
+    if ( value == EGSCSCallDndOff )
+        {
+        value = EGSCSCallDndOn;
+        }
+    else
+        {
+        value = EGSCSCallDndOff;
+        }
+
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    ptrBuffer = ( *iDndItems )[ value ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSDndItemId, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    iListboxItemArray->SetItemVisibilityL( EGSDndItemId,
+      CGSListBoxItemTextArray::EVisible );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeDndItemL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates PhoneLineInUse list item.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::MakePLUItemL( TInt& aAlsValue )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakePLUItemL");
+
+    if ( aAlsValue == ESSSettingsAlsNotSupported )
+        {
+        iListboxItemArray->SetItemVisibilityL( EGSLineChangeItemId,
+                           CGSListBoxItemTextArray::EInvisible );
+        
+        __GSLOGSTRING("[CGSCallPluginContainer] <--MakePLUItemL:AlsNotSupported");
+        return;
+        }
+
+    HBufC* dynamicText = NULL;
+    
+    if ( aAlsValue == ESSSettingsAlsAlternate )
+        {
+        dynamicText = StringLoader::LoadL( R_ALS_LINE2 );
+        }
+    else
+        {
+        dynamicText = StringLoader::LoadL( R_ALS_LINE1 );
+        }
+
+    // for A&H number conversion
+    TPtr bufPtr = dynamicText->Des();
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion( bufPtr );
+
+    iListboxItemArray->SetDynamicTextL( EGSLineChangeItemId, *dynamicText );
+
+    // Add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSLineChangeItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    delete dynamicText;
+    dynamicText = NULL;
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakePLUItemL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates PhoneLineBlocking list item. No item is created, if service is not
+// supported.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::MakePLBItemL( TInt& aAlsBlockValue )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakePLBItemL");
+    HBufC* dynamicText = NULL;
+
+    if ( aAlsBlockValue == ESSSettingsAlsBlockingOn )
+        {
+        dynamicText = StringLoader::LoadL( R_ALS_LINE_BLOCKING_ON );
+        }
+    else
+        {
+        dynamicText = StringLoader::LoadL( R_ALS_LINE_BLOCKING_OFF );
+        }
+
+    iListboxItemArray->SetDynamicTextL( EGSALSBlockItemId, *dynamicText );
+
+    // Add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSALSBlockItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    delete dynamicText;
+    dynamicText = NULL;
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakePLBItemL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates Speed Dialing, Anykey Answer, Summary After Call
+// and Automatic redial items.
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::MakeCallItemL( TInt aIndex )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeCallItemL");
+    HBufC* settingOn  = NULL;
+    HBufC* settingOff = NULL;
+    TInt value = KGSSettingOff; //default is OFF for all
+    TInt settingItem = 0;
+    TBool ok = ETrue;
+
+    TCallSettId keyName = EGSNotSet;
+
+    switch ( aIndex )
+        {
+        case KGSSettIdSummaryAfterCall:
+            keyName = EGSSummaryAfterCall;
+            settingItem = EGSSummaryAfterCallItemId;
+            settingOn = StringLoader::LoadLC( R_CALL_TERMINATION_NOTE_ON );
+            settingOff = StringLoader::LoadLC( R_CALL_TERMINATION_NOTE_OFF );
+            break;
+        default:
+            Panic( KGSNameOfClass, EInvalidIndex );
+            break;
+        }
+
+    if( ok ) //if everything is ok so far
+        {
+        iModel->GetCallSettingValue( keyName, value );
+        __GSLOGSTRING1("[CGSCallPluginContainer]    MakeCallItemL: value: %d", value);
+
+        // Finally, set the dynamic text
+        if ( value == KGSSettingOn )
+            {
+            iListboxItemArray->SetDynamicTextL( settingItem, settingOn->Des() );
+            }
+        else
+            {
+            iListboxItemArray->SetDynamicTextL( settingItem, settingOff->Des() );
+            }
+
+        CleanupStack::PopAndDestroy( 2 ); //settingOn, settingOff
+
+        // And add to listbox
+        iListboxItemArray->SetItemVisibilityL( settingItem,
+            CGSListBoxItemTextArray::EVisible );
+        }
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeCallItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const
+// Gets Help
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::GetHelpContext");
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KSCP_HLP_CALL;
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::GetHelpContext");
+    }
+
+// ---------------------------------------------------------------------------
+// Creates Call Completion When Busy Subscriber item.
+//
+// ---------------------------------------------------------------------------
+//
+/*
+void CGSCallPluginContainer::MakeCCBSItemL()
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdPhoneCcbs ) )
+        {
+        iListboxItemArray->SetItemVisibilityL( EGSCCBSItemId,
+            CGSListBoxItemTextArray::EVisible );
+        }
+    }
+*/
+
+// ---------------------------------------------------------------------------
+// CGSCallPluginContainer::CurrentFeatureId()
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSCallPluginContainer::CurrentFeatureId( ) const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates Soft reject text item.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeSoftRejectTxtItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeSoftRejectTxtItemL");
+    HBufC* dynamicText = HBufC::NewLC( KGSSMSTxtEditorLength );
+    TPtr string( dynamicText->Des() );
+    string.Zero();
+
+    GetSoftRejectTextL( string );
+    if ( string.Length() == 0 )
+        {
+        string = KGSEmptySpace;
+        }
+
+
+    AknTextUtils::ReplaceCharacters( string, KGSReplaceListControlChars, 
+                                                                  TChar(' ') );
+                                                                  
+    iListboxItemArray->SetDynamicTextL( EGSSoftRejectTextItemId, string );
+
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    iListboxItemArray->SetItemVisibilityL( EGSSoftRejectTextItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeSoftRejectTxtItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value to the Soft Reject Txt.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::GetSoftRejectTextL( TDes& aSoftRejectTxt )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::GetSoftRejectTextL");
+    TInt value = KGSSettingOff;
+
+    TCallSettId keyName = EGSSoftRejectDefault;
+    iModel->GetCallSettingValue( keyName, value );
+
+    if ( value == KGSSettingOff )
+        {
+        HBufC* defaultText = ReadFromResourceL( R_SOFT_REJECT_DEFAULT_TXT );
+        CleanupStack::PushL( defaultText );
+        aSoftRejectTxt = *defaultText;
+        CleanupStack::PopAndDestroy(); //defaultText
+        }
+    else
+        {
+        TGSSMSTextEditor softRejectTxt;
+        iModel->GetSoftRejectText( softRejectTxt );
+        aSoftRejectTxt = softRejectTxt;
+        }
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::GetSoftRejectTextL");
+    }
+
+// ---------------------------------------------------------
+// CGSCallPluginContainer::ReadFromResourceL
+// ---------------------------------------------------------
+//
+HBufC* CGSCallPluginContainer::ReadFromResourceL(
+        TInt aResourceId )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::ReadFromResourceL");
+    // Find the resource file
+    RConeResourceLoader loader( *iCoeEnv );
+    TParse parse;
+    parse.Set( KGSSoftRejectResource, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+
+    // Open resource file
+    TInt err = loader.Open( fileName );
+    if ( err == KErrNotFound )
+        {
+        return NULL;
+        }
+
+    CleanupClosePushL( loader );
+    HBufC* result = StringLoader::LoadL( aResourceId );
+    CleanupStack::PopAndDestroy(); //loader & it is closed also.
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::ReadFromResourceL");
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// Creates Replace Prefix list box item.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeReplacePrefixItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> MakeReplacePrefixItemL");
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    const TInt changeMode = iModel->PrefixChangeModeL();
+    ptrBuffer = ( *iChangeModeItems )[ changeMode ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSReplacePrefixItemId, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSReplacePrefixItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--MakeReplacePrefixItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// Creates Show Call Duration list box item.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeCallDurationItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> MakeCallDurationItemL");
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    const TInt duration = iModel->CallDurationL();
+    ptrBuffer = ( *iCallDurationItems )[ duration ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSShowCallDurationItemId, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSShowCallDurationItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--MakeCallDurationItemL");
+    }
+
+// ---------------------------------------------------------------------------
+// Creates Long Press Call Key list box items.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeLongPressCallKeyItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> MakeLongPressCallKeyItemL");
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    TInt statusLongPressCallKey = iModel->LongPressCallKeyL();
+	// Here we again decrement by 1 so that values resemble appropriate title 
+	// EGSLongPressCallKeyVoiceCall  ------> InActive in GS
+	// EGSLongPressCallKeyVideoCall  ------> Video Call in GS
+	// Refer to GSCallPlugin.hrh file for more info for the  description
+	iModel->MapLongPressKeyCallKeyValue( statusLongPressCallKey );
+   	ptrBuffer = ( *iLongPressCallKeyItems )[ statusLongPressCallKey ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSLongPressCallKeyItemId, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSLongPressCallKeyItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--MakeLongPressCallKeyItemL");
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginContainer::MakeOwnImageVtCallItemL
+// 
+// Own image mute status on video call
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::MakeOwnImageVtCallItemL()
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> MakeOwnImageVtCallItemL");
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    TInt statusOwnImageVtCallKey = iModel->OwnImageVtCallStatusL();
+   	ptrBuffer = ( *iOwnImageVtCallItems )[ statusOwnImageVtCallKey ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSOwnImageVtCallItemId, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSOwnImageVtCallItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    __GSLOGSTRING("[CGSCallPluginContainer] <--MakeOwnImageVtCallItemL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets observer for MSK label updations.
+// ---------------------------------------------------------------------------
+//
+void CGSCallPluginContainer::SetMiddleSoftkeyObserver( 
+    MGsFWMSKObserver* aObserver )
+    {
+    if ( !iMSKObserver && aObserver )
+        {        
+        iMSKObserver = aObserver;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSCallPluginContainer::OfferKeyEventL
+// Called when a key is pressed.
+// ---------------------------------------------------------------------------
+TKeyResponse CGSCallPluginContainer::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent, 
+    TEventCode aType )
+    {
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyUpArrow:
+        case EKeyDownArrow:
+            {            
+            TKeyResponse listboxResp = 
+                iListBox->OfferKeyEventL( aKeyEvent, aType );
+            if ( iMSKObserver )
+                {                
+                iMSKObserver->CheckMiddleSoftkeyLabelL();
+                }
+            return listboxResp;
+            }        
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+            // Listbox takes all events even if it doesn't use them
+            return EKeyWasNotConsumed;
+        default:
+            break;
+        }
+    
+    return iListBox->OfferKeyEventL( aKeyEvent, aType ); 
+    }
+
+// ---------------------------------------------------------------------------
+//
+// CGSCallPluginContainer::MakeSlideSettingsItem
+// Create a slide settings item ( "Opening slide to answer call" or "Closing slide to end call" ) 
+//
+// ---------------------------------------------------------------------------
+void CGSCallPluginContainer::MakeSlideSettingsItem( TInt aItemId )
+    {
+    __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeSlideSettingsItem");
+    
+    HBufC* settingValue = NULL;
+    TInt   value(0);
+    
+    switch ( aItemId )
+        {
+        case EGSOpeningSlideAnswerCallItemId:           
+            iModel->GetCallSettingValue( EGSOpeningSlideAnswerCall,value );
+            if ( EGSOpeningSlideAnswerCallOn == value )
+                {
+                settingValue = StringLoader::LoadLC
+                    ( R_CP_SETTING_OPENING_SLIDE_ANSWER );
+                }
+            else
+                {
+                settingValue = StringLoader::LoadLC
+                    ( R_CP_SETTING_OPENING_SLIDE_NOT_ANSWER );
+                }                                    
+            break;
+        case EGSClosingSlideEndCallItemId:
+            iModel->GetCallSettingValue( EGSClosingSlideEndCall,value );
+            if ( EGSClosingSlideEndCallOn == value )
+                {
+                settingValue = StringLoader::LoadLC
+                    ( R_CP_SETTING_CLOSING_SLIDE_END );
+                }
+            else 
+                {
+                settingValue = StringLoader::LoadLC
+                    ( R_CP_SETTING_CLOSING_SLIDE_NOT_END );
+                }
+            break;
+        default:
+            Panic( KGSNameOfClass, EInvalidIndex );
+        }
+    
+    iListboxItemArray->SetDynamicTextL( aItemId,settingValue->Des() );
+    
+    CleanupStack::PopAndDestroy( settingValue );
+    
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL
+        ( aItemId,CGSListBoxItemTextArray::EVisible );
+    
+    __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeSlideSettingsItem");
+    }
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSCallPlugin.h"
+
+// Constants
+const TImplementationProxy KGSCallPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x102824A2,	CGSCallPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSCallPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSCallPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,758 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Model/Engine for Call Settings Plugin
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSCallPluginModel.h"
+#include "GsLogger.h"      //for logging traces
+#include "SettingsPrivateCRKeys.h"
+
+#include <barsc.h>
+#include <barsread.h>
+#include <coecntrl.h>
+#include <f32file.h>
+#include <AknQueryDialog.h>
+#include <s32file.h>
+#include <featmgr.h>
+#include <PsetCSP.h>
+#include <generalsettingsvariant.hrh>
+#include <PSVariables.h>  //PubSub 
+#include <settingsinternalcrkeys.h>
+#include <LogsDomainCRKeys.h>
+
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+#include <spsettings.h>
+#endif // __VOIP && RD_VOIP_REL_2_2
+//CONSTANTS
+// default value for autolock period
+// default value for Sat operations
+
+_LIT( KGSNameOfClass, "CGSCallPluginModel" );
+
+// Max int size
+
+//for switching values in SwitchValue()
+const TInt KGSSettingOff = 0;
+const TInt KGSSettingOn = 1;
+const TInt KGSIndexOff = 1;
+const TInt KGSIndexOn = 0;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::NewL
+// 
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSCallPluginModel* CGSCallPluginModel::NewL()
+    {
+    CGSCallPluginModel* self = new( ELeave ) CGSCallPluginModel;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::CGSCallPluginModel
+// 
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CGSCallPluginModel::CGSCallPluginModel()
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::ConstructL
+// 
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+
+    InitializeCentralRepositoryL();
+
+    iBackgroundApi = CGSBackgroundImage::NewL();
+
+    SetCSPActiveL( ETrue );
+
+    User::LeaveIfError( iGSVariationRepository->Get( 
+                        KSettingsVariationFlags, iLocalVariationValues ) );
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+	iSpSettings = CSPSettings::NewL();  
+#endif // __VOIP && RD_VOIP_REL_2_2
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::~CGSCallPluginModel
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSCallPluginModel::~CGSCallPluginModel()
+    {
+    FeatureManager::UnInitializeLib();
+	UninitializeCentralRepository();
+    
+    if ( GetCSPStatus() )
+        {
+        TRAP_IGNORE( SetCSPActiveL( EFalse ) );
+        }
+    
+    if ( iBackgroundApi )
+        {
+        delete iBackgroundApi;
+        }
+    
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+    delete iSpSettings;
+#endif // __VOIP && RD_VOIP_REL_2_2
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::InitializeCentralRepositoryL
+//
+// Creating and setting keys for the Central Repository
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::InitializeCentralRepositoryL()
+    {
+    iTelephonyRepository = CRepository::NewL( KCRUidTelephonySettings );
+    iCommonTelephonyRepository = 
+            CRepository::NewL( KCRUidCommonTelephonySettings );
+    iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation );
+    iRichCallRepository = CRepository::NewL( KCRUidRichCallSettings );
+    iLogsRepository = CRepository::NewL( KCRUidLogs );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::UninitializeCentralRepositoryL
+//
+// Removes Central Repository objects
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::UninitializeCentralRepository()
+    {
+    if ( iTelephonyRepository )
+        {
+        delete iTelephonyRepository;
+        iTelephonyRepository = NULL;
+        }
+    if ( iCommonTelephonyRepository )
+        {
+        delete iCommonTelephonyRepository;
+        iCommonTelephonyRepository = NULL;
+        }
+    if ( iGSVariationRepository )
+        {
+        delete iGSVariationRepository;
+        iGSVariationRepository = NULL;
+        }
+    if ( iRichCallRepository )
+        {
+        delete iRichCallRepository;
+        iRichCallRepository = NULL;
+        }
+    if ( iLogsRepository )
+        {
+        delete iLogsRepository;
+        iLogsRepository = NULL;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::GetCallSettingValue
+// Gets one of the call related values (anykey answer, automatic redial,
+// summary after call or one key dialing) from Central Repository (Working OK)
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::GetCallSettingValue( const TCallSettId aCallId,
+                                            TInt& aId )
+    {
+    TInt ret = KErrNone;
+    if ( aCallId == EGSSummaryAfterCall )
+        {
+        ret = 
+            iCommonTelephonyRepository->Get( KSettingsSummaryAfterCall, aId );
+        }
+    else
+        {        
+        switch ( aCallId )
+            {     
+            case EGSOpeningSlideAnswerCall:
+                ret = iTelephonyRepository->
+                    Get( KSettingsOpeningSlideAnswer, aId );
+                break;
+            case EGSClosingSlideEndCall:
+                ret = iTelephonyRepository->
+                    Get( KSettingsClosingSlideEnd, aId );
+                break;            
+            case EGSSoftRejectDefault:
+                ret = iTelephonyRepository->
+                   Get( KSettingsSoftRejectDefaultInUse, aId );
+                break;
+            default:
+                break;
+            };
+        }
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetCallSettingValue
+// Sets one of the call related values (anykey answer, automatic redial,
+// summary after call or one key dialing) from Central Repository (working OK)
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::SetCallSettingValue( const TCallSettId aCallId,
+                                            TInt aId )
+    {
+    TInt ret = KErrNone;
+    if ( aCallId == EGSSummaryAfterCall )
+        {
+        ret = 
+            iCommonTelephonyRepository->Set( KSettingsSummaryAfterCall, aId );
+        }
+    else
+        {
+        switch ( aCallId )
+            {
+            case EGSOpeningSlideAnswerCall:
+                ret = iTelephonyRepository->
+                    Set( KSettingsOpeningSlideAnswer, aId );
+                break;
+            case EGSClosingSlideEndCall:
+                ret = iTelephonyRepository->
+                    Set( KSettingsClosingSlideEnd, aId );
+                break;    
+            case EGSSoftRejectDefault:
+                ret = iTelephonyRepository->
+                    Set( KSettingsSoftRejectDefaultInUse, aId );
+                break;
+            default:
+                break;
+            };
+        }
+        
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::GetCSPStatus
+// 
+// Get Customer Service Profile status
+// ----------------------------------------------------------------------------
+//
+TBool CGSCallPluginModel::GetCSPStatus()
+    {
+    if ( iCSP )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }    
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetCSPActiveL
+// 
+// Set Customer Service Profile active
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SetCSPActiveL( TBool aValue )
+    {
+    if ( aValue )
+        {
+        iCSP = CPsetCustomerServiceProfile::NewL();
+        User::LeaveIfError( iCSP->OpenCSProfileL() );
+        }
+    else
+        {        
+        delete iCSP;
+        iCSP = NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::IsSettingSupported
+// 
+// Check if a given setting is supported
+// ----------------------------------------------------------------------------
+//
+TBool CGSCallPluginModel::IsSettingSupported( TInt aSettingNumber )
+    {
+    __ASSERT_ALWAYS( iCSP != NULL, User::Panic( KGSNameOfClass, 
+                                   EGSCallPluinModelPanicNullPtr ) );
+    TBool settingSupported = EFalse;
+    TInt retVal = KErrNone;
+
+    switch ( aSettingNumber )
+        {
+        case EGSCSPCallWaiting:
+            retVal = iCSP->IsCWSupported( settingSupported );
+            break;
+        case EGSCSPAlternateLine:
+            retVal = iCSP->IsALSSupported( settingSupported );
+            break;
+        default:
+            break;
+        }
+    if ( retVal != KErrNone )
+        {
+        //if a CSP error occurs, by default service is available
+        settingSupported = ETrue;
+        }
+
+    return settingSupported;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::GetSoftRejectText
+// Gets soft reject text from shared data.
+// ----------------------------------------------------------------------------
+//
+TBool CGSCallPluginModel::GetSoftRejectText( TDes& aText )
+    {
+    TInt ret = iTelephonyRepository->Get( KSettingsSoftRejectText, aText );
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetSoftRejectText
+// Sets user defined text to shared data for soft reject.
+// ----------------------------------------------------------------------------
+//
+TBool CGSCallPluginModel::SetSoftRejectText( TDes& aText )
+    {
+    TInt ret = iTelephonyRepository->Set( KSettingsSoftRejectText, aText );
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::VTStillImageL
+// 
+// VT Still Image mode.
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::VTStillImageL()
+    {
+    TInt StImg = KGSSettingOff;
+    
+    User::LeaveIfError( iTelephonyRepository->Get( KSettingsVTStillImage, 
+                                                   StImg ) );
+    return StImg;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetVTStillImageL
+// 
+// Sets VT Still Image mode to Shared Data
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SetVTStillImageL( const TInt aValue )
+    {
+    User::LeaveIfError( iTelephonyRepository->Set( KSettingsVTStillImage, 
+                                                   aValue ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::PrefixChangeModeL
+// 
+// Get the Japanese prefix change mode value from shared data.
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::PrefixChangeModeL()
+    {
+    TInt mode = KGSSettingOff;
+    User::LeaveIfError( iTelephonyRepository->
+                Get( KSettingsDialPrefixChangeMode, mode ) );
+    SwitchValue( mode );
+    return mode;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetPrefixChangeModeL
+// 
+// Set the Japanese prefix change mode value to shared data. CenRep OK
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SetPrefixChangeModeL( TInt aMode )
+    {
+    SwitchValue( aMode );
+    User::LeaveIfError( iTelephonyRepository->
+                Set( KSettingsDialPrefixChangeMode, aMode ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::PrefixChangeDataL
+// 
+// Reads prefix change text from shared data and returns it
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::PrefixChangeDataL( TDes& aText )
+    {
+    User::LeaveIfError( iTelephonyRepository->
+                Get( KSettingsDialPrefixText, aText ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetPrefixChangeDataL
+// 
+// Writes prefix change text to shared data
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SetPrefixChangeDataL( const TDesC& aText )
+    {
+    User::LeaveIfError( iTelephonyRepository->
+                Set( KSettingsDialPrefixText, aText ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SwitchValue
+// 
+// Switching value from 1 to 0 and back
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SwitchValue( TInt& aValue )
+    {
+    switch( aValue )   
+        {
+        case KGSSettingOff: //0
+            aValue = KGSIndexOff; //1
+            break;
+        case KGSSettingOn: //1
+            aValue = KGSIndexOn; //0
+            break;
+        default:
+            aValue = KErrNotFound;
+        };
+    }
+
+
+// ---------------------------------------------------------
+// CGSCallPluginModel::RestrictedSendCallerIdSupportedL
+// 
+// Check if Restricted Send Caller ID is supported.
+// ---------------------------------------------------------
+//
+TBool CGSCallPluginModel::RestrictedSendCallerIdSupportedL()
+    {
+    TBool supported = EFalse;    
+
+    if ( iLocalVariationValues & EGSConfigRestrictedSendCallerId )
+        {
+        supported = ETrue;
+        }
+
+    return supported;
+
+    }
+
+// ---------------------------------------------------------
+// CGSCallPluginModel::SecureSendCallerIdSupportedL
+// 
+// Check if Secure Send Caller ID is supported.
+// ---------------------------------------------------------
+//
+TBool CGSCallPluginModel::SecureSendCallerIdSupportedL()
+    {
+    TBool supported = EFalse;    
+
+    if ( iLocalVariationValues & EGSConfigSecureSendCallerId )
+        {
+        supported = ETrue;
+        }
+
+    return supported;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::GetVoIPCallSettingValue
+// Gets one of the VoIP call related values (send my Int. call id, 
+// Internet call waiting, preferred call type, do not disturb or 
+// Internet call barring) from Central Repository
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::GetVoIPCallSettingValue( 
+    const TGSVoIPSetting aVoipSettingId, TInt& aVoipId ) 
+    {
+    TInt ret( KErrNone );
+   
+    switch ( aVoipSettingId )
+        {
+        case EGSVoIPSendIntCallId:
+            ret = iRichCallRepository->Get( KRCSEClir, aVoipId );
+            break;
+        case EGSVoIPCW:
+            ret = iRichCallRepository->Get( KRCSPSCallWaiting, aVoipId );
+            break;
+        case EGSVoIPPreType:
+            ret = iRichCallRepository->Get( KRCSEPreferredTelephony, aVoipId );
+            break;
+        case EGSVoIPDnd:
+            ret = iRichCallRepository->Get( KRCSEDoNotDisturb, aVoipId );
+            break;
+        case EGSVoIPBarring:
+            ret = iRichCallRepository->Get( KRCSEAnonymousCallBlockRule, aVoipId );
+            break;
+        default:
+            break;
+        }
+    
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetVoIPCallSettingValue
+// Sets one of the VoIP call related values (send my Int. call id, 
+// Internet call waiting, preferred call type, do not disturb or 
+// Internet call barring) from Central Repository
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::SetVoIPCallSettingValue( 
+    const TGSVoIPSetting aVoipSettingId, TInt aVoipId )
+    {
+    TInt ret( KErrNone );
+    
+    switch( aVoipSettingId )
+        {
+        case EGSVoIPSendIntCallId:
+            ret = iRichCallRepository->Set( KRCSEClir, aVoipId );
+            break;
+        case EGSVoIPCW:
+            ret = iRichCallRepository->Set( KRCSPSCallWaiting, aVoipId );
+            break;
+        case EGSVoIPPreType:
+            ret = iRichCallRepository->Set( KRCSEPreferredTelephony, aVoipId );
+            break;
+        case EGSVoIPDnd:
+            ret = iRichCallRepository->Set( KRCSEDoNotDisturb, aVoipId );
+            break;
+        case EGSVoIPBarring:
+            ret = iRichCallRepository->Set( KRCSEAnonymousCallBlockRule, aVoipId );
+            break;
+        default:
+            break;
+        }
+        
+    return ret;    
+    }
+    
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::GetSCCPStatus
+// Gets SCCP status from Central Repository
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::GetSCCPStatus( TInt& aStatus )
+    {
+    TInt ret( KErrNone );
+    ret = iTelephonyRepository->Get( KSCCPinstallUpgrade, aStatus );
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::CallDurationL
+// 
+// Get the Call duration setting value
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::CallDurationL()
+    {
+    TInt value = KGSSettingOff;
+    User::LeaveIfError( iLogsRepository->
+                Get( KLogsShowCallDuration, value ) );
+    
+	SwitchValue ( value );
+
+    return value;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetCallDurationL
+// 
+// Set the Call duration setting value
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SetCallDurationL( TInt aValue )
+    {
+    SwitchValue ( aValue );
+    User::LeaveIfError( iLogsRepository->
+                Set( KLogsShowCallDuration, aValue ) );
+    }
+
+// ---------------------------------------------------------
+// CGSTelPluginModel::VoIPSupported
+// 
+// Check if VoIP is supported.
+// ---------------------------------------------------------
+//    
+TBool CGSCallPluginModel::VoIPSupported()
+    {
+    TInt supported( KGSSettingOff );
+#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
+    if ( iSpSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
+        iSpSettings->IsFeatureSupported( ESupportVoIPSSFeature ) )
+        {
+        supported = KGSSettingOn;
+        }
+#else // __VOIP && RD_VOIP_REL_2_2
+    if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        iTelephonyRepository->Get( KDynamicVoIP, supported );
+        }
+#endif // __VOIP && RD_VOIP_REL_2_2
+    return KGSSettingOff != supported;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::LongPressCallKeyL
+// 
+// Get the Long Press Call Key setting value
+// 0,1 --> Inactive (Default value is 1 and when RFS Default value is 0) 
+// 2 --> Video call
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::LongPressCallKeyL()
+    {
+    TInt value = EGSLongPressCallKeyVoiceCall;
+  #ifdef RD_VT_LONG_SEND_KEY
+    User::LeaveIfError( iTelephonyRepository->
+                Get( KSettingsUiLongCallKeyPress, value ) );
+  #endif
+    return value;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetLongPressCallKeyL
+// 
+// Set the Long Press Call Key setting value
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SetLongPressCallKeyL( const TInt aValue )
+    {
+#ifdef RD_VT_LONG_SEND_KEY
+    User::LeaveIfError( iTelephonyRepository->
+                Set( KSettingsUiLongCallKeyPress, aValue ) );
+#endif
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::MapLongPressKeyCallKeyValue
+// 
+// Maps the Long Press Call Key setting value
+// NOTE : EGSLongPressCallKeyVoiceCall is the default value normally
+// NOTE: When Restore Factory Settings is done, the default value 
+//       is set to EGSLongPressCallKeyInActive
+// Three key values are used for a CenRep key though we have two
+// two setting items because these values are also been used by
+// CallUi and Phone Application.
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::MapLongPressKeyCallKeyValue( TInt &aValue )
+    {
+#ifdef RD_VT_LONG_SEND_KEY
+  	switch ( aValue )
+  		{
+  		case EGSLongPressCallKeyVoiceCall:
+  			 aValue = EGSLongPressCallKeyNotSet;
+  			 break;
+  		case EGSLongPressCallKeyVideoCall:
+  		     aValue = EGSLongPressCallKeyVoiceCall;
+  			 break;
+  		default:
+  			 break;
+  		}
+#endif
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::OwnImageVtCallStatusL
+// 
+// Get the Own Image sending during vt call setting value
+// 0,1 --> Inactive (Default value is 1 and when RFS Default value is 0) 
+// 2 --> Video call
+// ----------------------------------------------------------------------------
+//
+TInt CGSCallPluginModel::OwnImageVtCallStatusL()
+    {
+    TInt value;
+    User::LeaveIfError( iTelephonyRepository->
+                Get( KSettingsVTVideoSending, value ) );
+    return value;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SetOwnImageVtCallStatusL
+// 
+// Set the Long Press Call Key setting value
+// ----------------------------------------------------------------------------
+//
+void CGSCallPluginModel::SetOwnImageVtCallStatusL( const TInt aValue )
+    {
+    User::LeaveIfError( iTelephonyRepository->
+                Set( KSettingsVTVideoSending, aValue ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSCallPluginModel::SlideSettingsShown
+// 
+// Check if slide settings items should be shown
+// ----------------------------------------------------------------------------
+//
+TBool CGSCallPluginModel::SlideSettingsShownL() const
+    {
+    TInt value( EGSNotShowSlideSettings );
+    
+    User::LeaveIfError( 
+            iTelephonyRepository->Get( KSettingsShowSlideSettings,value ) );
+
+    if ( EGSShowSlideSettings == value )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/GSConPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Project specification file.
+*
+*/
+
+#include            <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsconplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10207251
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSConPluginImplementationTable.cpp
+SOURCE              GSConPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         ../Logger
+USERINCLUDE         ../Data
+USERINCLUDE         loc
+
+SYSTEMINCLUDE       /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+START RESOURCE      10207251.rss
+TARGET              gsconplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSConPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+LIBRARY             euser.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib 
+LIBRARY             cone.lib 
+LIBRARY             eikcoctl.lib 
+LIBRARY             eikcore.lib 
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             gsframework.lib
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             flogger.lib // For GSLogger
+LIBRARY             gsecomplugin.lib
+LIBRARY             featmgr.lib  // feature manager
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10207251.rss
+DOCUMENT            GSConPluginRsc.rss
+
+SOURCEPATH          inc
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSConPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSConPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsconplugin.iby )
+../rom/GSConPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsconpluginresources.iby )
+loc/GSConPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsconplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsconplugin.mif
+  OPTION HEADERFILE gsconplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_conn
+END
+
+
+PRJ_MMPFILES
+GSConPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSConPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/data/10207251.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSConPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10207251;
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10207250;
+					version_no          = 1;
+					display_name        = "Connection Settings Plugin"; // Debug name
+					default_data        = "0x1020723B";// Parent UID
+					#ifdef RD_CONTROL_PANEL
+					    opaque_data         = "50";// Order number
+					#else //RD_CONTROL_PANEL
+					    opaque_data         = "2";// Order number
+					#endif //RD_CONTROL_PANEL
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/data/GSConPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSConPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        GSCO // 4 letter ID
+
+// INCLUDES
+#include    <gsconplugin.loc>
+
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_con_view
+//    Connection settings view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_con_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_con_view_title
+//    Connection settings view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_con_view_title
+    {
+    #ifdef RD_CONTROL_PANEL
+        txt = qtn_cp_title_connectivity;
+    #else //RD_CONTROL_PANEL
+        txt = qtn_set_title_settings_inet;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+//----------------------------------------------------
+//
+//  r_gs_con_view_caption
+//  Connection Plugin caption for plugin
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_con_view_caption
+    {
+    #ifdef RD_CONTROL_PANEL
+        buf = qtn_cp_folder_connectivity;
+    #else //RD_CONTROL_PANEL
+        buf = qtn_set_folder_connection;
+    #endif //RD_CONTROL_PANEL
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/inc/GSConPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for GSConPlugin.
+*
+*/
+
+#ifndef GSCONPLUGIN_H
+#define GSCONPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <eikmenup.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+class CGulIcon;
+class CGSTabHelper;
+
+// Constants
+_LIT( KGSConPluginResourceFileName, "z:GSConPluginRsc.rsc" );
+_LIT( KGSConPluginIconDirAndName, "z:GSConPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+
+/**
+*  CGSConPlugin.
+*
+*  @since Series60_3.1
+*/
+class CGSConPlugin : public CGSParentPlugin
+    {
+
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSConPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSConPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        TGSListboxTypes ListBoxType();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+            
+
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSConPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+
+        // Tab helper.
+        CGSTabHelper* iTabHelper;
+    };
+
+
+#endif // GSCONPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/loc/GSConPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSConPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Plugin caption
+//d:Long string
+//l:title_pane_t2/opt9
+//w:
+//r: 3.1
+//
+#define qtn_set_title_settings_inet "Connection settings"
+
+//d:Text of a list item in main view's folder list
+//d:Item opens Connection folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_folder_connection "Connection"
+
+
+// **OPTIONS MENU
+
+//d:Command in Options list
+//d:Opens the highlighted item
+//l:list_single_pane_t1_cp2
+//w:
+//r: 3.1
+//
+#define qtn_set_options_open "Open"
+
+
+//CONTROL PANEL
+
+//d:Plugin caption
+//l: title_pane_t2/opt9
+//w:
+//r: 5.0
+//
+#define qtn_cp_title_connectivity "Connectivity"
+
+//d:Text of a list item in main view's folder list
+//d:Item opens Connection folder
+//l: list_single_large_graphic_pane_t1
+//w:
+//r: 5.0
+//
+#define qtn_cp_folder_connectivity "Connectivity"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/src/GSConPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,286 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSConPlugin implementation.
+*
+*/
+
+
+// Includes
+#include "GSConPlugin.h"
+#include "GsLogger.h"
+
+#include <gsconplugin.mbg> // Icons
+#include <GSConPluginRsc.rsg>
+#include <gsfwviewuids.h>
+#include <gsmainview.h>
+#include <gsplugininterface.h>
+#include <gsprivatepluginproviderids.h>
+#include <data_caging_path_literals.hrh>
+#include <aknViewAppUi.h>
+#include <barsread.h> // For TResourceReader
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <csxhelp/cp.hlp.hrh>
+#include <featmgr.h>
+#include <eikbtgpc.h>
+
+#ifndef RD_CONTROL_PANEL
+    #include <GSTabHelper.h>
+#endif //RD_CONTROL_PANEL
+
+// Constants
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::CGSConPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSConPlugin::CGSConPlugin()
+    : CGSParentPlugin(), iResources( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSConPlugin] CGSConPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::~CGSConPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSConPlugin::~CGSConPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    iResources.Close();
+
+    #ifndef RD_CONTROL_PANEL
+        delete iTabHelper;
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSConPlugin] ~CGSConPlugin()" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSConPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSConPlugin] ConstructL()" );
+    FeatureManager::InitializeLibL();
+    OpenLocalizedResourceFileL( KGSConPluginResourceFileName, iResources );
+    BaseConstructL( R_GS_CON_VIEW, R_GS_CON_VIEW_TITLE );
+
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper = CGSTabHelper::NewL();
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSConPlugin* CGSConPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    __GSLOGSTRING( "[CGSConPlugin] NewL()" );
+
+    CGSConPlugin* self = new(ELeave) CGSConPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSConPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSConPlugin] Id():0x%X", KGSConPluginUid.iUid );
+    return KGSConPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSConPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                TUid aCustomMessageId,
+                                const TDesC8& aCustomMessage )
+    {
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+
+    #ifndef RD_CONTROL_PANEL
+        // Create tab group for this view (do only if casting parent succeeds):
+        if( parent )
+            {
+            iTabHelper->CreateTabGroupL( Id(), parent );
+            }
+    #endif //RD_CONTROL_PANEL
+    
+		// If AppUid is different or placeholderview is used, this view has been launched from outside GS
+		if ( iPrevViewId.iAppUid != KUidGS || iPrevViewId.iViewUid == TUid::Uid(0x0DEADBED ) )
+			{
+			CEikButtonGroupContainer* cbaGroup = Cba();
+			if(cbaGroup)
+				{
+				HBufC* rightSKText = StringLoader::LoadLC (R_GS_CBA_EXIT);
+				TPtr rskPtr = rightSKText->Des();
+				cbaGroup->SetCommandL(2,EAknSoftkeyExit,*rightSKText);
+				CleanupStack::PopAndDestroy(rightSKText);
+				}
+		}
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+void CGSConPlugin::DoDeactivate()
+    {
+    CGSParentPlugin::DoDeactivate();
+
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper->RemoveTabGroup();
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSConPlugin::UpperLevelViewUid()
+    {
+    return KGSMainViewUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSConPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // The resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_CON_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSConPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSConPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSConPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_CONNECTIVITY;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::CreateIconL
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CGSConPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSConPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpConn,
+        fp->FullName(),
+        EMbmGsconpluginQgn_prop_cp_conn,
+        EMbmGsconpluginQgn_prop_cp_conn_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSConPlugin::ListBoxType()
+//
+// ---------------------------------------------------------------------------
+//
+TGSListboxTypes CGSConPlugin::ListBoxType()
+    {
+    return EGSListBoxTypeDoubleLarge;
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSConPlugin/src/GSConPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSConPlugin.h"
+
+// Constants
+const TImplementationProxy KGSConPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10207250,	CGSConPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSConPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSConPluginImplementationTable;
+	}
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Data/10207437.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Data Call Settings plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x10207437;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x10207436;
+                    version_no          = 1;
+                    display_name        = "Data Call Settings Plugin";
+                    #ifdef RD_CONTROL_PANEL
+                        default_data        = "0x10283341";
+                        opaque_data         = "20";//Order number
+                    #else //RD_CONTROL_PANEL
+                        default_data        = "0x10207250";
+                        opaque_data         = "110";//Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+        };
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Data/GsDataCallPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,239 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GsDataCallPlugin
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    DCAL // 4 letter ID
+
+//  INCLUDES
+#include    "GsDataCallPlugin.hrh"
+#include    <gsdatacallplugin.loc>
+
+#include    <gs.loc>
+#include    <gscommon.rh>
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+RESOURCE TBUF
+    {
+    buf="DCAL";
+    }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+
+//----------------------------------------------------
+//  r_gs_datacall_view_caption
+//
+// Data call view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_datacall_view_caption
+    {
+    buf = qtn_set_folder_conn_data_call;
+    }
+
+
+// ** DATA CALL (CONNECTION) VIEW
+
+//----------------------------------------------------
+//
+//    r_gs_csd_view_title
+//    Data call view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_csd_view_title
+    {
+    txt = qtn_set_title_settings_csd;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_dcall_view
+//    Data call view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_dcall_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_dcall_lbx
+//    Data call view's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_dcall_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_set_autodiscon"\t\t";
+            item = KGSSettIdAutodiscon;
+            }
+        };
+    }
+
+
+
+// AUTODISCONNECT TIME
+
+//----------------------------------------------------
+//
+//    r_autodiscon_time_setting_page
+//    Autodisconnect setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_autodiscon_time_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_autodiscon;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_autodiscon_time_setting_page_lbx
+//    Autodisconnect setting page's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_autodiscon_time_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_autodiscon_defined;
+            },
+        LBUF
+            {
+            txt = qtn_set_autodiscon_no;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_autodiscon_time_value_no
+//    Text resource for autodisconnect setting.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_autodiscon_value_no
+    {
+    buf = qtn_set_autodiscon_no;
+    }
+
+//----------------------------------------------------
+//
+//    r_autodiscon_time_value_1min
+//    Text resource for autodisconnect setting.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_autodiscon_value_1min
+    {
+    buf = qtn_set_autodiscon_one_min;
+    }
+
+//----------------------------------------------------
+//
+//    r_autodiscon_time_value_min
+//    Text resource for autodisconnect setting.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_autodiscon_value_min
+    {
+    buf = qtn_set_autodiscon_min;
+    }
+
+//----------------------------------------------------
+//
+//    r_autodiscon_time_number_query
+//    Autodisconnect time query.
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_autodiscon_time_number_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = ENumberLayout;
+                label = qtn_set_autodiscon_define_time;
+                control = AVKON_INTEGER_EDWIN
+                    {
+                    min = 0;
+                    max = 99;
+                    maxlength = 2;
+                    };
+                };
+            }
+        };
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/GSDataCallPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file.
+*
+*/
+
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsdatacallplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10207437
+VENDORID            VID_DEFAULT
+
+
+SOURCEPATH  Src
+SOURCE      GSDataCallPluginImplementationTable.cpp
+SOURCE      GSDataCallPluginContainer.cpp
+SOURCE      GSDataCallPlugin.cpp
+SOURCE      GSDataCallPluginModel.cpp
+
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Data // For CommonResources.rss
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  10207437.rss
+TARGET          gsdatacallplugin.rsc
+END
+
+START RESOURCE  GsDataCallPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   cone.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   egul.lib
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   commdb.lib
+
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   flogger.lib // For GSLogger
+LIBRARY   gsecomplugin.lib
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Data call settings.
+*
+*/
+
+
+#ifndef GSDATACALLPLUGIN_H
+#define GSDATACALLPLUGIN_H
+
+// INCLUDES
+#include <aknsettingpage.h>
+#include <gsbaseview.h>
+#include <ConeResLoader.h>
+#include <gsplugininterface.h>
+
+
+//CONSTANTS
+const TUid KGSDataCallPluginUid = { 0x10207436 };
+_LIT( KGSDataCallPluginIconDirAndName, "z:GSDataCallPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CAknViewAppUi;
+class CGSDataCallPluginContainer;
+class CGSDataCallPluginModel;
+
+// CLASS DEFINITION
+/**
+*  CGSDataCallPlugin view class for data call settings
+*  @since Series 60_3.1
+*
+*/
+class CGSDataCallPlugin : public CGSBaseView,
+                          public MAknSettingPageObserver
+    {
+    public:
+        enum TGSSettingIds
+            {
+            KGSAutodisconSettingId
+            };
+
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS connection view.
+        */
+        static CGSDataCallPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor
+        */
+        ~CGSDataCallPlugin();
+
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    public: // from MAknSettingPageObserver
+
+        /**
+        * Handle setting page events
+        */
+        virtual void HandleSettingPageEventL( CAknSettingPage* aSettingPage,
+                                            TAknSettingPageEvent aEventType );
+
+    public: // from base classes
+
+        /**
+        * Returns view id.
+        * @return TUid
+        */
+        TUid Id() const;
+
+        /**
+        * Handles commands.
+        * @param aCommand Command to be handled.
+        *
+        */
+        void HandleCommandL( TInt aCommand );
+
+    public: // new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aItemId An item which is updated.
+        *
+        */
+        void UpdateListBoxL( TInt aItemId );
+
+        /**
+        * Get CGSDataCallPlugin's ccontainer.
+        */
+        CGSDataCallPluginContainer* Container();
+
+    protected: // From CAknView
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        void DoDeactivate();
+    
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CGSDataCallPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        *
+        */
+        void ConstructL();
+
+        void HandleClientRectChange();
+
+    private: // from CGSBaseView
+
+        void NewContainerL();
+        void HandleListBoxSelectionL();
+
+    private: // new methods
+
+        /**
+        * Display dialup auto disconnect setting page.
+        */
+        void ShowDialupAutodisconSettingPageL();
+
+        /**
+        * Display auto disconnect time query dialog.
+        */
+        void ShowAutodisconTimeQueryL();
+
+    private:
+        // plugin model
+        CGSDataCallPluginModel *iModel;
+        // resource loader
+        RConeResourceLoader iResourceLoader;
+
+    };
+
+#endif //GSDATACALLPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Data call settings view.
+*
+*/
+
+
+#ifndef GSDATACALLPLUGINCONTAINER_H
+#define GSDATACALLPLUGINCONTAINER_H
+
+// INCLUDES
+#include <bldvariant.hrh>
+#include <gsbasecontainer.h>
+
+#include "gssettingid.h"
+
+// FORWARD DECLARATION
+class CGSListBoxItemTextArray;
+
+// CLASS DECLARATION
+
+/**
+*  CGSDataCallPluginContainer container class
+*  @since Series 60_3.1
+* 
+*/
+class CGSDataCallPluginContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS constructor.
+        * @param aRect Listbox's rect.
+        * 
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CGSDataCallPluginContainer();
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aFeatureId An item which is updated.
+        * 
+        */
+        void UpdateListBoxL( TInt aFeatureId );
+
+        /**
+        * Retrieves the currently selected listbox feature id
+        * @return feature id.
+        */
+        TInt CurrentFeatureId() const;
+
+    protected: // from CGSBaseContainer
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private: // new
+        void CreateListBoxItemsL();
+        void MakeAutodisconItemL();
+    
+    private:
+        /**
+        * Required for help.
+        * 
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+    
+    private: // data
+        //Auto disconnect list item
+        CDesCArrayFlat* iAutodisconValue;
+        //Listbox item array model
+        CGSListBoxItemTextArray* iListboxItemArray;
+        
+    };
+
+#endif //GSDATACALLPLUGINCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Data Call Settings model.
+*
+*/
+
+
+#ifndef GSDATACALLPLUGINMODEL_H
+#define GSDATACALLPLUGINMODEL_H
+
+// INCLUDES
+#include <cdblen.h>
+#include <e32base.h>
+
+// CONSTANTS
+// autodisconnect time unlimited
+const   TUint   KGSTimeUnlimited = KMaxTUint;
+// autodisconnect time 0 minutes
+const   TInt    KGSZeroMinutes = 0;
+// autodisconnect time 1 minute
+const   TInt    KGSOneMinute = 1;
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CCommsDatabase;
+class CCommsDbTableView;
+
+// CLASS DEFINITION
+/**
+*  CGSDataCallPluginModel is the model class of GS display plugin.
+*  It provides functions to get and set setting values.
+*  @lib GSDisplayPlugin.lib
+*  @since Series 60_3.1
+
+*/
+class CGSDataCallPluginModel : public CBase
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CGSDataCallPluginModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSDataCallPluginModel();
+
+    public: // new ones
+
+        /**
+        * Returns the period after the data call is disconnected
+        * if it has been unused.
+        * @return Minutes between 0 and 99.
+        */
+        TInt AutodisconnectTimeL();
+
+        /**
+        * Sets the period after the data call is disconnected
+        * if it has been unused.
+        * @param aTime Autodisconnect time (minutes).
+        * @return ETrue: no errors
+        *         EFalse: an error has occurred
+        */
+        TBool SetAutodisconnectTimeL( const TInt aTime );
+
+    private: // Private constructors
+        /**
+        * Default C++ contructor
+        */
+        CGSDataCallPluginModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+
+    private:
+        //handle to CommsDB
+        CCommsDatabase* iCommDb;
+
+    };
+
+#endif //GSDATACALLPLUGINMODEL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GsDataCallPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains common definitions for menu id:s
+*
+*/
+
+
+#ifndef GSDATACALLPLUGIN_HRH
+#define GSDATACALLPLUGIN_HRH
+
+// commands
+enum TGSDataCallMenuCommands
+    {
+    EAppCmdChange = 1
+    };
+    
+    
+enum TSettingId
+    {
+    KGSSettIdAutodiscon
+    };
+
+#endif //  GSDATACALLPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,483 @@
+/*
+* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Data call sub-folder
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSDataCallPlugin.h"
+#include "GSDataCallPluginModel.h"
+#include "GSDataCallPluginContainer.h"
+#include "GsDataCallPlugin.hrh"
+#include <gsdatacallplugin.mbg> // Icons
+#include <GsDataCallPluginRsc.rsg>
+#include <gsfwviewuids.h>
+#include <gsprivatepluginproviderids.h>
+
+#include <AknQueryDialog.h>
+#include <aknradiobuttonsettingpage.h>
+#include <aknViewAppUi.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <bautils.h>
+#include <coeaui.h>
+#include <eikfrlbd.h>
+#include <gulicon.h>
+#include <hlplch.h>             // For HlpLauncher
+
+#include <gscommon.hrh>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+const TInt KGSAutodTimeIndex = 0;
+
+_LIT( KGSDataCallPluginResourceFileName, "z:GSDataCallPluginRsc.rsc" );
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::CGSDataCallPlugin()
+//
+// Constructor
+// ----------------------------------------------------------------------------
+//
+CGSDataCallPlugin::CGSDataCallPlugin()
+  : iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::NewL()
+//
+// Symbian OS default constructor
+// ---------------------------------------------------------------------------
+CGSDataCallPlugin* CGSDataCallPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSDataCallPlugin* self = new( ELeave ) CGSDataCallPlugin ();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::ConstructL()
+//
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------------------------
+void CGSDataCallPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    // Find the resource file
+    TParse parse;
+    parse.Set( KGSDataCallPluginResourceFileName,
+               &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+
+    // Open resource file
+    iResourceLoader.OpenL( fileName );
+
+    iModel = CGSDataCallPluginModel::NewL();
+
+    BaseConstructL( R_GS_DCALL_VIEW );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::~CGSDataCallPlugin
+//
+// Destructor
+// ----------------------------------------------------------------------------
+CGSDataCallPlugin::~CGSDataCallPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    iResourceLoader.Close();
+    if ( iModel )
+        {
+        delete iModel;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSDataCallPlugin::Id()
+//
+// Returns view's ID.
+// ---------------------------------------------------------------------------
+TUid CGSDataCallPlugin::Id() const
+    {
+    return KGSDataCallPluginUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::GetCaption
+//
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_DATACALL_VIEW_CAPTION );
+
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::PluginProviderCategory
+//
+// A means to identify the location of this plug-in in the framework.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDataCallPlugin::PluginProviderCategory() const
+    {
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::Visible
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSDataCallPlugin::Visible() const
+    {
+    TBool visible = EFalse;
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdAppCsdSupport ) )
+        {
+        visible = ETrue;
+        }
+
+    return visible;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::HandleCommandL(TInt aCommand)
+//
+// Handles commands directed to this class.
+// ---------------------------------------------------------------------------
+void CGSDataCallPlugin::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EGSMSKCmdAppChange:
+        case EGSCmdAppChange:
+            HandleListBoxSelectionL();
+            break;
+        case EAknSoftkeyBack:
+            #ifdef RD_CONTROL_PANEL
+                iAppUi->ActivateLocalViewL( KGSAdminPluginUid );
+            #else //RD_CONTROL_PANEL
+                iAppUi->ActivateLocalViewL( KGSConPluginUid );
+            #endif //RD_CONTROL_PANEL
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::UpdateListBoxL
+//
+// Updates listbox items.
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::UpdateListBoxL( TInt aItemId )
+    {
+    if( Container() )
+        {
+        Container()->UpdateListBoxL( aItemId );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::Container
+//
+// Return handle to container class.
+// ----------------------------------------------------------------------------
+//
+CGSDataCallPluginContainer* CGSDataCallPlugin::Container()
+    {
+    return static_cast<CGSDataCallPluginContainer*>( iContainer );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::NewContainerL()
+//
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::NewContainerL()
+    {
+    iContainer = new( ELeave ) CGSDataCallPluginContainer;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::DoActivateL
+//
+// First method called by the Avkon framwork to invoke a view.
+// ----------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                     TUid aCustomMessageId,
+                                     const TDesC8& aCustomMessage )
+    {
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPlugin::DoDeactivate
+//
+// Called by the Avkon view framework when closing.
+// ----------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::DoDeactivate()
+    {
+    CGSBaseView::DoDeactivate();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::HandleListBoxSelectionL()
+//
+// Handles events raised through a rocker key.
+// ---------------------------------------------------------------------------
+void CGSDataCallPlugin::HandleListBoxSelectionL()
+    {
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+
+    switch ( currentFeatureId )
+        {
+        case KGSSettIdAutodiscon:
+            ShowDialupAutodisconSettingPageL();
+            break;
+       default:
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::HandleSettingPageEventL
+//
+// Handle any setting page related events
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::HandleSettingPageEventL( CAknSettingPage* aSettingPage,
+                                              TAknSettingPageEvent aEventType )
+    {
+    TInt settingId = aSettingPage->SettingId();
+
+    if ( aEventType == EEventSettingOked )
+        {
+        TInt current;
+
+        switch ( settingId )
+            {
+            case KGSAutodisconSettingId:
+                current =
+                  static_cast<CAknRadioButtonSettingPage*> ( aSettingPage )->
+                    ListBoxControl()->CurrentItemIndex();
+                if ( current == KGSAutodTimeIndex )
+                    {
+                    ShowAutodisconTimeQueryL();
+                    }
+                break;
+            default:
+                break;
+            }
+        }
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::ShowDialupAutodisconSettingPageL
+//
+// Display dialup auto disconnect setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::ShowDialupAutodisconSettingPageL()
+    {
+    TInt value = iModel->AutodisconnectTimeL();
+    TInt currentValue = 0; // magic number (user defined)
+
+    if ( value == static_cast<TInt> ( KGSTimeUnlimited ) )
+        {
+        currentValue = 1;  // magic number (unlimited)
+        }
+
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                                     R_AUTODISCON_TIME_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage(
+                                      R_AUTODISCON_TIME_SETTING_PAGE,
+                                      currentValue, items );
+
+    dlg->SetSettingId( KGSAutodisconSettingId );
+    dlg->SetSettingPageObserver( this );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        if ( currentValue == 1 )  // magic number (unlimited)
+            {
+            iModel->SetAutodisconnectTimeL( KGSTimeUnlimited );
+            }
+
+        UpdateListBoxL( KGSSettIdAutodiscon );
+        }
+
+    CleanupStack::PopAndDestroy( items );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPlugin::ShowAutodisconTimeQueryL()
+//
+// Display auto disconnect time query dialog.
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::ShowAutodisconTimeQueryL()
+    {
+    TInt time = iModel->AutodisconnectTimeL();
+    if ( time == static_cast<TInt> ( KGSTimeUnlimited ) )
+        {
+        time = KGSZeroMinutes;
+        }
+
+    CAknNumberQueryDialog* dlg = new( ELeave ) CAknNumberQueryDialog( time );
+    dlg->PrepareLC( R_AUTODISCON_TIME_NUMBER_QUERY );    
+    CAknQueryControl *ctrl = ( CAknQueryControl* )dlg->Control( EGeneralQuery ); 
+    CEikEdwin *edwin = ( CEikEdwin* )ctrl->ControlByLayoutOrNull( ENumberLayout );
+    edwin->SetAknEditorNumericKeymap( EAknEditorPlainNumberModeKeymap );
+    
+    if( dlg->RunLD() )
+        {
+        if ( time == KGSZeroMinutes )
+            {
+            time = static_cast<TInt> ( KGSTimeUnlimited );
+            }
+
+        iModel->SetAutodisconnectTimeL( time );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDataCallPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSDataCallPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSDataCallPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetConnData,
+        fp->FullName(),
+        EMbmGsdatacallpluginQgn_prop_set_conn_data,
+        EMbmGsdatacallpluginQgn_prop_set_conn_data_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDataCallPlugin::DynInitMenuPaneL()
+//
+// dynamically handle help item if not supported
+// -----------------------------------------------------------------------------
+//
+void CGSDataCallPlugin::DynInitMenuPaneL( TInt aResourceId, 
+                                          CEikMenuPane* aMenuPane )
+    {   
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+        
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ))
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Data sub-folder
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSDataCallPluginContainer.h"
+#include "GSDataCallPluginModel.h"
+#include "GsDataCallPlugin.hrh"
+
+#include <bldvariant.hrh>
+#include <GsDataCallPluginRsc.rsg>
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <AknUtils.h>
+#include <conset.hlp.hrh>
+#include <gsfwviewuids.h>
+#include <gslistbox.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::ConstructL()
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPluginContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new( ELeave ) CAknSettingStyleListBox;
+    
+    BaseConstructL( aRect, R_GS_CSD_VIEW_TITLE, R_DCALL_LBX );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::~CGSDataCallPluginContainer()
+// 
+// Destructor 
+// ---------------------------------------------------------------------------
+//
+CGSDataCallPluginContainer::~CGSDataCallPluginContainer()
+    {
+    delete iAutodisconValue;
+    delete iListboxItemArray;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::ConstructListBoxL()
+// 
+// Construct the listbox from resource array.
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, 
+                                                 *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+
+    CreateListBoxItemsL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::CreateListBoxItemsL()
+// 
+// Create listbox items.
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPluginContainer::CreateListBoxItemsL()
+    {
+    MakeAutodisconItemL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::UpdateListBoxL()
+// 
+// Update listbox item.
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPluginContainer::UpdateListBoxL( TInt aFeatureId )
+    {
+    switch( aFeatureId )
+        {
+        case KGSSettIdAutodiscon:
+            MakeAutodisconItemL();
+            break;
+        default:
+            break;
+        }
+
+    iListBox->HandleItemAdditionL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::MakeAutodisconItemL()
+// 
+// Create auto disconnect list item 
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPluginContainer::MakeAutodisconItemL()
+    {
+    CGSDataCallPluginModel* model = CGSDataCallPluginModel::NewL();    
+    
+    TInt time = model->AutodisconnectTimeL();    
+    delete model;
+    
+    HBufC* buf = NULL;
+    
+    switch( time )
+        {
+        case KGSTimeUnlimited:
+            buf = iEikonEnv->AllocReadResourceL( R_AUTODISCON_VALUE_NO );            
+            break;
+        case KGSOneMinute:
+            {
+            buf = iEikonEnv->AllocReadResourceL( R_AUTODISCON_VALUE_1MIN );
+            // for A&H number conversion
+            TPtr bufPtr( buf->Des() );
+            if( AknTextUtils::DigitModeQuery( 
+                              AknTextUtils::EDigitModeShownToUser ) )
+                {
+                AknTextUtils::LanguageSpecificNumberConversion( bufPtr );
+                }
+            }
+            break;
+        default:
+            buf = StringLoader::LoadL( R_AUTODISCON_VALUE_MIN, 
+                                       time, iEikonEnv );
+            break;
+        }
+
+    TPtr bufPtr( buf->Des() );
+    iListboxItemArray->SetDynamicTextL( KGSSettIdAutodiscon, bufPtr );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( KGSSettIdAutodiscon, 
+        CGSListBoxItemTextArray::EVisible );
+
+
+    delete buf;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::GetHelpContext() const
+//  
+// Gets Help 
+// ---------------------------------------------------------------------------
+//
+void CGSDataCallPluginContainer::GetHelpContext( 
+                                 TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KSET_HLP_CONNEC_DATA;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDataCallPluginContainer::CurrentFeatureId()
+//
+// Return the feature id of selected listitem  
+// ---------------------------------------------------------------------------
+//
+TInt CGSDataCallPluginContainer::CurrentFeatureId( ) const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSDataCallPlugin
+*
+*/
+
+
+// INCLUDES
+#include "GSDataCallPlugin.h"
+
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// CONSTANTS
+const TImplementationProxy KGSDataCallPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10207436,	CGSDataCallPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSDataCallPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSDataCallPluginImplementationTable;
+	}
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Data Call Settings model implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSDataCallPluginModel.h"
+
+#include <commdb.h>
+#include <cdbcols.h>
+
+#include <settingsinternalcrkeys.h>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+// Autodisconnect time
+const TUint8 KGSOneSecond = 1;
+const TUint8 KGSSecondsInMinute = 60;
+const TUint  KGSMaxTimeInSeconds = 5940;
+//const TUint8 KGSMaxTimeInMinutes = 99;
+
+_LIT( KGSCSDModem, "CSD Modem" );
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS =================================
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPluginModel::NewL
+//
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSDataCallPluginModel* CGSDataCallPluginModel::NewL()
+    {
+    CGSDataCallPluginModel* self = new( ELeave ) CGSDataCallPluginModel;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPluginModel::CGSDataCallPluginModel
+//
+//
+// C++ default constructor can NOT contain any code, that might leave.
+// ----------------------------------------------------------------------------
+//
+CGSDataCallPluginModel::CGSDataCallPluginModel()
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPluginModel::ConstructL
+//
+// Symbian OS default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSDataCallPluginModel::ConstructL()
+    {
+    iCommDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPluginModel::~CGSDataCallPluginModel
+//
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSDataCallPluginModel::~CGSDataCallPluginModel()
+    {
+    delete iCommDb;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPluginModel::AutodisconnectTimeL
+//
+// Gets autodisconnect time.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDataCallPluginModel::AutodisconnectTimeL()
+    {
+    CCommsDbTableView* table = iCommDb->OpenViewMatchingTextLC(
+        TPtrC( MODEM_BEARER ),
+        TPtrC( COMMDB_NAME ), KGSCSDModem );
+
+    User::LeaveIfError(  table->GotoFirstRecord() );
+
+    TUint32 timeOutValue = 0;
+    table->ReadUintL( TPtrC( LAST_SOCKET_ACTIVITY_TIMEOUT ), timeOutValue );
+    CleanupStack::PopAndDestroy( table );
+
+    TInt timeInMinutes;
+
+    if ( timeOutValue < KGSOneSecond )
+        {
+        timeInMinutes = static_cast<TInt> ( KGSTimeUnlimited );
+
+        if ( timeOutValue != KGSTimeUnlimited )
+            {
+            SetAutodisconnectTimeL( KGSTimeUnlimited );
+            }
+        }
+    else if ( timeOutValue < KGSSecondsInMinute )
+        {
+        timeInMinutes = KGSOneMinute;
+        }
+    else if ( timeOutValue < KGSMaxTimeInSeconds )
+        {
+        timeInMinutes = timeOutValue/KGSSecondsInMinute;
+        }
+    else
+        {
+        timeInMinutes = static_cast<TInt> ( KGSTimeUnlimited );
+        }
+    return  timeInMinutes;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDataCallPluginModel::SetAutodisconnectTimeL
+//
+// Sets autodisconnect time.
+// ----------------------------------------------------------------------------
+//
+TBool CGSDataCallPluginModel::SetAutodisconnectTimeL( const TInt aTime )
+    {
+    TInt time;
+
+    if ( aTime >= KGSOneMinute )
+        {
+        time = aTime * KGSSecondsInMinute;
+        }
+    else
+        {
+        time = static_cast<TInt> ( KGSTimeUnlimited );
+        }
+
+    CCommsDbTableView* table = iCommDb->OpenViewMatchingTextLC(
+        TPtrC( MODEM_BEARER ),
+        TPtrC( COMMDB_NAME ), KGSCSDModem );
+
+    User::LeaveIfError( table->GotoFirstRecord() );
+    User::LeaveIfError( table->UpdateRecord() );
+    table->WriteUintL( TPtrC( LAST_SOCKET_ACTIVITY_TIMEOUT ), time );
+    table->WriteUintL( TPtrC( LAST_SOCKET_CLOSED_TIMEOUT ), time );
+    User::LeaveIfError( table->PutRecordChanges() );
+    CleanupStack::PopAndDestroy( table );
+
+    return ETrue;
+    }
+
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSDataCallPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSDataCallPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsdatacallplugin.iby )
+../rom/GSDataCallPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsdatacallpluginresources.iby )
+loc/GSDataCallPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsdatacallplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsdatacallplugin.mif
+  OPTION HEADERFILE gsdatacallplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_conn_data
+END
+
+
+PRJ_MMPFILES
+GSDataCallPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSDataCallPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDataCallPlugin/loc/GSDataCallPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSDataCallPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// NEW
+
+//d:Text of a list item in Connection view's folder list
+//d:Item opens Data Call folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_folder_conn_data_call "Data call"
+
+
+// **DATA CALL (CONNECTION) VIEW
+
+//d:Text in title pane
+//d:Data call setting list view
+//l:title_pane_t2/opt9
+//w:
+//r: 3.1
+//
+#define qtn_set_title_settings_csd "Data call"
+
+//d:Text of a list item in Data call setting list view's list
+//d:Item opens Autodisconnect time setting page
+//l:list_setting_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_autodiscon "Autodisconnect time"
+
+
+// AUTODISCONNECT TIME
+
+//d:Item in Autodisconnect time setting page's list
+//d:Setting value User defined
+//l:list_set_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_autodiscon_defined "User defined" 
+
+//d:Text in setting list item's current value field
+//d:Autodisconnect time list item
+//d:Item in Autodisconnect time setting page's list
+//d:Setting value No limit or 0 min
+//l:list_set_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_autodiscon_no "No limit"
+
+//d:Promt text in Autodisconnect time number query
+//d:Data query
+//l:popup_query_data_window
+//w:
+//r: 3.1
+//
+#define qtn_set_autodiscon_define_time "Autodisconnect time (min):"
+
+//d:Text in setting list item's current value field
+//d:Autodisconnect time list item
+//d:Current value field text when current value is 1 min
+//l:list_set_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_autodiscon_one_min "1 min"
+
+//d:Text in setting list item's current value field
+//d:Autodisconnect time list item
+//d:Current value field text when current value is > 1 min
+//l:list_set_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_autodiscon_min "%N min"
+
+
+           
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/GSDeviceManagementPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDeviceManagementPlugin project specification file.
+*
+*/
+
+
+#include            <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsdevicemanagementplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10283316
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSDeviceManagementPluginImplementationTable.cpp
+SOURCE              GSDeviceManagementPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         loc
+USERINCLUDE         ../Logger
+USERINCLUDE         ../Data
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+SOURCEPATH          data
+
+START RESOURCE      10283316.rss
+TARGET              gsdevicemanagementplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSDeviceManagementPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+// Libraries
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             egul.lib // CGulIcon
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             euser.lib
+LIBRARY             flogger.lib // For GSLogger
+LIBRARY             gsframework.lib
+LIBRARY             gsecomplugin.lib
+LIBRARY             gslistbox.lib// For CGSListBoxItemTextArray
+LIBRARY             ws32.lib // For RWsSession
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10283316.rss
+DOCUMENT            GSDeviceManagementPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSDeviceManagementPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSDeviceManagementPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsdevicemanagementplugin.iby )
+../rom/GSDeviceManagementPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsdevicemanagementpluginresources.iby )
+loc/GSDeviceManagementPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsdevicemanagementplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsdevicemanagementplugin.mif
+  OPTION HEADERFILE gsdevicemanagementplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_dev_man
+END
+
+
+PRJ_MMPFILES
+GSDeviceManagementPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSDeviceManagementPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/data/10283316.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSDeviceManagementPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10283316;
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10283317;
+					version_no          = 1;
+					display_name        = "GSDeviceManagementPlugin"; // Debug name
+					default_data        = "0x10207237";// Parent UID
+					opaque_data         = "90";// Order number
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/data/GSDeviceManagementPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file GSDeviceManagementPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    DEMA // 4 letter ID
+
+//  INCLUDES
+#include    <gsdevicemanagementplugin.loc>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_devicemanagement_view
+//    Device management view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_devicemanagement_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_devicemanagement_view_title
+//    Device management view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_devicemanagement_view_title
+    {
+    txt = qtn_cp_title_device_management;
+    }
+
+
+//----------------------------------------------------
+//  r_gs_devicemanagement_view_caption
+//
+// gen view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_devicemanagement_view_caption
+    {
+    buf = qtn_cp_folder_device_management;
+    }
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/inc/GSDeviceManagementPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDeviceManagementPlugin header.
+*
+*/
+
+
+#ifndef GSDEVICEMANAGEMENTPLUGIN_H
+#define GSDEVICEMANAGEMENTPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+
+// Constants
+_LIT( KGSDeviceManagementPluginResourceFileName, "z:GSDeviceManagementPluginRsc.rsc" );
+_LIT( KGSDeviceManagementPluginIconDirAndName, "z:GSDeviceManagementPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+* CGSDeviceManagementPlugin view class.
+*
+* @since Series60_3.2
+*/
+class CGSDeviceManagementPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSDeviceManagementPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSDeviceManagementPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSDeviceManagementPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+    };
+
+
+#endif // GSDEVICEMANAGEMENTPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/loc/GSDeviceManagementPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSDeviceManagementPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Plugin title.
+//d:Long string.
+//l:title_pane_t2/opt9
+//w:
+//r:5.0
+//
+#define qtn_cp_title_device_management "Device management"
+
+//d:Plugin caption.
+//d:Used by GS FW.
+//l:list_single_large_graphic_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_cp_folder_device_management "Device management"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,247 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDeviceManagementPlugin source code.
+*
+*/
+
+
+// Includes
+#include "GSDeviceManagementPlugin.h"
+#include "GsLogger.h"
+#include <gsfwviewuids.h>
+#include <gsdevicemanagementplugin.mbg> // Icons
+#include <GSDeviceManagementPluginRsc.rsg>
+#include <gsmainview.h>
+#include <gsprivatepluginproviderids.h>
+#include <csxhelp/cp.hlp.hrh>
+
+
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <barsread.h> // For TResourceReader
+
+
+// Constants
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::CGSDeviceManagementPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSDeviceManagementPlugin::CGSDeviceManagementPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] CGSDeviceManagementPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::~CGSDeviceManagementPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSDeviceManagementPlugin::~CGSDeviceManagementPlugin()
+    {
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] ~CGSDeviceManagementPlugin()|->" );
+    iResourceLoader.Close();
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] ~CGSDeviceManagementPlugin()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDeviceManagementPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] ConstructL()|->" );
+    OpenLocalizedResourceFileL( KGSDeviceManagementPluginResourceFileName,
+                                iResourceLoader );
+    BaseConstructL( R_GS_DEVICEMANAGEMENT_VIEW, R_GS_DEVICEMANAGEMENT_VIEW_TITLE );
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] ConstructL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSDeviceManagementPlugin* CGSDeviceManagementPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] NewL()" );
+
+    CGSDeviceManagementPlugin* self = new(ELeave) CGSDeviceManagementPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSDeviceManagementPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSDeviceManagementPlugin] Id():0x%X", KGSDeviceManagementPluginUid.iUid );
+    return KGSDeviceManagementPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDeviceManagementPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoActivateL()|->" );
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+
+    // Create tab group for this view (do only if casting parent succeeds):
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoActivateL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDeviceManagementPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoDeactivate()|->" );
+    CGSParentPlugin::DoDeactivate();
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoDeactivate()-|" );
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSDeviceManagementPlugin::UpperLevelViewUid()
+    {
+    return KGSGenPluginUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDeviceManagementPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] GetCaptionL()|->" );
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_DEVICEMANAGEMENT_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    __GSLOGSTRING( "[CGSDeviceManagementPlugin] GetCaptionL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSDeviceManagementPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDeviceManagementPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_DEVICE_MANAGEMENT;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDeviceManagementPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSDeviceManagementPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSDeviceManagementPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpDevMan,
+        fp->FullName(),
+        EMbmGsdevicemanagementpluginQgn_prop_cp_dev_man,
+        EMbmGsdevicemanagementpluginQgn_prop_cp_dev_man_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSDeviceManagementPlugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSDeviceManagementPlugin.h"
+
+// Constants
+const TImplementationProxy KGSDeviceManagementPluginImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10283317,	CGSDeviceManagementPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSDeviceManagementPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+	return KGSDeviceManagementPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/GSDiagnosticsPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for GSDiagnosticsPlugin.
+*
+*/
+
+#ifndef _DEBUG
+    #define _DEBUG //REMOVE
+#endif
+
+#include <data_caging_paths.hrh>    //this is needed for RESOURCE_FILES_DIR
+#include "../logger/GsLoggingConfiguration.h"
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsdiagnosticsplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x102750D3
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSDiagnosticsPlugin.cpp
+SOURCE              GSDiagnosticsPluginImplementationTable.cpp
+
+USERINCLUDE         ../Logger
+USERINCLUDE         ../data
+USERINCLUDE         data
+USERINCLUDE         inc
+
+SYSTEMINCLUDE       .
+SYSTEMINCLUDE       /epoc32/include/cshelp
+SYSTEMINCLUDE       /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+//ECOM resource definition
+START RESOURCE      102750D3.rss
+TARGET              gsdiagnosticsplugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END                 //  ECOM resource definition
+
+//OperatorLogo resources
+START RESOURCE      GSDiagnosticsPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // OperatorLogo resources
+
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             centralrepository.lib
+LIBRARY             commdb.lib
+LIBRARY             commonengine.lib // RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             egul.lib // CGulIcon
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             etel.lib // RPhone
+LIBRARY             etelpckt.lib // RPacketService
+LIBRARY             euser.lib
+LIBRARY             FeatMgr.lib // FeatureManager
+LIBRARY             flogger.lib // RFileLogger
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib // Base classes
+LIBRARY             gslistBox.lib // CGSListBoxItemTextArray
+LIBRARY             hlplch.lib // HlpLauncher
+LIBRARY             charconv.lib // CnvUtfConverter
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            102750D3.rss
+DOCUMENT            GSDiagnosticsPluginRsc.rss
+
+SOURCEPATH          inc
+DOCUMENT            GSDiagnosticsPlugin.loc
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information required for building GSDiagnosticsPlugin.
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+GSDiagnosticsPlugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSDiagnosticsPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/data/102750D3.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSDiagnosticsPlugin.
+*
+*/
+
+#include <RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x102750D3;
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x102750D4;
+					version_no          = 1;
+					display_name        = "Diagnostics Plugin";
+					default_data        = "0x10207239"; // Parent UID
+					opaque_data         = "4"; // Order number
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/data/GSDiagnosticsPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSDiagnosticsPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        DGPL // 4 letter ID
+
+// INCLUDES
+#include    "GSDiagnosticsPlugin.loc" // OperatorLogo localized strings
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_diagnostics_view_title
+//    Operator logo view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_diagnostics_view_title
+    {
+    txt = qtn_set_title_settings_operatorlogo;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_diagnostics_plugin_caption
+//    Operator logo Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_diagnostics_plugin_caption
+    {
+    buf = qtn_set_diagnostics_caption;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_diagnostics_view
+//    Operator logo view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_diagnostics_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDiagnosticsPlugin implementation.
+*
+*/
+
+#ifndef GSDIAGNOSTICSPLUGIN_H
+#define GSDIAGNOSTICSPLUGIN_H
+
+// User includes
+
+// System includes
+#include <GSPluginInterface.h>
+#include <aknview.h>
+#include <ConeResLoader.h>
+#include <eikclb.h>
+
+// Classes referenced
+class CImplementationInformation;
+
+
+// Constants
+const TUid KGSDiagnosticsPluginUID = { 0x102750D4 };
+_LIT( KOperatorLogoResourceFileName, "z:GSDiagnosticsPluginRsc.rsc" );
+
+// CLASS DECLARATION
+
+/**
+* This is a utility plugin used to find errors in GS plugins.
+* - Crashes on construction/deletion
+* - Memory leaks on construction/deletion
+*
+*/
+class CGSDiagnosticsPlugin : public CGSPluginInterface
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSDiagnosticsPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSDiagnosticsPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * See base class.
+        */
+        TGSListboxItemTypes ItemType();
+
+        /**
+        * See base class.
+        */
+        void GetValue( const TGSPluginValueKeys aKey,
+                       TDes& aValue );
+
+        /**
+        * See base class.
+        */
+        void HandleSelection( const TGSSelectionTypes aSelectionType );
+
+        /**
+        * See base class.
+        */
+        TBool Visible() const;
+
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSDiagnosticsPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    protected: // From CAknView
+
+        /**
+        * This implementation is empty because this class, being just a dialog,
+        * does not implement the CAknView finctionality.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * This implementation is empty because this class, being just a dialog,
+        * does not implement the CAknView finctionality.
+        */
+        void DoDeactivate();
+
+    private: // New
+
+        /**
+        * Opens localized resource file.
+        */
+        void OpenLocalizedResourceFileL(
+            const TDesC& aResourceFileName,
+            RConeResourceLoader& aResourceLoader );
+
+        /**
+        * Prints debug info.
+        * @param aInfo info to be printed.
+        */
+        void PrintInfoDebug( CImplementationInformation* aInfo );
+
+        /**
+        * Checks plugin implementations. Uses __UHEAP_MARK and __UHEAP_MARKEND
+        * so will panic if plugin leaks memory.
+        */
+        void CheckInfoL( TUid aInterfaceUid );
+
+    protected: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+
+        // Print implementation info.
+        TBool iPrintInfo;
+
+        // Try loading and deleting each plugin.
+        TBool iTestLoad;
+
+        // Check heap change in case iTEstLoad in true.
+        TBool iCheckHeap;
+
+    };
+
+#endif // GSDIAGNOSTICSPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSDiagnosticsPlugin.
+*
+*/
+
+//  LOCALISATION STRINGS
+
+// **OPTIONS MENU
+
+//d:Operator logo plugin caption
+//d:Operator logo
+//l:title_pane_t2/opt9
+//w:
+//r:3.1
+//
+#define qtn_set_diagnostics_caption "GS Diagnostics"
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,337 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDiagnosticsPlugin implementation.
+*
+*/
+
+
+// User includes
+#include    "GSDiagnosticsPlugin.h"
+#include    <GSParentPlugin.h>
+#include    <GSCommon.hrh>
+#include    <GSDiagnosticsPluginRsc.rsg> // GUI Resource
+#include    <GSPrivatePluginProviderIds.h>
+#include    <GSFWViewUIDs.h>
+#include    "GSLogger.h"
+
+// System includes
+#include    <AknWaitDialog.h>
+#include    <aknnotewrappers.h>
+#include    <AknRadioButtonSettingPage.h>
+#include    <AknTextSettingPage.h>
+#include    <AknViewAppUi.h>
+#include    <bautils.h>
+#include    <FeatMgr.h>
+#include    <hlplch.h> // HlpLauncher
+#include    <StringLoader.h>
+
+#include    <ImplementationInformation.h>
+#include    <UTF.H> // CnvUtfConverter
+
+// Constants
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::CGSDiagnosticsPlugin()
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSDiagnosticsPlugin::CGSDiagnosticsPlugin()
+    : iResources( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::~CGSDiagnosticsPlugin()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSDiagnosticsPlugin::~CGSDiagnosticsPlugin()
+    {
+    iResources.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::ConstructL()
+    {
+    OpenLocalizedResourceFileL( KOperatorLogoResourceFileName, iResources );
+    BaseConstructL( R_GS_DIAGNOSTICS_VIEW );
+    __GSLOGSTRING( "[CGSDiagnosticsPlugin] ConstructL()" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSDiagnosticsPlugin* CGSDiagnosticsPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSDiagnosticsPlugin* self = new( ELeave ) CGSDiagnosticsPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::Id
+//
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSDiagnosticsPlugin::Id() const
+    {
+    return KGSDiagnosticsPluginUID;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::DoActivateL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                  TUid /*aCustomMessageId*/,
+                                  const TDesC8& /*aCustomMessage*/ )
+    {
+    // Update these values to define what is tested.
+    iPrintInfo  = ETrue;
+    iTestLoad   = EFalse;
+    iCheckHeap  = EFalse;
+
+    CheckInfoL( KGSPluginInterfaceUid );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::DoDeactivate
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::DoDeactivate()
+    {
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::GetCaptionL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    HBufC* result = StringLoader::LoadL( R_GS_DIAGNOSTICS_PLUGIN_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::PluginProviderCategory
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSDiagnosticsPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::ItemType()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSListboxItemTypes CGSDiagnosticsPlugin::ItemType()
+    {
+    return EGSItemTypeSettingDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::GetValue()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::GetValue( const TGSPluginValueKeys /*aKey*/,
+                                      TDes& /*aValue*/ )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::HandleSelection()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::HandleSelection(
+    const TGSSelectionTypes aSelectionType )
+    {
+    TRAP_IGNORE( CheckInfoL( KGSPluginInterfaceUid ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::Visible()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TBool CGSDiagnosticsPlugin::Visible() const
+    {
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::OpenLocalizedResourceFileL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    aResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::PrintInfoDebug
+// Print CImplementationInformation to log. Used for debugging.
+//
+// ----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::PrintInfoDebug( CImplementationInformation* aInfo )
+    {
+    TBuf16<256> dataType;
+    TBuf16<256> opaqueData;
+    CnvUtfConverter::ConvertToUnicodeFromUtf8(
+        dataType, aInfo->DataType() );
+    CnvUtfConverter::ConvertToUnicodeFromUtf8(
+        opaqueData, aInfo->OpaqueData() );
+
+    __GSLOGSTRING( "." );
+    __GSLOGSTRING1( "   DisplayName:        %S", &aInfo->DisplayName() );
+    __GSLOGSTRING1( "   ImplementationUid:  0x%X", aInfo->ImplementationUid() );
+    __GSLOGSTRING1( "   DataType:           %S", &dataType );
+    __GSLOGSTRING1( "   OpaqueData:         %S", &opaqueData );
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDiagnosticsPlugin::CheckInfoL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDiagnosticsPlugin::CheckInfoL( TUid aInterfaceUid )
+    {
+    RImplInfoPtrArray implInfoArray;
+
+    REComSession::ListImplementationsL( aInterfaceUid, implInfoArray );
+
+    if( iPrintInfo )
+        {
+        __GSLOGSTRING( "[CGSDiagnosticsPlugin implementation information]" );
+        for( TInt i = 0; i < implInfoArray.Count(); i++ )
+            {
+            PrintInfoDebug( implInfoArray[i] );
+            }
+        __GSLOGSTRING( "[End of implementation information]" );
+        }
+
+    CImplementationInformation* info;
+    CGSPluginInterface* plugin;
+
+    if( iTestLoad )
+        {
+        __GSLOGSTRING( "[CGSDiagnosticsPlugin plugin load/delete checks...]" );
+        for( TInt i = 0; i < implInfoArray.Count(); i++ )
+            {
+            info = implInfoArray[i];
+            __GSLOGSTRING1( "[CGSDiagnosticsPlugin] Checking: %S",
+                            &info->DisplayName() );
+
+            if ( iCheckHeap )
+              {
+              __UHEAP_MARK;
+              }
+
+            //Load plugin:
+            plugin = CGSPluginInterface::NewL(
+                info->ImplementationUid(),
+                AppUi() );
+
+            // Delete plugin:
+            delete plugin;
+            plugin = NULL;
+
+            if ( iCheckHeap )
+                {
+                __UHEAP_MARKEND;
+                }
+
+            __GSLOGSTRING1( "[CGSDiagnosticsPlugin]     %S OK",
+                            &info->DisplayName() );
+            }
+        }
+
+    implInfoArray.ResetAndDestroy();// This is needed
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSDiagnosticsPlugin.
+*
+*/
+
+
+// User includes
+#include "GSDiagnosticsPlugin.h"
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// Constants
+const TImplementationProxy KGSDiagnosticsSettingsPluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x102750D4,  CGSDiagnosticsPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = sizeof( KGSDiagnosticsSettingsPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+    return KGSDiagnosticsSettingsPluginImplementationTable;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Data/10207440.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Display Settings plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x10207440;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x10207441;
+                    version_no          = 1;
+                    display_name        = "Display Settings Plugin";
+                    #ifdef RD_CONTROL_PANEL
+                        default_data        = "0x10207237"; // Parent UID
+                        opaque_data         = "30"; // Order number
+                    #else //RD_CONTROL_PANEL
+                        default_data        = "0x10207252"; // Parent UID
+                        opaque_data         = "0"; // Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            },
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x2000B189;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x2000B592;
+                    version_no         = 1;
+                    display_name       = "PSMDisplayPlugin";
+                    default_data       = "";
+                    opaque_data        = "";
+                    }
+                };
+            }
+
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Data/2000B591.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,18 @@
+<PowerSaveModeConfig>
+	<Setting mode="1"><!-- power saving mode -->
+		<SetItem key="1" type="0" value="-15"></SetItem>  <!--EContrast-->
+		<SetItem key="2" type="0" value="5"></SetItem>    <!--EBacklightPeriod-->
+		<SetItem key="3" type="0" value="-15"></SetItem>  <!--EBrightness-->
+		<SetItem key="4" type="0" value="1"></SetItem>    <!--EAmbientLightSensor-->
+		<SetItem key="5" type="0" value="5"></SetItem>    <!--EScreenSaverPeriod-->
+		<SetItem key="6" type="0" value="3"></SetItem>    <!--EAutomaticBrightnessContral-->
+	</Setting>
+	<Setting mode="2"><!-- partial power saving mode -->
+		<SetItem key="1" type="0" value="-15"></SetItem>  <!--EContrast-->
+		<SetItem key="2" type="0" value="5"></SetItem>    <!--EBacklightPeriod-->
+		<SetItem key="3" type="0" value="-15"></SetItem>  <!--EBrightness-->
+		<SetItem key="4" type="0" value="1"></SetItem>    <!--EAmbientLightSensor-->
+		<SetItem key="5" type="0" value="5"></SetItem>    <!--EScreenSaverPeriod-->
+		<SetItem key="6" type="0" value="3"></SetItem>    <!--EAutomaticBrightnessContral-->
+	</Setting>
+</PowerSaveModeConfig>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Data/GsDisplayPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,766 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for General Settings
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    DISP // 4 letter ID
+
+//  INCLUDES
+#include    "GsDisplayPlugin.hrh"
+#include    <gsdisplplugin.loc>
+
+#include    <gs.loc>
+#include    <gscommon.rh>
+
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+#include    <drmcommon.loc>
+
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+
+RESOURCE TBUF
+    {
+    buf="DISP";
+    }
+
+//----------------------------------------------------
+//   
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+
+// **COMMON RESOURCES
+
+//----------------------------------------------------
+//   
+//    r_not_enough_memory_query
+//    Not enough memory note.
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_not_enough_memory_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY 
+                { 
+                layout = EConfirmationQueryLayout;
+                label = qtn_memlo_not_enough_memory;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_image_load_wait_note
+//    Image loading wait note.
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_image_load_wait_note
+    {
+    flags = EAknWaitNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EImageLoadWaitNote;
+            control= AVKON_NOTE 
+                { 
+                layout = EWaitLayout;
+                singular_label = qtn_set_loading_image;
+                imagefile = AVKON_ICON_FILE;
+                imageid = EMbmAvkonQgn_note_progress;
+                imagemask = EMbmAvkonQgn_note_progress_mask;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_gs_image_corrupted
+//    Image corrupted information note.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_image_corrupted 
+    {
+    buf = qtn_set_image_format_wrong;
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_image_too_large
+//    Image corrupted information note.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_image_too_large 
+    {
+    buf = qtn_set_image_too_large;
+    }
+
+
+//----------------------------------------------------
+//  r_gs_display_view_caption
+// 
+// Display view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_display_view_caption
+    {
+    buf = qtn_set_device_display;
+    }
+
+
+// **DISPLAY VIEW
+
+//----------------------------------------------------
+//   
+//    r_gs_display_view_title
+//    Display view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_display_view_title
+    {
+    txt = qtn_set_title_display;        
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_gs_displ_view
+//    Display view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_displ_view
+    {
+    menubar = r_gs_menubar_change_exit;  
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+//----------------------------------------------------
+//    
+//    r_displ_lbx    
+//    Display view's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_displ_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            // the current value is a slider bitmap (1. icon in the icon array)
+            txt = " \t"qtn_set_display_contrast"\t0";
+            item = EGSSettIdContrast;
+            type = EGSListBoxItemTypeIsDynamic;
+            },        
+        GS_FEATURE
+            {
+            // the current value is a slider bitmap (1. icon in the icon array)
+            txt = " \t"qtn_set_disp_brightness"\t1";
+            item = EGSSettIdBrightness;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            // the current value is a slider bitmap (1. icon in the icon array)
+            txt = " \t"qtn_set_light_sensor_mode"\t2";
+            item = EGSSettIdAmbientLightSensor;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_set_disp_text_size"\t\t";
+            item = EGSSettIdDisplayTextSize;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_sanim_time_out"\t\t"; 
+            item = EGSSettIdSSP;
+            type = EGSListBoxItemTypeIsDynamic;            
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_sanim_object"\t\t";
+            item = EGSSettIdSSO;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_set_uwn"\t\t";
+            item = EGSSettIdWNI;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_sanim_objec_power_save_led"\t\t";
+            item = EGSSettIdPowerSaveLed;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_set_light_time"\t\t"; 
+            item = EGSSettIdBacklight;            
+            },
+        GS_FEATURE
+            {
+            txt = "\t"qtn_set_oper_logo"\t\t";
+            item = EGSSettIdOperatorLogo;
+            type = EGSListBoxItemTypeIsDynamic;
+            }
+        };    
+    }
+
+
+// **CONTRAST
+
+//----------------------------------------------------
+//    
+//    r_contrast_slider    
+//    Contrast slider.
+//
+//----------------------------------------------------
+//
+RESOURCE SLIDER r_contrast_slider 
+    {
+    layout = EAknSettingsItemSliderLayoutWithGraphics;
+    minvalue = -15;
+    maxvalue = 15;
+    step = 1;
+    valuetype = EAknSliderValuePercentage;
+    minlabel = qtn_set_contrast_light;
+    maxlabel = qtn_set_contrast_dark;
+    }
+
+//----------------------------------------------------
+//    
+//    r_contrast_setting_page    
+//    Contrast setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_contrast_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_display_contrast;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtSlider;
+    editor_resource_id = r_contrast_slider;
+    }
+
+
+// **BRIGHTNESS
+
+//----------------------------------------------------
+//    
+//    r_brightness_slider    
+//    Brightness slider.
+//
+//----------------------------------------------------
+//
+RESOURCE SLIDER r_brightness_slider 
+    {
+    layout = EAknSettingsItemSliderLayoutWithGraphics;
+    minvalue = 1;
+    maxvalue = 31;
+    step = 1;
+    valuetype = EAknSliderValuePercentage;
+    minlabel = qtn_set_brightness_dark;
+    maxlabel = qtn_set_brightness_bright;
+    }
+
+//----------------------------------------------------
+//    
+//    r_brightness_setting_page    
+//    Brightness setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_brightness_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_disp_brightness;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtSlider;
+    editor_resource_id = r_brightness_slider;
+    }
+
+
+// **AMBIENT LIGHT SENSOR
+
+//----------------------------------------------------
+//    
+//    r_ambient_light_sensor_slider    
+//    Ambient Light Sensor slider.
+//
+//----------------------------------------------------
+//
+RESOURCE SLIDER r_ambient_light_sensor_slider 
+    {
+    layout = EAknSettingsItemSliderLayoutWithGraphics;
+    minvalue = 1;
+    maxvalue = 5;
+    step = 1;
+    valuetype = EAknSliderValuePercentage;
+    minlabel = qtn_set_light_sensor_dark;
+    maxlabel = qtn_set_light_sensor_bright;
+    }
+
+//----------------------------------------------------
+//    
+//    r_ambient_light_sensor_setting_page    
+//    Ambient Light Sensor setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_ambient_light_sensor_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_light_sensor_mode;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtSlider;
+    editor_resource_id = r_ambient_light_sensor_slider;
+    }
+
+
+// **SCREEN SAVER
+
+//----------------------------------------------------
+//    
+//    r_setting_screen_saver_slider    
+//    Screen saver time setting slider
+//
+//----------------------------------------------------
+//
+RESOURCE SLIDER r_setting_screen_saver_slider 
+    {
+    layout = EAknSettingsItemSliderLayout;
+    minvalue = 5;
+    maxvalue = 90;
+    step = 5;
+    valuetype = EAknSliderValueBareFigure;
+    minlabel = qtn_sanim_time_out_slider_min_value;
+    maxlabel = qtn_sanim_time_out_slider_max_value;
+    valuelabel = qtn_sanim_time_out_slider_cur_value; 
+    }
+
+//----------------------------------------------------
+//    
+//    r_screen_saver_period_setting_page    
+//    Screen saver period setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_screen_saver_period_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_sanim_time_out;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtSlider;
+    editor_resource_id = r_setting_screen_saver_slider;
+    }
+
+
+//  **BACKLIGHT TIMEOUT
+
+//----------------------------------------------------
+//    
+//    r_setting_backlight_slider    
+//    Backlight timeout setting slider
+//
+//----------------------------------------------------
+//
+RESOURCE SLIDER r_setting_backlight_slider 
+    {
+    layout = EAknSettingsItemSliderLayout;
+    minvalue = 5;
+    maxvalue = 60;
+    step = 5;
+    valuetype = EAknSliderValueBareFigure;
+    singular_valuelabel = qtn_backlight_time_out_slider_cur;
+    minlabel = qtn_backlight_time_out_slider_min;
+    maxlabel = qtn_backlight_time_out_slider_max;
+    valuelabel = qtn_backlight_time_out_slider_cur; 
+    }
+
+//----------------------------------------------------
+//    
+//    r_backlight_period_setting_page    
+//    Backlight period setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_backlight_period_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_light_time;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtSlider;
+    editor_resource_id = r_setting_backlight_slider;
+    }
+
+
+// **DISPLAY TEXT SIZE
+
+//----------------------------------------------------
+//    
+//    r_display_text_size_setting_page
+//    Display text size setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_display_text_size_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_set_disp_text_size;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//    
+//    r_display_text_size_setting_page_lbx
+//    Display text size setting page's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_display_text_size_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_disp_text_size_large;
+            },
+        LBUF
+            {
+            txt = qtn_set_disp_text_size_normal;
+            },
+        LBUF
+            {
+            txt = qtn_set_disp_text_size_small;
+            }
+        };
+    }
+
+
+// **WELCOME NOTE SETTING PAGE
+
+//----------------------------------------------------
+//    
+//    r_welcome_note_setting_page   
+//    Welcome note setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_welcome_note_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_uwn;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//    
+//    r_welcome_note_text_query    
+//    Welcome note text query.
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_welcome_note_text_query
+    {
+    flags = EAknDialogGenericQueryFlags | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            itemflags=EEikDlgItemTakesEnterKey;
+            control = AVKON_DATA_QUERY
+                { 
+                layout = EDataLayout;
+                label = qtn_set_uwn_enter_text;
+                control = EDWIN
+                    {
+                    flags=0;
+                    width=5;
+                    lines=5;
+                    maxlength=50;
+                    avkon_flags = EAknEditorFlagEnablePictographInput;
+                    allowed_input_modes = EAknEditorAllInputModes;
+                    default_input_mode = EAknEditorTextInputMode;
+                    };
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//    
+//  r_welcome_note_setting_page_lbx
+//  Welcome note setting page's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_welcome_note_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_uwn_default;
+            },
+        LBUF
+            {
+            txt = qtn_set_uwn_text;
+            },
+        LBUF
+            {
+            txt = qtn_set_uwn_image;
+            }
+        };
+    }
+
+
+// *BACKGROUND IMAGE
+
+//----------------------------------------------------
+//    
+//    r_background_image_setting_page   
+//    Background image setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_background_image_setting_page
+    { 
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_bgimage;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//    
+//    r_background_image_setting_page_lbx    
+//    Background image setting page's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_background_image_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_bgimage_no;
+            },
+        LBUF
+            {
+            txt = qtn_set_bgimage_image;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_drm_not_allowed
+//    DRM protected image cannot be selected as welcome note iamge.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_drm_not_allowed
+    {
+    buf = qtn_drm_not_allowed;
+    }
+  
+
+// **POWER SAVE LED MODE
+
+//----------------------------------------------------
+//    
+//    r_power_save_led_setting_page    
+//    Power Save LED mode setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_power_save_led_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_sanim_objec_power_save_led;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//    
+//    r_power_save_led_setting_page_lbx    
+//    Power Save LED mode setting page's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_power_save_led_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_sanim_power_save_on;
+            },
+        LBUF
+            {
+            txt = qtn_sanim_power_save_off;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_power_saving_protected_settings_infonote
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_power_saving_protected_settings_infonote
+    {
+    buf = qtn_power_saving_protected_settings_infonote;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_operatorlogo_plugin_caption
+//    Operator logo Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_operatorlogo_plugin_caption
+    {
+    buf = qtn_set_oper_logo;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_operatorlogo_on_text
+//    Operator logo text for operator logo value on.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_operatorlogo_on_text
+    {
+    buf = qtn_set_oper_logo_on;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_operatorlogo_off_text
+//    Operator logo text for operator logo value off.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_operatorlogo_off_text
+    {
+    buf = qtn_set_oper_logo_off;
+    }
+
+//----------------------------------------------------
+//    
+//    r_operator_logo_setting_page    
+//    Operator Logo setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_operator_logo_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed; 
+    label = qtn_set_oper_logo;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//    
+//  r_oplogo_on_off_setting_page_lbx 
+//  Operator Logo on/off setting page items list box
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_oplogo_on_off_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_oper_logo_on;
+            },
+        LBUF
+            {
+            txt = qtn_set_oper_logo_off;
+            }
+        };
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/GSDisplayPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file.
+*
+*/
+
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+#include  <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsdisplayplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10207440
+VENDORID            VID_DEFAULT
+
+SOURCEPATH  Src
+SOURCE      GSDisplayPluginImplementationTable.cpp
+SOURCE      GSDisplayPluginContainer.cpp
+SOURCE      GSDisplayPlugin.cpp
+SOURCE      GSDisplayPluginModel.cpp
+
+#ifdef FF_POWER_SAVE
+	SOURCE      PSMDisplayPlugin.cpp
+	SOURCE    	GSDisplayPluginAO.cpp
+#endif // FF_POWER_SAVE
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Data // For CommonResources.rss
+USERINCLUDE 	../Logger
+USERINCLUDE 	../Cenrep
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  10207440.rss
+TARGET          gsdisplayplugin.rsc
+END
+
+START RESOURCE  GsDisplayPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   cone.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   egul.lib
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   hal.lib               // contrast
+LIBRARY   ws32.lib
+
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   centralrepository.lib
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+
+LIBRARY   aknnotify.lib         // for CAknGlobalNote.h
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   backgroundimage.lib
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   mgfetch.lib           // for image selection list
+LIBRARY   drmcommon.lib
+LIBRARY   aknswallpaperutils.lib
+LIBRARY   flogger.lib // For GSLogger
+LIBRARY   gsecomplugin.lib
+LIBRARY   imageconversion.lib
+LIBRARY   apparc.lib
+LIBRARY   cenrepnotifhandler.lib
+
+#ifdef FF_POWER_SAVE
+	LIBRARY   psmclient.lib
+#ifndef WINS
+   	LIBRARY   power_save_display_mode.lib
+#endif // WINS
+
+#endif // FF_POWER_SAVE
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,335 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Display settings.
+*
+*/
+
+
+#ifndef GSDISPLAYPLUGIN_H
+#define GSDISPLAYPLUGIN_H
+
+// INCLUDES
+#include <aknsettingpage.h>
+#include <ConeResLoader.h>
+#include <gsplugininterface.h>
+#include <gsfwviewuids.h>
+#include <gsbaseview.h>
+#include <MMGFetchVerifier.h>
+#include <mgsasyncimagehandlingobserver.h>
+#include <backgroundimage.h>
+#include <eikmenup.h>
+
+#ifdef FF_POWER_SAVE
+    #include <psmtypes.h>
+#endif // FF_POWER_SAVE
+
+// CONSTANTS
+const TUid KGSDisplayPluginUid = { 0x10207441 };
+_LIT( KGSDefaultDisplayIconFileName, "Z:\\resource\\apps\\GSDisplayplugin.mbm");
+_LIT( KGSDisplayPluginIconFileName, "\\resource\\apps\\GSDisplayplugin.mif");
+
+const TInt KGSOpLogoLbxIndexOn = 0;
+const TInt KGSOpLogoLbxIndexOff = 1;
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD CLASS DECLARATION
+class CAknViewAppUi;
+class CAknWaitDialog;
+class CAknRadioButtonSettingPage;
+//class CAknQueryDialog;
+class CGSDisplayPluginContainer;
+class CGSDisplayPluginModel;
+
+#ifdef FF_POWER_SAVE
+    class CGSDisplayPluginAO;
+#endif // FF_POWER_SAVE
+    
+// CLASS DECLARATION
+/**
+*  CGSDisplayPlugin view class
+*
+*  Plugin implementation for Display settings
+*  @lib GSDisplayPlugin.lib
+*  @since Series 60_3.1
+*/
+class CGSDisplayPlugin : public CGSBaseView, 
+                         public MAknSettingPageObserver,
+                         public MMGFetchVerifier,
+                         public MGSAsyncImageHandlingObserver
+    {
+    public:
+    
+       enum TGSSettingIds
+            {
+            KGSContrastSettingId,
+            KGSBrightnessSettingId,
+            KGSSaverObjectSettingId,
+            KGSAutodisconSettingId,
+            KGSWelcomeNoteSettingId,
+            KGSAmbientLightSensorId
+            };
+            
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS connection view.
+        */
+        static CGSDisplayPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSDisplayPlugin();
+
+    public: // from base classes
+        
+        /**
+        * Returns view id.
+        * @return TUid
+        */
+        TUid Id() const;
+
+        /**
+        * Handles commands.
+        * @param aCommand Command to be handled.
+        * 
+        */
+        void HandleCommandL( TInt aCommand );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+        
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+        
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+        
+    public: // from MAknSettingPageObserver
+        
+        /**
+        * Handle setting page events
+        */
+        virtual void HandleSettingPageEventL( CAknSettingPage* aSettingPage,
+                                            TAknSettingPageEvent aEventType );
+            
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aItemId An item which is updated.
+        * 
+        */
+        void UpdateListBoxL( TInt aItemId );
+        
+        /**
+        * Get CGSDisplayPlugin's ccontainer.
+        */
+        CGSDisplayPluginContainer* Container();
+
+        
+        /**
+        * Updates display plugin view.
+        */
+        void UpdateViewL();
+        void CloseDialog();
+        
+    protected: // From CAknView 
+
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        void DoDeactivate();
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+    
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CGSDisplayPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        * 
+        */
+        void ConstructL();
+        
+        void HandleClientRectChange();
+
+    private: // from CGSBaseView
+        
+        void NewContainerL();
+        void HandleListBoxSelectionL();
+        
+    private: //from MMGFetchVerifier
+        
+        /**
+        * Display Backlight setting page
+        */
+        TBool VerifySelectionL( const MDesCArray* aSelectedFiles );
+    
+    private: //from MGSSyncImageHandlingObserver
+        /**
+        * Display Welcome note image list from media gallery
+        */
+        void ImageHandlingCompleteL( TInt aError );
+    
+    private: //new methods
+        
+        /**
+        * Display Constrast setting page
+        */
+        void ShowContrastSettingPageL();
+        
+        /**
+        * Display Brightness setting page
+        */
+        void ShowBrightnessSettingPageL();
+        
+        /**
+        * Display ALS setting page
+        */
+        void ShowAmbientLightSensorSettingPageL();
+        
+        /**
+        * Display Screen saver timeout setting page
+        */
+        void ShowScreenSaverPeriodSettingPageL();
+        
+        /**
+        * Display Backlight setting page
+        */
+        void ShowBacklightSettingPageL();
+        
+        /**
+        * Display Welcome note setting page
+        */
+        void ShowWelcomeNoteSettingPageL();
+        
+        /**
+        * Display Welcome note text input dialog
+        */
+        void ShowWelcomeNoteTextQueryL();
+    
+        /**
+        * Display Welcome note image list from media gallery
+        */
+        void ShowWelcomeNoteImageListL();
+
+
+        /**
+        * Show display text size setting page
+        */
+        void ShowDisplayTextSizeSettingPageL();
+
+
+        /**
+        * Display Power save LED setting page
+        * @param aSettingPage ETrue if setting page is to be shown
+        *                     EFalse, otherwise
+        */
+        void ShowPowerSaveLedSettingPageL( TBool aSettingPage );
+        
+        /**
+        * Display load wait-note dialog during image loading
+        */
+        void ShowImageLoadWaitNoteL();
+        
+        /**
+        * Hide load wait-note dialog after the image is loaded
+        */
+        void HideImageLoadWaitNoteL();
+        
+        /**
+        * Check if the input file is DRM protected
+        * @param aOriginalFileName Path of the bitmap file
+        * @return ETrue if file is DRM protected.
+        *         EFalse otherwise.
+        */
+        TBool CheckDRMProtectionL( const TDesC& aOriginalFileName );
+        
+        /**
+        * Handle any errors during image processing
+        * @param aError system wide error code
+        */
+        void HandleImageErrorsL( TInt aError );
+
+        /**
+        * Changes operator logo value.
+        * @param aUseSettingPage ETrue if setting page should be used.
+        *                        EFalse is just switch between the values.
+        */
+        void ChangeOperatorLogoSettingL( TBool aUseSettingPage );
+
+        /**
+        * Displays operator logo setting page.
+        * @param aOperatorLogoValue current operator logo value.
+        */
+        TBool ShowOperatorLogoSettingPageL( TInt& aOperatorLogoValue );
+#ifdef FF_POWER_SAVE    
+        /**
+         *  Displays blocking note. Used if PSM is on.
+         */
+        void DisplayBlockNoteL();
+#endif // FF_POWER_SAVE
+        
+    protected:
+        //check if screen saver text is to be updated
+        TBool iUpdateSSText;
+        //check if welcome note is supported
+        TBool iUpdateWNote;
+        // for load wait dialog
+        CAknWaitDialog* iWaitDialog;
+        CAknRadioButtonSettingPage* iOprtLogoSettingPage;
+                
+    private:
+        // plugin model
+        CGSDisplayPluginModel *iModel;
+        // resource loader
+        RConeResourceLoader iResourceLoader;
+        //for image handling
+        CGSAsyncImageHandling* iImageHandler;
+        //welcome note type: none, text, image       
+        TInt iWelcomeNoteType;
+        TBool iReshowOprtSetPage;
+#ifdef FF_POWER_SAVE
+        // Active object for handling PSM realted CenRep events.
+        CGSDisplayPluginAO* iPsmActive;
+#endif // FF_POWER_SAVE
+        // Prevent multiple launch the MFetch.
+        TBool iLaunchedImageFetch;
+        
+    };
+
+   
+    #endif // GSDISPLAYPLUGIN_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginAO.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Active object for handling PSM related CenRep changes.
+*
+*/
+
+
+#ifndef GSDISPLAYPLUGINAO_H
+#define GSDISPLAYPLUGINAO_H
+
+// INCLUDES
+#include <psmtypes.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD CLASS DECLARATION
+
+// CLASS DECLARATION
+
+/**
+*  CGSDisplayPluginAO. Acts as a CenRep observer for PSM related state 
+*  changes.
+*
+*  @lib GSDisplayPlugin.lib
+*  @since Series 60_3.2
+*/
+class CGSDisplayPluginAO : public CActive
+    {
+    public:
+    
+        static CGSDisplayPluginAO* NewL();
+        ~CGSDisplayPluginAO();
+    
+        /**
+         * Set view which should be updated when PSM mode changes.
+         */
+        void SetView( CGSDisplayPlugin* aDisplayView );
+        
+        /**
+         * @return PSM mode. See TPsmsrvMode.
+         */
+        TInt Mode();
+        
+    protected: // From CActive
+
+        void DoCancel();
+        void RunL();
+        TInt RunError( TInt aError );
+        
+    private:
+
+        CGSDisplayPluginAO();
+        void ConstructL();
+
+    private: // Data
+        
+        CRepository* iPsmRepository;
+        TInt iPsmMode;
+        CGSDisplayPlugin* iDisplayView;
+    };
+
+
+#endif // GSDISPLAYPLUGINAO_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Display sub-folder
+*
+*/
+
+
+#ifndef GSDISPLAYPLUGINCONTAINER_H
+#define GSDISPLAYPLUGINCONTAINER_H
+
+// INCLUDES
+#include "GSDisplayPluginModel.h"
+
+#include <bldvariant.hrh>
+#include <gsbasecontainer.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CGSListBoxItemTextArray;
+class CGulIcon;
+
+
+// CLASS DECLARATION
+
+/**
+*  GSDisplayPluginContainer container class
+*
+*  container class for Device settings view
+*  @lib GSDisplayPlugin.lib
+*  @since Series 60_3.1
+*/
+class CGSDisplayPluginContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS constructor.
+        * @param aRect Listbox's rect.
+        * 
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CGSDisplayPluginContainer();
+        
+        /**
+        * Constructor
+        */
+        CGSDisplayPluginContainer();
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @since Series 60_3.1
+        * @param aItemId An item which is updated.
+        */
+        void UpdateListBoxL( TInt aFeatureId );
+        
+        /**
+        * Retrieves the currently selected listbox feature id
+        * @since Series 60_3.1
+        * @return feature id.
+        */
+        TInt CurrentFeatureId() const;
+
+        /**
+        * Converts the value from Model's Avkon to setting page item index
+        * @param aCurrentZoom value from TAknUiZoom in AknDef.hrh
+        */
+        void MapZoomLevelToUi( TInt& aCurrentZoom );
+
+        /**
+        * Converts the value from setting page item index to Model's Avkon value
+        * @param aCurrentZoom value from TZoomLevel in CPP file for this header
+        */
+        void MapZoomLevelFromUi ( TInt& aCurrentZoom );
+        
+        /**
+         * Return its member variable iMode
+         * @param
+         */
+        CGSDisplayPluginModel* Model();
+        void CloseDialog();
+
+    protected: // from CGSBaseContainer
+        void ConstructListBoxL( TInt aResLbxId );
+        
+    protected: // from CCoeControl
+        /**
+        * Handles skin changes to resources
+        * @since Series 60_3.1
+        * @param aType type of the event to handle
+        */
+        void HandleResourceChange( TInt aType );
+
+    private: // new
+        // create listbox from resource
+        void CreateListBoxItemsL();
+        // create contrast item
+        void MakeContrastItemL();
+        // create brightness item
+        void MakeBrightnessItemL();
+        // create screen saver time-out item
+        void MakeSSPItemL();
+        // create backlight timeout item
+        void MakeBacklightItemL();
+         // create ALS item
+        void MakeAmbientLightSensorItemL();
+        // create Display text size item
+        void MakeDisplayTextSizeItemL();
+        // create welcome note item
+        void MakeWNIItemL();
+        //PowerSave LED item
+        void MakePowerSaveLedItemL();
+        //Operator logo item
+        void MakeOperatorLogoItemL();
+        // create static bitmap for contrast and brightness
+        void CreateBitmapL( TInt aValue, TInt aResourceId, TInt aIndex );
+        
+    private: // from CGSBaseContainer
+        /**
+        * Required for help.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+        
+    private: // Data
+        //display text size setting page items
+        CDesCArrayFlat* iDispTxtSizeItems;
+        //welcome note setting page items 
+        CDesCArrayFlat* iWelcomeItems;
+        //power save led setting page items
+        CDesCArrayFlat* iLedItems;
+        //operator logo on/off
+        CDesCArrayFlat* iOperatorLogoItems;
+        //icons for contrast & brightness
+        CArrayPtr<CGulIcon>* iIconArray;
+        //listbox item array
+        CGSListBoxItemTextArray* iListboxItemArray;
+        // plugin model
+        CGSDisplayPluginModel* iModel;
+        
+    };
+
+#endif //GSDISPLAYPLUGINCONTAINER_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,357 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Display Settings model.
+*
+*/
+
+
+#ifndef GSDISPLAYPLUGINMODEL_H
+#define GSDISPLAYPLUGINMODEL_H
+
+#include <e32base.h>
+#include <e32property.h>
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+#include <backgroundimage.h>
+
+class CGSDisplayPluginContainer;
+
+// CONSTANTS
+// maximum string sizes
+const TInt KGSMaxImagePath = 256;  // max lenght of image paths
+const TInt KGSMaxWNText = 50;      // max length of welcome note text
+const TInt KGSMaxSSText = 15;      // max lenght of screen saver text
+const TInt KGSWelcomeNoteTypeValue = 0;
+const TInt KGSScreenSaverObjectValue = 0;
+const TInt KGSScreenSaverPeriodValue = 5;
+const TInt KGSWNTextIndex = 1;
+const TInt KGSWNImageIndex = 2;
+const TInt KGSBgImageIndex = 1;
+const TInt KGSSSTextObjectIndex = 0;
+
+//for switching values in SwitchValue()
+const TInt KGSSettingOff = 0;
+const TInt KGSSettingOn = 1;
+
+// Setting values for Background and Welcome note image
+const TInt KGSUWNoteSupportedValue = 1; // default is show the item
+const TInt KGSWelcomeNoteTypeImage = 2;
+
+_LIT( KGSWelcomeNoteImgPath, "c:\\private\\100058ec\\welcomeimage.mbm" );
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CGSBackgroundImage;
+
+// CLASS DEFINITION
+/**
+*  CGSDisplayPluginModel is the model class of GS display plugin.
+*  It provides functions to get and set setting values.
+*  @lib GSDisplayPlugin.lib
+*  @since Series 60_3.1
+
+*/
+NONSHARABLE_CLASS( CGSDisplayPluginModel ): public CBase,
+                                            public MCenRepNotifyHandlerCallback
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        * @param aInitBackgrooundApi Set to ETrue if CGSBackgroundImage is to 
+        *        be initialized. This is not to possible if model is created in
+        *        a process without a Avkon UI.
+        */
+        static CGSDisplayPluginModel* NewL( TBool aInitBackgroundApi );
+        static CGSDisplayPluginModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSDisplayPluginModel();
+
+    public: // new ones
+
+        /**
+        * Returns welcome note type.
+        * @return 0: default
+        *         1: text
+        *         2: image
+        */
+        TInt WelcomeNoteTypeL();
+
+        /**
+        * Sets welcomenote type.
+        * @param aType Type of the welcome note.
+        */
+        void SetWelcomeNoteTypeL( TInt aType );
+
+        /**
+        * Gets welcome note text from shared data.
+        * @param aNote Descriptor which will contain the welcome note text.
+        *              Max length is KGSMaxWNText.
+        */
+        void WelcomeNoteTextL( TDes& aNote );
+
+        /**
+        * Stores welcome note text to shared data.
+        * @param aNote Descriptor which contains the welcome note text.
+        *              Max length is KGSMaxWNText.
+        */
+        void SetWelcomeNoteTextL( const TDesC& aNote );
+
+        /**
+        * Returns the deviation from the calibrated contrast value.
+        * @return Deviation from the calibrated contrast value.
+        *         Min value is -15 and max value is 15.
+        */
+        TInt ContrastL();
+
+        /**
+        * Sets the deviation from the calibrated contrast value.
+        * @param aContrast Deviation from the calibrated contrast value.
+        *                  Min value is -15 and max value is 15.
+        */
+        void SetContrastL( const TInt aContrast );
+
+        /**
+        * Return value tells what is screen saver object.
+        * @return 0: text
+        *         1: time and date
+        */
+        TInt ScreenSaverObjectL();
+
+        /**
+        * Sets screen saver object.
+        * @param aObject screen saver object.
+        */
+        void SetScreenSaverObjectL( const TInt aObject );
+
+        /**
+        * Gets screen saver text from shared data.
+        * @param aText Descriptor which will contain the screen saver text.
+        *              Max length is KGSMaxSSText.
+        */
+        void GetScreenSaverTextL( TDes& aText );
+
+        /**
+        * Stores screen saver text to shared data.
+        * @param aText Descriptor which contains the screen saver text.
+        *              Max length is KGSMaxSSText.
+        */
+        void SetScreenSaverTextL( const TDesC& aText );
+
+        /**
+        * Returns the period of time after which the screen saver starts
+        * if the keys are not pressed.
+        * @return Minutes between 1 and 30.
+        */
+        TInt ScreenSaverPeriodL();
+
+        /**
+        * Sets the period of time after which the screen saver starts
+        * if the keys are not pressed.
+        * @param aPeriod Screen saver period (minutes between 1 and 30).
+        */
+        void SetScreenSaverPeriodL( const TInt aPeriod );
+
+        /**
+        * Returns the period of time after which the backlight fades out
+        * if the keys are not pressed.
+        * @return Seconds between 5 and 60.
+        */
+        TInt BacklightPeriodL();
+
+        /**
+        * Sets the period of time after which the backlights fades out
+        * if the keys are not pressed.
+        * @param aPeriod backlight period (seconds between 5 and 60).
+        */
+        void SetBacklightPeriodL( const TInt aPeriod );
+
+        /**
+        * Checks whether the user welcome note is supported
+        * @return TInt
+        */
+        TInt IsUWNoteSupportedL();
+
+        /**
+        * Returns the deviation from the calibrated brightness value.
+        * @return Deviation from the calibrated brightness value.
+        *         Min value is 1 and max value is 31.
+        */
+        TInt BrightnessL();
+
+        /**
+        * Sets the deviation from the calibrated brightness value.
+        * @param aBrightness Deviation from the calibrated brightness value.
+        *                  Min value is 1 and max value is 31.
+        */
+        void SetBrightnessL( const TInt aBrightness );
+
+        /**
+        * Returns the deviation from the calibrated light sensor value.
+        * @return Deviation from the calibrated light sensor value.
+        *         Min value is 1 and max value is 5.
+        */
+        TInt AmbientLightSensorL();
+
+        /**
+        * Sets the deviation from the calibrated light sensor value.
+        * @param aSensorSensivity Deviation from the calibrated brightness value.
+        *                  Min value is 1 and max value is 5.
+        */
+        void SetAmbientLightSensorL( const TInt aSensorSensitivity );
+
+        /**
+        * Returns the current display text size.
+        * @return One of the following values:
+        *         Large
+        *         Normal (default)
+        *         Small
+        */
+        TInt DisplayTextSizeL();
+
+        /**
+        * Set the new display text size.
+        * @param aSize. One of the following values:
+        *         Large
+        *         Normal (default)
+        *         Small
+        */
+        void SetDisplayTextSizeL( TInt aSize );
+
+
+        /**
+        * Get the Power Save Led value
+        * @return:
+        * 0: Disabled
+        * 1: Enabled
+        */
+        TInt PowerSaveLedL();
+
+        /**
+        * Set the Power Save Led value
+        * @param aPowerLedState
+        * 0: Disabled
+        * 1: Enabled
+        */
+        void SetPowerSaveLedL( const TInt aPowerLedState );
+
+        /**
+        * Checks Power Save Led support
+        * @return:
+        * 0: Disabled
+        * 1: Enabled
+        */
+        TInt CheckPowerSaveLedSupportL();
+
+        /**
+        * @return pointer to background image. Does not transfer ownership.
+        */
+        CGSBackgroundImage* BackgroundImage();
+        
+        /**
+        * Checks ScreenSaver timeout support
+        * @return:
+        * ETrue: ScreenSaver timeout setting is supported
+        * EFalse: ScreenSaver timeout setting is not supported 
+        */
+        TBool CheckScreenSaverTimeoutSupportL();
+        
+        /**
+        * Checks if Operator Logo setting item is to be made visible.
+        * @return ETrue if setting item is to be shown.
+        *         EFalse if setting item is not to be shown.
+        */
+        TBool ShowOperatorLogoSettingL();
+
+        /**
+        * Gets operator logo state.
+        * @return KGSSettingOn  if logo is used.
+        *         KGSSettingOff if logo is not used.
+        */
+        TInt OperatorLogoL();
+        
+        /**
+        * @param
+        */
+        void SetOperatorLogoL( TInt aOperatorLogo );
+        
+        /**
+         * @param
+         */
+        void SetOwner( CGSDisplayPluginContainer* aPlugin);
+
+    private: // Private constructors
+
+        /**
+        * Default C++ contructor
+        */
+        CGSDisplayPluginModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL( TBool aInitBackgroundApi );
+
+        /**
+        * Initialize CenRep keys used in this class
+        */
+        void InitializeCentralRepositoryL();
+
+        /**
+        * Un-initialize CenRep keys used in this class
+        */
+        void UninitializeCentralRepository();
+
+    private: // new ones
+
+        void SetBackLightValueL();
+		TInt ScaleIntensityValues( TInt aValue, TBool aSample );
+		TInt ScaleLightSensorValues( TInt aValue, TBool aDirection );
+		
+		// From MCenRepNotifyHandlerCallback
+		void HandleNotifyInt( TUint32 aId, TInt aNewValue);
+
+    private:
+        //Central repository objects
+        CRepository* iPersonalizationRepository;
+        CRepository* iStartupConfRepository;
+        CRepository* iScreensaverRepository;
+        CRepository* iLightRepository;
+        CRepository* iGSVariationRepository;
+        CRepository* iAvkonRepository;
+        // Used for OperatorLogo
+        CCenRepNotifyHandler* iNotifyHandlerForOpLogo;
+        CCenRepNotifyHandler* iNotifyHandlerForOpLogoVisible;
+        CGSDisplayPluginContainer* iContainer;
+
+        //P&S keys
+        RProperty* iCoreAppProperty;
+
+        //local variated constants
+        TInt iLocalVariationValues;
+
+        CGSBackgroundImage* iBackgroundApi;
+    };
+
+#endif //GSDISPLAYPLUGINMODEL_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GsDisplayPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains common definitions for menu id:s
+*
+*/
+
+
+#ifndef GSDISPLAYPLUGIN_HRH
+#define GSDISPLAYPLUGIN_HRH
+
+// commands
+enum TGSDispMenuCommands
+    {
+    EGSCmdDispAppChange = 1,
+    EGSCmdWNSelect,
+    EGSCmdWNEdit,
+    EGSCmdShowWelcomeNoteSettingPage,
+    EGSCmdShowContrastSettingPage,
+    EGSCmdShowColorPaletteSettingPage,
+    EGSCmdShowScreenSaverObjectSettingPage,
+    EGSCmdShowScreenSaverPeridSettingPage,
+    EGSCmdShowLightSensorSettingPage, 
+    EGSCmdShowBacklightSettingPage,
+    EGSCmdShowBrightnessSettingPage,
+    EGSCmdShowAmbientLightSensorSettingPage,
+    EGSCmdShowPowerSaveLedSettingPage,
+    EGSCmdShowOperatorLogoSettingPage
+    };
+
+// device display
+enum {
+    EGSSettIdContrast,
+    EGSSettIdBrightness,
+    EGSSettIdAmbientLightSensor,
+    EGSSettIdDisplayTextSize,
+    EGSSettIdSSP,
+    EGSSettIdSSO,
+    EGSSettIdWNI,
+    EGSSettIdBacklight,
+    EGSSettIdPowerSaveLed,
+    EGSSettIdOperatorLogo
+    };
+
+// own notes
+enum TOwnNotes {
+    EImageLoadWaitNote = 1
+    };
+
+
+#endif //  GSDISPLAYPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/PSMDisplayPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef PSMDISPLAYPLUGIN_H
+#define PSMDISPLAYPLUGIN_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#include <psmpluginbase.h>
+#include <centralrepository.h>
+
+class MPsmSettingsProvider;
+class MPsmPluginCallback;
+class CGSDisplayPluginModel;
+class CPowerSaveDisplayMode;
+
+/**
+*  PSMDisplay plugin stub
+*
+*  @lib ?library
+*  @since Series ?XX ?SeriesXX_version
+*/
+class CPSMDisplayPlugin : public CPsmPluginBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+		* @return The created object.
+        */
+        static CPSMDisplayPlugin* NewL( TPsmPluginCTorParams& initParams );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPSMDisplayPlugin();
+
+    public:
+
+        // From CPsmPluginBase
+        void NotifyModeChange( const TInt aMode );
+
+	private:
+
+	    CPSMDisplayPlugin( TPsmPluginCTorParams& aInitParams );
+	    void ConstructL();
+
+        /**
+        *  Internal leaving function calleb from non-leaving NotifyModeChange.
+        */
+        void DoModeChangeL( const TInt aMode );
+        
+    private: // data
+        
+        CGSDisplayPluginModel *iModel;
+
+        // For automatic brigthness control
+        CPowerSaveDisplayMode *iDisplayModel;
+        
+    };
+
+#endif // PSMDISPLAYPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1339 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Display sub-folder
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSDisplayPlugin.h"
+
+#ifdef FF_POWER_SAVE
+    #include "GSDisplayPluginAO.h"
+#endif // FF_POWER_SAVE
+
+#include "GSDisplayPluginModel.h"
+#include "GSDisplayPluginContainer.h"
+#include "GsDisplayPlugin.hrh"
+#include "GsLogger.h"
+
+#include <coeaui.h>
+#include <hlplch.h>             // For HlpLauncher
+#include <gulicon.h>
+#include <bautils.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <aknnotedialog.h>
+#include <AknWaitDialog.h>
+#include <aknslider.h>
+#include <aknradiobuttonsettingpage.h>
+#include <aknslidersettingpage.h>
+#include <aknnotewrappers.h>
+#include <aknViewAppUi.h>
+#include <AknsWallpaperUtils.h>
+#include <AknWaitDialog.h>
+#include <akntextsettingpage.h>
+#include <telephonydomainpskeys.h>
+#include <imageconversion.h>
+
+#include <MGFetch.h>            // Image selection
+#include <DRMCommon.h>
+#include <GsDisplayPluginRsc.rsg>
+#include <gsprivatepluginproviderids.h>
+#include <gsmainview.h>
+#include <gsbasecontainer.h>
+#include <gscommon.hrh>
+#include <gsdisplayplugin.mbg> // Icons
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+const TInt KGSImageWelcomeNote = 2;
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+//_LIT( KGSWelcomeNoteTextValue, "" );
+//_LIT( KGSScreenSaverTextValue, "" );
+
+_LIT( KGSDisplayPluginResourceFileName, "z:GSDisplayPluginRsc.rsc" );
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS =================================
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::CGSDisplayPlugin()
+//
+// Constructor
+// ----------------------------------------------------------------------------
+//
+CGSDisplayPlugin::CGSDisplayPlugin()
+  : iUpdateSSText( EFalse ),
+    iUpdateWNote( ETrue ),
+    iReshowOprtSetPage( EFalse ),
+    iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::NewL()
+//
+// Symbian OS default constructor
+// ----------------------------------------------------------------------------
+CGSDisplayPlugin* CGSDisplayPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSDisplayPlugin* self = new( ELeave ) CGSDisplayPlugin();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::ConstructL()
+//
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+void CGSDisplayPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+
+    // Find the resource file
+    TParse parse;
+    parse.Set( KGSDisplayPluginResourceFileName,
+               &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+
+    // Open resource file
+    iResourceLoader.OpenL( fileName );
+
+    BaseConstructL( R_GS_DISPL_VIEW );
+
+#ifdef FF_POWER_SAVE    
+    iPsmActive = CGSDisplayPluginAO::NewL();
+    iPsmActive->SetView( this );
+#endif // FF_POWER_SAVE    
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::~CGSDisplayPlugin
+//
+// Destructor
+// ----------------------------------------------------------------------------
+CGSDisplayPlugin::~CGSDisplayPlugin()
+    {
+    CloseDialog();
+    FeatureManager::UnInitializeLib();
+    iResourceLoader.Close();
+
+#ifdef FF_POWER_SAVE
+    delete iPsmActive;
+#endif // FF_POWER_SAVE
+    
+    if ( iImageHandler )
+        {
+        delete iImageHandler;
+        }
+
+    if ( iModel )
+        {
+        iModel = NULL;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// TUid CGSDisplayPlugin::Id()
+//
+// Returns plug-in's ID.
+// ----------------------------------------------------------------------------
+TUid CGSDisplayPlugin::Id() const
+    {
+    return KGSDisplayPluginUid;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::HandleCommandL
+//
+// Handles commands directed to this class.
+// ----------------------------------------------------------------------------
+void CGSDisplayPlugin::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EGSMSKCmdAppChange:
+            if ( EGSSettIdOperatorLogo == Container()->CurrentFeatureId() )
+                {
+                ChangeOperatorLogoSettingL( EFalse );
+                break;
+                }
+        case EGSCmdAppChange:
+            HandleListBoxSelectionL();
+            break;
+        case EAknSoftkeyBack:
+            #ifdef RD_CONTROL_PANEL
+                iAppUi->ActivateLocalViewL( KGSGenPluginUid );
+            #else //RD_CONTROL_PANEL
+                iAppUi->ActivateLocalViewL( KGSPrslnPluginUid );
+            #endif //RD_CONTROL_PANEL
+            break;
+        case EGSCmdShowPowerSaveLedSettingPage:
+            ShowPowerSaveLedSettingPageL( ETrue );
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::UpdateListBoxL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::UpdateListBoxL( TInt aItemId )
+    {
+    if( Container() )
+        {
+        Container()->UpdateListBoxL( aItemId );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::Container
+//
+// Return handle to container class.
+// ----------------------------------------------------------------------------
+//
+CGSDisplayPluginContainer* CGSDisplayPlugin::Container()
+    {
+    return static_cast<CGSDisplayPluginContainer*>( iContainer );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::NewContainerL()
+// Creates new iContainer.
+//
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::NewContainerL()
+    {
+    // container takes a CAknView pointer
+    iContainer = new( ELeave ) CGSDisplayPluginContainer( /* *this*/ );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::DoActivateL
+//
+// First method called by the Avkon framwork to invoke a view.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                    TUid aCustomMessageId,
+                                    const TDesC8& aCustomMessage )
+    {
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+    iModel = Container()->Model();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::DoDeactivate
+//
+// Called by the Avkon view framework when closing.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::DoDeactivate()
+    {
+    CGSBaseView::DoDeactivate();
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::HandleListBoxSelectionL()
+//
+// Handles events raised through a rocker key
+// ----------------------------------------------------------------------------
+void CGSDisplayPlugin::HandleListBoxSelectionL()
+    {
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+    
+    switch ( currentFeatureId )
+        {
+        case EGSSettIdContrast:
+            if( iModel->ContrastL() != KErrNotSupported )
+                {
+#ifdef FF_POWER_SAVE                    
+                if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                    {
+                    // If PSM is on, block setting:
+                    DisplayBlockNoteL();
+                    }
+                else
+                    {
+#endif // FF_POWER_SAVE                    
+                    ShowContrastSettingPageL();
+#ifdef FF_POWER_SAVE
+                    }
+#endif // FF_POWER_SAVE
+                }
+
+            
+            break;
+        case EGSSettIdBrightness:
+            if( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl) )
+                {
+#ifdef FF_POWER_SAVE            
+                if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                    {
+                    // If PSM is on, block setting:
+                    DisplayBlockNoteL();
+                    }
+                else
+                    {
+#endif // FF_POWER_SAVE                    
+                    ShowBrightnessSettingPageL();
+#ifdef FF_POWER_SAVE
+                    }
+#endif // FF_POWER_SAVE              
+                }
+            break;
+        case EGSSettIdSSP:
+#ifdef FF_POWER_SAVE            
+            if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                {
+                // If PSM is on, block setting:
+                DisplayBlockNoteL();
+                }
+            else
+                {
+#endif // FF_POWER_SAVE 
+                ShowScreenSaverPeriodSettingPageL();
+#ifdef FF_POWER_SAVE
+                }
+#endif // FF_POWER_SAVE      
+            break;
+        case EGSSettIdBacklight:
+#ifdef FF_POWER_SAVE            
+            if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                {
+                // If PSM is on, block setting:
+                DisplayBlockNoteL();
+                }
+            else
+                {
+#endif // FF_POWER_SAVE                
+                ShowBacklightSettingPageL ( );
+#ifdef FF_POWER_SAVE
+                }
+#endif // FF_POWER_SAVE            
+            break;
+        case EGSSettIdAmbientLightSensor:
+            {
+#ifdef FF_POWER_SAVE            
+            if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                {
+                // If PSM is on, block setting:
+                DisplayBlockNoteL();
+                }
+            else
+                {
+#endif // FF_POWER_SAVE                    
+                ShowAmbientLightSensorSettingPageL();
+#ifdef FF_POWER_SAVE
+                }
+#endif // FF_POWER_SAVE      
+            }
+            break;
+        case EGSSettIdWNI:
+            ShowWelcomeNoteSettingPageL();
+            break;
+        case EGSSettIdDisplayTextSize:
+            if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) )
+                {
+                ShowDisplayTextSizeSettingPageL();
+                }
+            break;
+        case EGSSettIdPowerSaveLed:
+            {
+#ifdef FF_POWER_SAVE            
+            if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                {
+                // If PSM is on, block setting:
+                DisplayBlockNoteL();
+                }
+            else
+                {
+#endif // FF_POWER_SAVE                    
+                ShowPowerSaveLedSettingPageL( EFalse );
+#ifdef FF_POWER_SAVE
+                }
+#endif // FF_POWER_SAVE 
+            }
+            break;
+        case EGSSettIdOperatorLogo:
+        	do
+        		{
+        		iReshowOprtSetPage = EFalse;
+        		ChangeOperatorLogoSettingL( ETrue );
+        		}
+        	while ( iReshowOprtSetPage );
+            break;
+        default:
+            break;
+        }
+    }
+
+// ========================= From CGSPluginInterface ==================
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::GetCaption
+//
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_DISPLAY_VIEW_CAPTION );
+
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::PluginProviderCategory
+//
+// A means to identify the location of this plug-in in the framework.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPlugin::PluginProviderCategory() const
+    {
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowContrastSettingPageL()
+//
+// Display the contrast setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowContrastSettingPageL()
+    {
+    TInt currentValue;
+    TInt oldValue;
+    oldValue = iModel->ContrastL();
+
+    currentValue = oldValue;
+
+    CAknSliderSettingPage* dlg = new( ELeave ) CAknSliderSettingPage(
+                                 R_CONTRAST_SETTING_PAGE, currentValue );
+
+    dlg->SetSettingId( KGSContrastSettingId );
+    dlg->SetSettingPageObserver( this );
+
+    if ( !dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+#ifdef FF_POWER_SAVE
+        if ( iPsmActive->Mode() == EPsmsrvModeNormal )
+            {
+#endif //FF_POWER_SAVE
+            iModel->SetContrastL( oldValue );
+#ifdef FF_POWER_SAVE 
+            }
+#endif //FF_POWER_SAVE
+        }
+    UpdateListBoxL( EGSSettIdContrast );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowBrightnessSettingPageL()
+//
+// Display the brightness setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowBrightnessSettingPageL()
+    {
+    TInt currentValue;
+    TInt oldValue = iModel->BrightnessL();
+
+    currentValue = oldValue;
+
+    CAknSliderSettingPage* dlg = new( ELeave ) CAknSliderSettingPage(
+                                 R_BRIGHTNESS_SETTING_PAGE, currentValue );
+
+    dlg->SetSettingId( KGSBrightnessSettingId );
+    dlg->SetSettingPageObserver( this );
+
+    if ( !dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged ) )
+        {
+#ifdef FF_POWER_SAVE
+        if ( iPsmActive->Mode() == EPsmsrvModeNormal )
+            {
+#endif //FF_POWER_SAVE
+            iModel->SetBrightnessL( oldValue );
+#ifdef FF_POWER_SAVE 
+            }
+#endif //FF_POWER_SAVE
+        }
+    UpdateListBoxL( EGSSettIdBrightness );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowAmbientLightSensorSettingPageL()
+//
+// Display the ambient light sensor setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowAmbientLightSensorSettingPageL()
+    {
+    TInt currentValue;
+    TInt oldValue = iModel->AmbientLightSensorL();
+
+    currentValue = oldValue;
+
+    CAknSliderSettingPage* dlg = new( ELeave ) CAknSliderSettingPage(
+        R_AMBIENT_LIGHT_SENSOR_SETTING_PAGE, currentValue );
+
+    dlg->SetSettingId( KGSAmbientLightSensorId );
+    dlg->SetSettingPageObserver( this );
+
+    if ( !dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+#ifdef FF_POWER_SAVE
+        if ( iPsmActive->Mode() == EPsmsrvModeNormal )
+            {
+#endif //FF_POWER_SAVE
+            iModel->SetAmbientLightSensorL( oldValue );
+#ifdef FF_POWER_SAVE 
+            }
+#endif //FF_POWER_SAVE
+        }
+    UpdateListBoxL( EGSSettIdAmbientLightSensor );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowScreenSaverPeriodSettingPageL()
+//
+// Display the screen saver period (time out) setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowScreenSaverPeriodSettingPageL()
+    {
+    TInt sliderValue = iModel->ScreenSaverPeriodL();
+
+    CAknSettingPage* dlg = new( ELeave ) CAknSliderSettingPage(
+                           R_SCREEN_SAVER_PERIOD_SETTING_PAGE, sliderValue );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+#ifdef FF_POWER_SAVE         
+        if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+            {
+            DisplayBlockNoteL();
+            }
+        else
+            {
+#endif //FF_POWER_SAVE
+            iModel->SetScreenSaverPeriodL( sliderValue );
+#ifdef FF_POWER_SAVE 
+            }
+#endif //FF_POWER_SAVE
+        UpdateListBoxL( EGSSettIdSSP );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowBacklightSettingPageL()
+//
+// Display the backlight time-out setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowBacklightSettingPageL()
+    {
+    TInt sliderValue = iModel->BacklightPeriodL();
+
+    CAknSettingPage* dlg = new( ELeave ) CAknSliderSettingPage(
+                           R_BACKLIGHT_PERIOD_SETTING_PAGE, sliderValue );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+#ifdef FF_POWER_SAVE 
+        if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+            {
+            DisplayBlockNoteL();
+            }
+        else
+            {
+#endif //FF_POWER_SAVE
+            iModel->SetBacklightPeriodL( sliderValue );
+#ifdef FF_POWER_SAVE 
+            }
+#endif //FF_POWER_SAVE
+        UpdateListBoxL( EGSSettIdBacklight );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::HandleSettingPageEventL
+//
+// Handle any setting page related events
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::HandleSettingPageEventL( CAknSettingPage* aSettingPage,
+                                     TAknSettingPageEvent aEventType )
+    {
+    TInt id = aSettingPage->SettingId();
+
+    if ( aEventType == EEventSettingChanged )
+        {
+        switch ( id )
+            {
+            case KGSContrastSettingId:
+                if( iModel->ContrastL() != KErrNotSupported )
+                    {
+#ifdef FF_POWER_SAVE 
+                    if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                        {
+                        DisplayBlockNoteL();
+                        static_cast<CAknSliderSettingPage*>( aSettingPage )->
+                            SliderControl()->SetValueL( iModel->ContrastL() );
+                        }
+                    else
+                        {
+#endif //FF_POWER_SAVE
+                        iModel->SetContrastL( static_cast<CAknSliderSettingPage*>
+                            ( aSettingPage )->SliderControl()->Value() );
+#ifdef FF_POWER_SAVE 
+                        }
+#endif //FF_POWER_SAVE
+                    }
+                break;
+            case KGSBrightnessSettingId:
+                if( FeatureManager::FeatureSupported(
+                                    KFeatureIdBrightnessControl) )
+                    {
+#ifdef FF_POWER_SAVE 
+                    if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                        {
+                        DisplayBlockNoteL();
+                        static_cast<CAknSliderSettingPage*>( aSettingPage )->
+                            SliderControl()->SetValueL( iModel->BrightnessL() );
+                        }
+                    else
+                        {
+#endif //FF_POWER_SAVE
+                        iModel->SetBrightnessL( static_cast<CAknSliderSettingPage*>
+                            ( aSettingPage )->SliderControl()->Value() );
+#ifdef FF_POWER_SAVE 
+                        }
+#endif //FF_POWER_SAVE
+                    }
+                break;
+            case KGSAmbientLightSensorId:
+#ifdef FF_POWER_SAVE
+                if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                    {
+                    DisplayBlockNoteL();
+                    static_cast<CAknSliderSettingPage*>( aSettingPage )->
+                        SliderControl()->SetValueL( iModel->AmbientLightSensorL() );
+                    }
+                else
+                    {
+#endif //FF_POWER_SAVE
+                    iModel->SetAmbientLightSensorL( static_cast<CAknSliderSettingPage*>
+                         ( aSettingPage )->SliderControl()->Value() );
+#ifdef FF_POWER_SAVE 
+                    }
+#endif //FF_POWER_SAVE
+                break;
+            default:
+                break;
+            }
+        }
+
+    if ( aEventType == EEventSettingOked )
+        {
+        TInt current;
+
+        switch ( id )
+            {
+            case KGSWelcomeNoteSettingId:
+                current =
+                   static_cast<CAknRadioButtonSettingPage*> ( aSettingPage )->
+                   ListBoxControl()->CurrentItemIndex();
+                if ( current == KGSWNTextIndex )
+                    {
+                    ShowWelcomeNoteTextQueryL();
+                    }
+                else if ( current == KGSWNImageIndex )
+                    {
+                    ShowWelcomeNoteImageListL();
+                    }
+                break;
+            default:
+                break;
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::VerifySelectionL()
+//
+// An overloaded method from MMGFetchVerifier interface class
+// ---------------------------------------------------------------------------
+//
+TBool CGSDisplayPlugin::VerifySelectionL( const MDesCArray* aSelectedFiles )
+    {
+    const TBool KGSDrmProtectedContent = ETrue;
+
+    TBool ret = ETrue;
+    //
+    if ( aSelectedFiles->MdcaCount() == 1 )
+        {
+        const TPtrC fileName( aSelectedFiles->MdcaPoint( 0 ) );
+
+        // First, check if the selected file is DRM protected
+        if  ( ret && CheckDRMProtectionL( fileName ) ==
+                    KGSDrmProtectedContent )
+            {
+            // display the note to user
+            // Show information note
+            HBufC* prompt = iCoeEnv->AllocReadResourceLC(
+                                          R_GS_DRM_NOT_ALLOWED );
+
+            CAknInformationNote* note =
+                new( ELeave ) CAknInformationNote( ETrue );
+            note->ExecuteLD( *prompt );
+
+            CleanupStack::PopAndDestroy( prompt );
+            ret = EFalse;
+            }
+
+        // Next, check whether the image header is valid
+        if  ( ret )
+            {
+            CImageDecoder* imageDecoder = NULL;
+            TRAPD( err, imageDecoder = CImageDecoder::FileNewL(
+                  iCoeEnv->FsSession(), fileName, ContentAccess::EPeek ) );
+
+            if  ( err != KErrNone )
+                {
+                // Show information note
+                HBufC* prompt = iCoeEnv->AllocReadResourceLC(
+                                                  R_GS_IMAGE_CORRUPTED );
+                CAknInformationNote* note =
+                    new( ELeave ) CAknInformationNote( ETrue );
+                note->ExecuteLD(*prompt);
+                CleanupStack::PopAndDestroy( prompt );
+
+                ret = EFalse;
+                }
+            delete imageDecoder;
+            }
+        }
+
+    return ret;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowWelcomeNoteSettingPageL()
+//
+// Display welcome note setting page
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowWelcomeNoteSettingPageL()
+    {
+    iUpdateWNote = ETrue;
+
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                                        R_WELCOME_NOTE_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    TInt currentItem = iModel->WelcomeNoteTypeL();
+    iWelcomeNoteType = currentItem;
+
+    CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage(
+                                  R_WELCOME_NOTE_SETTING_PAGE,
+                                  currentItem, items );
+
+    dlg->SetSettingId( KGSWelcomeNoteSettingId );
+    dlg->SetSettingPageObserver(this);
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged )
+         && iUpdateWNote && currentItem != KGSImageWelcomeNote
+         )
+        {
+        iModel->SetWelcomeNoteTypeL( currentItem );
+        UpdateListBoxL( EGSSettIdWNI );
+        }
+
+    CleanupStack::PopAndDestroy( items );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowWelcomeNoteTextQueryL()
+//
+// Display welcome note text input dialog
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowWelcomeNoteTextQueryL()
+    {
+    TBuf<KGSMaxWNText> note;
+    iModel->WelcomeNoteTextL( note );
+
+    CAknTextQueryDialog* dlg = new ( ELeave ) CAknTextQueryDialog( note );
+    if( dlg->ExecuteLD( R_WELCOME_NOTE_TEXT_QUERY ) )
+        {
+        iModel->SetWelcomeNoteTextL( note );
+        iUpdateWNote = ETrue;
+        }
+    else
+        {
+        iUpdateWNote = EFalse;
+        }
+   }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowWelcomeNoteImageListL()
+//
+// Display welcome note image list from media gallery
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowWelcomeNoteImageListL()
+    {
+    // If the MGFetch already launched, return.
+    if ( iLaunchedImageFetch )
+        {
+        return;
+        }
+    CDesCArray* selectedFiles = new ( ELeave ) CDesCArrayFlat( 1 );
+    CleanupStack::PushL( selectedFiles );
+
+    iLaunchedImageFetch = ETrue;
+    TBool ret = MGFetch::RunL( *selectedFiles, EImageFile, EFalse, this );
+    iLaunchedImageFetch = EFalse;
+
+    if ( ret && selectedFiles->MdcaCount() == 1 )
+        {
+        iImageHandler = CGSAsyncImageHandling::NewL( iCoeEnv->FsSession(),
+                                               this, KGSWelcomeNoteImgPath );
+
+        TPtrC imagePath = selectedFiles->MdcaPoint( 0 );
+
+        //attempting to create private directory
+        RFs fs;
+        User::LeaveIfError( fs.Connect() );
+        CleanupClosePushL( fs );
+        TInt ret = fs.CreatePrivatePath( 2 );
+        CleanupStack::PopAndDestroy(); //fs
+
+        TRAPD( error,
+               iModel->BackgroundImage()->SetWelcomeNoteImageL( imagePath, *iImageHandler )
+             );
+
+        if ( error == KErrNone )
+            {
+            // Show wait note
+            ShowImageLoadWaitNoteL();
+            }
+        else
+            {
+            HandleImageErrorsL( error );
+            }
+        }
+    else
+        {
+        iUpdateWNote = EFalse;
+        }
+
+    CleanupStack::PopAndDestroy( selectedFiles );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowDisplayTextSizeSettingPageL()
+//
+// Display display text size setting page
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowDisplayTextSizeSettingPageL()
+    {
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                                     R_DISPLAY_TEXT_SIZE_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    TInt currentItem = iModel->DisplayTextSizeL();
+    // get the UI index from container
+    Container()->MapZoomLevelToUi( currentItem );
+    // store the current value for comparison
+    TInt oldItem = currentItem;
+
+    CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage(
+                                  R_DISPLAY_TEXT_SIZE_SETTING_PAGE,
+                                  currentItem, items );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        if( currentItem != oldItem )
+            {
+            // get the Avkon value from UI index
+            Container()->MapZoomLevelFromUi( currentItem );
+            // set Avkon value to CenRep. As an additional check, confirm
+            // from feature manager that zooming is supported.
+            if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) )
+                {
+                iModel->SetDisplayTextSizeL( currentItem );
+                }
+             // now inform all open apps of the switch
+             // note that app needs software event capability to call this API
+            TWsEvent event;
+            event.SetType( KEikDynamicLayoutVariantSwitch );
+            iEikonEnv->WsSession().SendEventToAllWindowGroups( event );
+            }
+
+        UpdateListBoxL( EGSSettIdDisplayTextSize );
+        }
+
+    CleanupStack::PopAndDestroy( items );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowPowerSaveLedSettingPageL()
+//
+// Display the screen saver object setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowPowerSaveLedSettingPageL( TBool aSettingPage )
+    {
+
+    CDesCArrayFlat* items =
+        iCoeEnv->ReadDesC16ArrayResourceL( R_POWER_SAVE_LED_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    TInt currentItem = iModel->PowerSaveLedL();
+
+    if( aSettingPage )
+        {
+        CAknRadioButtonSettingPage* dlg =
+            new ( ELeave ) CAknRadioButtonSettingPage(
+                                   R_POWER_SAVE_LED_SETTING_PAGE,
+                                   currentItem, items );
+
+        if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+            {
+            iModel->SetPowerSaveLedL( currentItem );
+            UpdateListBoxL( EGSSettIdPowerSaveLed );
+            }
+        }
+    else
+        {
+        iModel->SetPowerSaveLedL( !currentItem );
+        UpdateListBoxL( EGSSettIdPowerSaveLed );
+        }
+    CleanupStack::PopAndDestroy( items );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ImageHandlingComplete()
+//
+// Method derived from MGSSyncImageHandlingObserver
+// Run when the asynchronous image converting is complete
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ImageHandlingCompleteL( TInt aError )
+    {
+    if ( aError != KErrNone )
+        {
+        HandleImageErrorsL( aError );
+        }
+    else
+        {
+        iModel->SetWelcomeNoteTypeL( KGSImageWelcomeNote );
+        UpdateListBoxL( EGSSettIdWNI );
+        }
+    HideImageLoadWaitNoteL();
+
+    if( iImageHandler )
+        {
+        delete iImageHandler;
+        iImageHandler = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowImageLoadWaitNoteL()
+//
+// Display image load wait note dialog.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ShowImageLoadWaitNoteL()
+    {
+    if ( !iWaitDialog )
+        {
+        iWaitDialog = new( ELeave ) CAknWaitDialog(
+                      ( REINTERPRET_CAST(CEikDialog**,
+                      &iWaitDialog ) ), ETrue );
+
+        iWaitDialog->ExecuteDlgLD( CAknNoteDialog::ENoTone,
+                                   R_IMAGE_LOAD_WAIT_NOTE );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::HideImageLoadWaitNoteL()
+//
+// Hide image load wait note dialog.
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::HideImageLoadWaitNoteL()
+    {
+    if ( iWaitDialog )
+        {
+        iWaitDialog->ProcessFinishedL(); // deletes the dialog
+        iWaitDialog = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::CheckDRMProtectionL
+//
+// Check if the selected image file is DRM protected.
+// ---------------------------------------------------------------------------
+//
+TBool CGSDisplayPlugin::CheckDRMProtectionL( const TDesC& aOriginalFileName )
+    {
+    TBool isProtected( EFalse );
+    DRMCommon* drmClient = DRMCommon::NewL();
+    CleanupStack::PushL( drmClient );
+    TInt error = drmClient->Connect();
+    if ( error != DRMCommon::EOk )
+        {
+        User::Leave( KErrCorrupt );
+        }
+
+    if ( aOriginalFileName != KNullDesC )
+        {
+        error = drmClient->IsProtectedFile( aOriginalFileName, isProtected );
+        if ( error != DRMCommon::EOk )
+            {
+            User::Leave( KErrCorrupt );
+            }
+        }
+
+    CleanupStack::PopAndDestroy( drmClient );
+    return isProtected;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPlugin::HandleImageErrorsL
+//
+// Prompt image related errors to the user
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::HandleImageErrorsL( TInt aError )
+    {
+    if ( aError )
+        {
+        TInt resourceId;
+        switch( aError )
+            {
+            case KErrNotSupported:
+            case KErrUnderflow:
+                // Image is corrupted or in wrong format
+                resourceId = R_GS_IMAGE_CORRUPTED;
+                break;
+            case KErrDiskFull:
+            case KErrNoMemory:
+                // Image is too large
+                resourceId = R_GS_IMAGE_TOO_LARGE;
+                break;
+            default:
+                // Better to give some error message than result in CONE5 panic:
+                resourceId = R_GS_IMAGE_CORRUPTED;
+                //User::LeaveIfError( aError );
+                break;
+            }
+
+        // Show information note
+        HBufC* prompt = iCoeEnv->AllocReadResourceLC( resourceId );
+        CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue );
+        note->ExecuteLD( *prompt );
+
+        // Restoring previous welcome note value
+        iModel->SetWelcomeNoteTypeL( iWelcomeNoteType );
+        UpdateListBoxL( EGSSettIdWNI );
+        CleanupStack::PopAndDestroy( prompt );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPlugin::DynInitMenuPaneL()
+//
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSDisplayPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                         CEikMenuPane* aMenuPane )
+    {
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+//
+// ----------------------------------------------------------------------------------
+// CGSDisplayPlugin::UpdateViewL()
+// ----------------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::UpdateViewL()
+    {
+    // Check what view is active, update if needed.
+    // If displaying main view, update all PSM changed items.
+    TVwsViewId activeView;
+    CEikonEnv::Static()->EikAppUi()->GetActiveViewId( activeView );
+//    if( activeView.iViewUid == Id() )
+        {
+        __GSLOGSTRING( "[CGSDisplayPlugin] I am active!!!" );        
+        // Not too elegant - update only items that are affected by PSM
+        UpdateListBoxL( EGSSettIdContrast );
+        UpdateListBoxL( EGSSettIdBrightness );
+        UpdateListBoxL( EGSSettIdAmbientLightSensor );
+//        UpdateListBoxL( EGSSettIdDisplayTextSize );
+        UpdateListBoxL( EGSSettIdSSP );
+//        UpdateListBoxL( EGSSettIdSSO );
+//        UpdateListBoxL( EGSSettIdWNI );
+        UpdateListBoxL( EGSSettIdBacklight );
+//        UpdateListBoxL( EGSSettIdPowerSaveLed );
+        UpdateListBoxL( EGSSettIdOperatorLogo );
+        }
+    }
+
+#ifdef FF_POWER_SAVE
+// ----------------------------------------------------------------------------------
+// CGSDisplayPlugin::DisplayBlockNoteL()
+// ----------------------------------------------------------------------------------
+void CGSDisplayPlugin::DisplayBlockNoteL()
+    {
+    HBufC* prompt = iCoeEnv->AllocReadResourceLC(
+            R_GS_POWER_SAVING_PROTECTED_SETTINGS_INFONOTE );
+    CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue );
+    note->ExecuteLD( *prompt );
+    CleanupStack::PopAndDestroy( prompt );
+    }
+#endif // FF_POWER_SAVE
+
+
+// -----------------------------------------------------------------------------
+// CGSDisplayPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSDisplayPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpDevDisp,
+        KGSDefaultDisplayIconFileName,
+        EMbmGsdisplaypluginQgn_prop_cp_dev_disp,
+        EMbmGsdisplaypluginQgn_prop_cp_dev_disp_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    return icon;
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CGSDisplayPlugin::ChangeOperatorLogoSettingL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::ChangeOperatorLogoSettingL( TBool aUseSettingPage )
+    {
+    TInt currentValue = iModel->OperatorLogoL();
+    TBool isValueUpdated = EFalse;
+
+    if ( aUseSettingPage )
+        {
+        isValueUpdated = ShowOperatorLogoSettingPageL( currentValue );
+        }
+    else
+        {
+        if( currentValue == KGSSettingOff )
+            {
+            currentValue = KGSSettingOn;
+            }
+        else
+            {
+            currentValue = KGSSettingOff;
+            }
+        isValueUpdated = ETrue;
+        }
+    // Value has been changed -> store it:
+    if ( isValueUpdated )
+        {
+        iModel->SetOperatorLogoL( currentValue );
+
+        UpdateListBoxL( EGSSettIdOperatorLogo );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSDisplayPlugin::ShowOperatorLogoSettingPageL()
+//
+// Note: Lbx index of each value is only internal to this function. The
+// parameter given and modified is the actual operator logo value.
+// -----------------------------------------------------------------------------
+//
+TBool CGSDisplayPlugin::ShowOperatorLogoSettingPageL(
+    TInt& aOperatorLogoValue )
+    {
+    TBool isValueUpdated = EFalse;
+    TInt previousValue = aOperatorLogoValue;
+    TInt selectedIndex;
+
+    // Match aOperatorLogoValue value to lbx item index:
+    switch( aOperatorLogoValue )
+        {
+        case KGSSettingOn:
+            selectedIndex = KGSOpLogoLbxIndexOn;
+            break;
+        case KGSSettingOff:
+            selectedIndex = KGSOpLogoLbxIndexOff;
+            break;
+        }
+
+    CDesCArrayFlat* items =
+        iCoeEnv->ReadDesC16ArrayResourceL( R_OPLOGO_ON_OFF_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    if ( !iOprtLogoSettingPage )
+    	{
+    	iOprtLogoSettingPage = new (ELeave) CAknRadioButtonSettingPage(
+            R_OPERATOR_LOGO_SETTING_PAGE,
+            selectedIndex,
+            items );
+    	}
+
+    TBool ret = iOprtLogoSettingPage->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+    iOprtLogoSettingPage = NULL;
+    CleanupStack::PopAndDestroy( items );
+
+     // Match selected lbx item index to aOperatorLogoValue:
+    switch( selectedIndex )
+        {
+        case KGSOpLogoLbxIndexOn:
+            aOperatorLogoValue = KGSSettingOn;
+            break;
+        case KGSOpLogoLbxIndexOff:
+            aOperatorLogoValue = KGSSettingOff;
+            break;
+        }
+
+    if( aOperatorLogoValue != previousValue )
+        {
+        isValueUpdated = ETrue;
+        }
+    return isValueUpdated;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSDisplayPlugin::CloseDialog
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSDisplayPlugin::CloseDialog()
+    {
+    //Send ESC key sequence to setting dialog, so that it closes itself.
+    if ( iOprtLogoSettingPage )
+        {
+        iReshowOprtSetPage = ETrue;
+        TKeyEvent event;
+        event.iCode = EKeyEscape;
+        event.iScanCode = EStdKeyEscape;
+        event.iRepeats = 0;
+        TRAP_IGNORE( iCoeEnv->SimulateKeyEventL( event, EEventKeyDown );
+                     iCoeEnv->SimulateKeyEventL( event, EEventKey );
+                     iCoeEnv->SimulateKeyEventL( event, EEventKeyUp ); );
+        }
+    }
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginAO.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSDisplayPlugin.h"
+#include "GSDisplayPluginAO.h"
+#include "GsLogger.h"
+#include <psmsrvdomaincrkeys.h>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::CGSDisplayPluginAO
+// ----------------------------------------------------------------------------------
+CGSDisplayPluginAO::CGSDisplayPluginAO() : CActive( EPriorityStandard )
+    {
+    
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::~CGSDisplayPluginAO
+// ----------------------------------------------------------------------------------
+CGSDisplayPluginAO::~CGSDisplayPluginAO()
+    {
+    Cancel();
+    delete iPsmRepository;
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::DoCancel
+// ----------------------------------------------------------------------------------
+void CGSDisplayPluginAO::DoCancel()
+    {
+    iPsmRepository->NotifyCancel( KPsmCurrentMode );
+    }
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::RunL
+// ----------------------------------------------------------------------------------
+void CGSDisplayPluginAO::RunL()
+    {
+    // Request complete, notify request again and get new value
+    iPsmRepository->Get( KPsmCurrentMode, iPsmMode );
+    iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus );
+    SetActive();
+    __GSLOGSTRING1( "[CGSDisplayPluginAO::RunL] iPsmMode:%d", iPsmMode );
+
+    // Update display view when PSM mode has changed
+    iDisplayView->UpdateViewL();
+    }
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::RunError
+// ----------------------------------------------------------------------------------
+TInt CGSDisplayPluginAO::RunError( TInt /*aError*/ )
+    {
+    return KErrNone;
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::NewL
+// ----------------------------------------------------------------------------------
+CGSDisplayPluginAO* CGSDisplayPluginAO::NewL()
+    {
+    CGSDisplayPluginAO* self = new( ELeave ) CGSDisplayPluginAO();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::ConstructL
+// ----------------------------------------------------------------------------------
+void CGSDisplayPluginAO::ConstructL()
+    {
+    CActiveScheduler::Add ( this );
+    iPsmRepository = CRepository::NewL( KCRUidPowerSaveMode );
+    // Read from CenRep so iPsmMode gets correct init value
+    iPsmRepository->Get( KPsmCurrentMode, iPsmMode );
+    iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus );
+    SetActive();
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::SetView
+// ----------------------------------------------------------------------------------
+void CGSDisplayPluginAO::SetView( CGSDisplayPlugin* aDisplayView )
+    {
+    iDisplayView = aDisplayView;
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPluginAO::Mode
+// ----------------------------------------------------------------------------------
+TInt CGSDisplayPluginAO::Mode()
+    {
+    return iPsmMode;
+    }
+
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,701 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Display sub-folder
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "GSDisplayPluginContainer.h"
+#include "GSDisplayPluginModel.h"
+#include "GsDisplayPlugin.hrh"
+#include "GSDisplayPlugin.h"
+
+#include <bldvariant.hrh>
+#include <aknlists.h>
+#include <eikfrlb.h>
+#include <aknslider.h>
+#include <gulicon.h>
+#include <StringLoader.h>
+#include <featmgr.h>
+#include <AknUtils.h>
+#include <csxhelp/cp.hlp.hrh>
+#include <gsfwviewuids.h>     // for KUidGS
+#include <GsDisplayPluginRsc.rsg>
+#include <gslistbox.h>
+#include <AknsConstants.h>    //for determining skin change
+#include <AknDef.hrh>
+#include <AknIconArray.h>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+const   TInt    KGSBufSize128 = 128;
+const   TInt    KGSNumberOfIcons = 3;
+const   TInt    KGSContrastIndex = 0;
+const   TInt    KGSBrightnessIndex = 1;
+const   TInt    KGSAmbientLightSensorIndex = 2;
+const   TInt    KGSSliderIndexMin = 0;
+const   TInt    KGSBrightnessMax = 31;
+const   TInt    KGSALSMax = 5;
+
+// MODULE DATA STRUCTURES
+// current ordering is based on the resource structure.
+enum TZoomLevel
+    {
+    EZoomLargeInUi,
+    EZoomNormalInUi,
+    EZoomSmallInUi
+    };
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================== MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::ConstructL(const TRect& aRect)
+// Symbian OS two phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+    iModel = CGSDisplayPluginModel::NewL();
+    iModel->SetOwner( this );
+
+    BaseConstructL( aRect, R_GS_DISPLAY_VIEW_TITLE, R_DISPL_LBX );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::~CGSDisplayPluginContainer()
+//
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CGSDisplayPluginContainer::~CGSDisplayPluginContainer()
+    {
+    if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) )
+        {
+        delete iDispTxtSizeItems;
+        }
+
+    if ( iWelcomeItems )
+        {
+        delete iWelcomeItems;
+        }
+
+    if ( iLedItems )
+        {
+        delete iLedItems;
+        }
+    
+    if ( iOperatorLogoItems)
+        {
+        delete iOperatorLogoItems;
+        iOperatorLogoItems = NULL;
+        }
+
+    if ( iModel )
+        {
+        delete iModel;
+        iModel = NULL;
+        }
+
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::CGSDisplayPluginContainer()
+//
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CGSDisplayPluginContainer::CGSDisplayPluginContainer()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::ConstructListBoxL()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+    iListboxItemArray =
+        CGSListBoxItemTextArray::NewL( aResLbxId, *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+
+    if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) )
+        {
+        iDispTxtSizeItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                            R_DISPLAY_TEXT_SIZE_SETTING_PAGE_LBX );
+        }
+
+    iWelcomeItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                            R_WELCOME_NOTE_SETTING_PAGE_LBX );
+    iLedItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                            R_POWER_SAVE_LED_SETTING_PAGE_LBX );
+    iOperatorLogoItems = iCoeEnv->ReadDesC16ArrayResourceL(
+                            R_OPLOGO_ON_OFF_SETTING_PAGE_LBX );
+
+
+    CArrayPtr<CGulIcon>* icons =
+            new( ELeave ) CAknIconArray( KGSNumberOfIcons );
+    CleanupStack::PushL( icons );
+
+    CGulIcon* icon = CGulIcon::NewL();
+    CleanupStack::PushL( icon );
+
+    CGulIcon* icon2 = CGulIcon::NewL();
+    CleanupStack::PushL( icon2 );
+
+    CGulIcon* icon3 = CGulIcon::NewL();
+    CleanupStack::PushL( icon3 );
+
+    icons->AppendL( icon );
+    icons->AppendL( icon2 );
+    icons->AppendL( icon3 );
+
+    CEikFormattedCellListBox* listbox =
+              static_cast<CEikFormattedCellListBox*>( iListBox );
+    listbox->ItemDrawer()->FormattedCellData()->SetIconArray( icons );
+    CleanupStack::Pop( 4, icons ); // icons, icon & icon2 & icon3
+    iIconArray = listbox->ItemDrawer()->FormattedCellData()->IconArray();
+
+    CreateListBoxItemsL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::CreateListBoxItemsL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::CreateListBoxItemsL()
+    {
+    if( iModel->ContrastL() != KErrNotSupported )
+        {
+        MakeContrastItemL();
+        }
+
+    TInt pslnStatus = iModel->BackgroundImage()->GetPlnsStatus();
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl) )
+        {
+        MakeBrightnessItemL();
+        }
+
+    if( iModel->CheckScreenSaverTimeoutSupportL() )
+        {
+        MakeSSPItemL();
+        }
+
+    MakeBacklightItemL();
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdAmbientLightSensor ) )
+        {
+        MakeAmbientLightSensorItemL();
+        }
+
+    if( iModel->IsUWNoteSupportedL() )
+        {
+        MakeWNIItemL();
+        }
+
+    if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) )
+        {
+        MakeDisplayTextSizeItemL();
+        }
+
+    if ( iModel->CheckPowerSaveLedSupportL() )
+        {
+        MakePowerSaveLedItemL();
+        }
+    
+    if ( iModel->ShowOperatorLogoSettingL() )
+        {
+        // Make item to show operator logo
+        MakeOperatorLogoItemL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::UpdateListBoxL(TInt aItemId)
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::UpdateListBoxL( TInt aFeatureId )
+    {
+    switch ( aFeatureId )
+        {
+        case EGSSettIdContrast:
+            if( iModel->ContrastL() != KErrNotSupported )
+                {
+                MakeContrastItemL();
+                }
+            break;
+        case EGSSettIdBrightness:
+            if ( FeatureManager::FeatureSupported(
+                             KFeatureIdBrightnessControl ) )
+                {
+                MakeBrightnessItemL();
+                }
+            break;
+        case EGSSettIdSSP:
+            if( iModel->CheckScreenSaverTimeoutSupportL() )
+                {
+                MakeSSPItemL();
+                }
+            break;
+        case EGSSettIdBacklight:
+            MakeBacklightItemL();
+            break;
+        case EGSSettIdAmbientLightSensor:
+            if ( FeatureManager::FeatureSupported(
+                              KFeatureIdAmbientLightSensor ) )
+                {
+                MakeAmbientLightSensorItemL();
+                }
+            break;
+        case EGSSettIdWNI:
+            if( iModel->IsUWNoteSupportedL() )
+                {
+                MakeWNIItemL();
+                }
+            break;
+        case EGSSettIdDisplayTextSize:
+            if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) )
+                {
+                MakeDisplayTextSizeItemL();
+                }
+            break;
+        case EGSSettIdPowerSaveLed:
+            if ( iModel->CheckPowerSaveLedSupportL() )
+                {
+                MakePowerSaveLedItemL();
+                }
+            break;
+        case EGSSettIdOperatorLogo:
+            if ( iModel->ShowOperatorLogoSettingL() )
+                {
+                // Update operator logo settings
+                MakeOperatorLogoItemL();
+                }
+        default:
+            break;
+        }
+
+    iListBox->HandleItemAdditionL();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeContrastItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeContrastItemL()
+    {
+    TInt currentPos = iModel->ContrastL();
+
+    CreateBitmapL( currentPos, R_CONTRAST_SLIDER, KGSContrastIndex );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdContrast,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeBrightnessItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeBrightnessItemL()
+    {
+    TInt currentPos = iModel->BrightnessL();
+
+    if ( currentPos > KGSSliderIndexMin &&
+         currentPos <= KGSBrightnessMax )
+        {
+        CreateBitmapL( currentPos, R_BRIGHTNESS_SLIDER, KGSBrightnessIndex );
+
+        // And add to listbox
+        iListboxItemArray->SetItemVisibilityL( EGSSettIdBrightness,
+                           CGSListBoxItemTextArray::EVisible );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeAmbientLightSensorItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeAmbientLightSensorItemL()
+    {
+    TInt currentPos = iModel->AmbientLightSensorL();
+
+    if ( currentPos > KGSSliderIndexMin &&
+         currentPos <= KGSALSMax )
+        {
+        CreateBitmapL( currentPos, R_AMBIENT_LIGHT_SENSOR_SLIDER,
+                       KGSAmbientLightSensorIndex );
+
+        // And add to listbox
+        iListboxItemArray->SetItemVisibilityL( EGSSettIdAmbientLightSensor,
+                           CGSListBoxItemTextArray::EVisible );
+
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeSSPItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeSSPItemL()
+    {
+    TInt timeOut = iModel->ScreenSaverPeriodL();
+    HBufC* dynamicText = CAknSlider::CreateValueTextInHBufCL( timeOut,
+                                     R_SETTING_SCREEN_SAVER_SLIDER );
+
+    // for A&H number conversion
+    TPtr bufPtr = dynamicText->Des();
+    if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) )
+        {
+        AknTextUtils::LanguageSpecificNumberConversion( bufPtr );
+        }
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSSettIdSSP, dynamicText->Des() );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdSSP,
+                       CGSListBoxItemTextArray::EVisible );
+
+    delete dynamicText;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeBackLightItemL()
+//
+// Backlight timeout item
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeBacklightItemL()
+    {
+    TInt timeOut = iModel->BacklightPeriodL();
+    HBufC* dynamicText = CAknSlider::CreateValueTextInHBufCL( timeOut,
+                                     R_SETTING_BACKLIGHT_SLIDER );
+
+    // for A&H number conversion
+    TPtr bufPtr = dynamicText->Des();
+    if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) )
+        {
+        AknTextUtils::LanguageSpecificNumberConversion( bufPtr );
+        }
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSSettIdBacklight,
+                                        dynamicText->Des() );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdBacklight,
+                       CGSListBoxItemTextArray::EVisible );
+
+    delete dynamicText;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeDisplayTextSizeItemL()
+//
+// Display text size item
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeDisplayTextSizeItemL()
+    {
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    TInt textSize = iModel->DisplayTextSizeL();
+    // value is changed through the below method
+    MapZoomLevelToUi( textSize );
+
+    ptrBuffer = ( *iDispTxtSizeItems )[ textSize ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSSettIdDisplayTextSize, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdDisplayTextSize,
+                       CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeWNIItemL()
+//
+// Welcome note item
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeWNIItemL()
+    {
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    const TInt welcomeNoteTypeIndex = iModel->WelcomeNoteTypeL();
+    ptrBuffer = ( *iWelcomeItems )[ welcomeNoteTypeIndex ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSSettIdWNI, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdWNI,
+                       CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakePowerSaveLedItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakePowerSaveLedItemL()
+    {
+
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+
+    TInt objectSel = iModel->PowerSaveLedL();
+    ptrBuffer = ( *iLedItems )[ objectSel ];
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSSettIdPowerSaveLed, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdPowerSaveLed,
+        CGSListBoxItemTextArray::EVisible );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MakeOperatorLogoItemL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MakeOperatorLogoItemL()
+    {
+    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( dynamicText->Des() );
+    
+    TInt selectedItem = iModel->OperatorLogoL();
+    ptrBuffer = ( *iOperatorLogoItems )[ 1 - selectedItem ];
+    
+    iListboxItemArray->SetDynamicTextL( EGSSettIdOperatorLogo, ptrBuffer );
+    CleanupStack::PopAndDestroy( dynamicText );
+
+    iListboxItemArray->SetItemVisibilityL( EGSSettIdOperatorLogo, 
+            CGSListBoxItemTextArray::EVisible );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::CreateBitmapL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::CreateBitmapL( TInt aValue, TInt aResourceId,
+                                               TInt aIndex )
+    {
+    CGulIcon* icon =
+            CAknSlider::CreateSetStyleListBoxIconL( aValue, aResourceId );
+
+    if( icon )
+        {
+        delete iIconArray->At( aIndex );
+        iIconArray->At( aIndex ) = icon;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::CurrentFeatureId()
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginContainer::CurrentFeatureId( ) const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::GetHelpContext() const
+// Gets Help
+//
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_DISPLAY;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::HandleResourceChange()
+//
+// Handling changing of the skin
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::HandleResourceChange( TInt aType )
+    {
+    CCoeControl::HandleResourceChange( aType );
+    if ( aType == KAknsMessageSkinChange ||
+         aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRAP_IGNORE 
+            (
+            if( iModel->ContrastL() != KErrNotSupported )
+                {
+                MakeContrastItemL();
+                }
+            );
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl) )
+            {
+            TRAP_IGNORE( MakeBrightnessItemL() );
+            }
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdAmbientLightSensor ) )
+            {
+            TRAP_IGNORE( MakeAmbientLightSensorItemL() );
+            }
+        }
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
+                                           mainPaneRect);
+        SetRect( mainPaneRect );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MapZoomLevelToUi()
+//
+// Converts the value from Model's Avkon to setting page item index
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MapZoomLevelToUi( TInt& aCurrentZoom )
+    {
+    TInt textSize = EZoomNormalInUi;
+
+    switch( aCurrentZoom )
+        {
+        case EAknUiZoomSmall:
+            textSize = EZoomSmallInUi;
+            break;
+        case EAknUiZoomLarge:
+            textSize = EZoomLargeInUi;
+            break;
+        case EAknUiZoomNormal:
+        default:
+            textSize = EZoomNormalInUi;
+            break;
+        }
+
+    aCurrentZoom = textSize;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::MapZoomLevelFromUi()
+//
+// Converts the value from setting page item index to Model's Avkon value
+// ---------------------------------------------------------------------------
+//
+void CGSDisplayPluginContainer::MapZoomLevelFromUi ( TInt& aCurrentZoom )
+    {
+    TInt textSize = 0;
+
+    switch( aCurrentZoom )
+        {
+        case EZoomSmallInUi:
+            textSize = EAknUiZoomSmall;
+            break;
+        case EZoomLargeInUi:
+            textSize = EAknUiZoomLarge;
+            break;
+        case EZoomNormalInUi:
+        default:
+            textSize = EAknUiZoomNormal;
+            break;
+        }
+
+    aCurrentZoom = textSize;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSDisplayPluginContainer::Model()
+//
+// Return its member variable iModel.
+// ---------------------------------------------------------------------------
+//
+CGSDisplayPluginModel* CGSDisplayPluginContainer::Model()
+    {
+    return iModel;
+    }
+
+void CGSDisplayPluginContainer::CloseDialog()
+	{
+	CAknViewAppUi* appUi = static_cast<CAknViewAppUi*>( CCoeEnv::Static()->AppUi() );
+	CGSDisplayPlugin* view = static_cast<CGSDisplayPlugin*>( appUi->View(KGSDisplayPluginUid) );
+	view->CloseDialog();
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSDisplayPlugin
+*
+*/
+
+
+// INCLUDES
+#include "GSDisplayPlugin.h"
+
+#ifdef FF_POWER_SAVE
+    #include "PSMDisplayPlugin.h"
+#endif // FF_POWER_SAVE
+
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// CONSTANTS
+const TImplementationProxy KGSDisplayPluginImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10207441,	CGSDisplayPlugin::NewL )
+#ifdef FF_POWER_SAVE
+    ,
+	IMPLEMENTATION_PROXY_ENTRY( 0x2000B592,	CPSMDisplayPlugin::NewL )
+#endif // FF_POWER_SAVE    
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+//
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSDisplayPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+	return KGSDisplayPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,797 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Display Settings model implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSDisplayPluginModel.h"
+
+#include <hal.h>
+#include <e32math.h>
+#include <featmgr.h>
+#include <generalsettingsvariant.hrh>
+
+#include <settingsinternalcrkeys.h>
+#include <startupdomaincrkeys.h>
+#include <ScreensaverInternalCRKeys.h>
+#include <hwrmlightdomaincrkeys.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <AvkonInternalCRKeys.h> // for zooming
+#include <AknDef.hrh>
+#include "GsLogger.h"
+#include "SettingsPrivateCRKeys.h"
+
+// Used for OperatorLogo
+#include <commdb.h>
+#include <telephonydomainpskeys.h>
+#include "GSDisplayPluginContainer.h"
+#include "GsDisplayPlugin.hrh"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS =================================
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::NewL
+//
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSDisplayPluginModel* CGSDisplayPluginModel::NewL()
+    {
+    return CGSDisplayPluginModel::NewL( ETrue );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::NewL
+//
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSDisplayPluginModel* CGSDisplayPluginModel::NewL( TBool aInitBackgroundApi )
+    {
+    CGSDisplayPluginModel* self = new( ELeave ) CGSDisplayPluginModel;
+    CleanupStack::PushL( self );
+    self->ConstructL( aInitBackgroundApi );
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::CGSDisplayPluginModel
+//
+//
+// C++ default constructor can NOT contain any code, that might leave.
+// ----------------------------------------------------------------------------
+//
+CGSDisplayPluginModel::CGSDisplayPluginModel()
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::ConstructL
+//
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::ConstructL( TBool aInitBackgroundApi )
+    {
+    //__GSENGINELOGSTRING("CGSDisplayPluginModel::ConstructL begin");
+    FeatureManager::InitializeLibL();
+    
+    InitializeCentralRepositoryL();
+
+    //Background image DLL initializing
+    if( aInitBackgroundApi ) iBackgroundApi = CGSBackgroundImage::NewL();
+
+    User::LeaveIfError( iGSVariationRepository->Get(
+                        KSettingsVariationFlags, iLocalVariationValues ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::~CGSDisplayPluginModel
+//
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSDisplayPluginModel::~CGSDisplayPluginModel()
+    {
+    UninitializeCentralRepository();
+    FeatureManager::UnInitializeLib();
+    if( iBackgroundApi ) delete iBackgroundApi;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::InitializeCentralRepositoryL
+//
+// Creating and setting keys for the Central Repository
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::InitializeCentralRepositoryL()
+    {
+    iStartupConfRepository = CRepository::NewL( KCRUidStartupConf );
+    iScreensaverRepository = CRepository::NewL( KCRUidScreenSaver );
+    iPersonalizationRepository =
+            CRepository::NewL( KCRUidPersonalizationSettings );
+    iLightRepository = CRepository::NewL( KCRUidLightSettings );
+    iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation );
+    iAvkonRepository = CRepository::NewL( KCRUidAvkon );
+    
+    // start listening to CenRep key changes for Operator Logo on/off
+    iNotifyHandlerForOpLogo = CCenRepNotifyHandler::NewL( *this, 
+                           *iPersonalizationRepository,
+                           CCenRepNotifyHandler::EIntKey, 
+                           KSettingsDisplayOperatorLogo );
+    iNotifyHandlerForOpLogo->StartListeningL();
+    iNotifyHandlerForOpLogoVisible = CCenRepNotifyHandler::NewL( *this, 
+                           *iPersonalizationRepository,
+                           CCenRepNotifyHandler::EIntKey, 
+                           KSettingsShowOperatorLogoSetting );
+    iNotifyHandlerForOpLogoVisible->StartListeningL();
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::UninitializeCentralRepositoryL
+//
+// Removes Central Repository objects
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::UninitializeCentralRepository()
+    {
+    if ( iStartupConfRepository )
+        {
+        delete iStartupConfRepository;
+        iStartupConfRepository = NULL;
+        }
+    if ( iScreensaverRepository )
+        {
+        delete iScreensaverRepository;
+        iScreensaverRepository = NULL;
+        }
+    if ( iNotifyHandlerForOpLogo )
+        {
+        iNotifyHandlerForOpLogo->StopListening();
+        delete iNotifyHandlerForOpLogo;
+        }
+    if ( iNotifyHandlerForOpLogoVisible )
+        {
+        iNotifyHandlerForOpLogoVisible->StopListening();
+        delete iNotifyHandlerForOpLogoVisible;
+        }
+    if ( iPersonalizationRepository )
+        {
+        delete iPersonalizationRepository;
+        iPersonalizationRepository = NULL;
+        }
+    if ( iLightRepository )
+        {
+        delete iLightRepository;
+        iLightRepository = NULL;
+        }
+    if ( iGSVariationRepository )
+        {
+        delete iGSVariationRepository;
+        iGSVariationRepository = NULL;
+        }
+    if ( iAvkonRepository )
+        {
+        delete iAvkonRepository;
+        iAvkonRepository = NULL;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::WelcomeNoteTypeL
+//
+// Returns user welcome note type.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::WelcomeNoteTypeL()
+    {
+    TInt type;
+    User::LeaveIfError( iStartupConfRepository->Get( KStartupWelcomeNoteType,
+                                                     type ) );
+
+    return type;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetWelcomeNoteTypeL
+//
+// Sets user welcome note type.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetWelcomeNoteTypeL( const TInt aType )
+    {
+    User::LeaveIfError( iStartupConfRepository->
+                        Set( KStartupWelcomeNoteType, aType ) );
+
+    if ( aType != KGSWelcomeNoteTypeImage )
+        {
+        // It doesn't matter much if the image deletion fails,
+        // so no need to handle the error.
+        TRAP_IGNORE( iBackgroundApi->DeleteImageL( KGSWelcomeNoteImgPath ) );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::GetWelcomeNoteTextL
+//
+// Reads welcome note text from shared data and returns it
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::WelcomeNoteTextL( TDes& aNote )
+    {
+    User::LeaveIfError( iStartupConfRepository->Get( KStartupWelcomeNoteText,
+                                                     aNote ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetWelcomeNoteTextL
+//
+// Writes welcome note text to shared data
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetWelcomeNoteTextL( const TDesC& aNote )
+    {
+    User::LeaveIfError( iStartupConfRepository->Set( KStartupWelcomeNoteText,
+                                                     aNote ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::ContrastL
+//
+// Returns contrast value.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::ContrastL()
+    {
+    TInt contrast = 0;
+#ifndef __WINS__
+    if( HAL::Get( HAL::EDisplayContrast, contrast ) == KErrNotSupported )
+        {
+        return KErrNotSupported;
+        }
+#endif //__WINS__
+    return contrast;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetContrastL
+//
+// sets contrast value.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetContrastL( const TInt aContrast )
+    {
+#ifndef __WINS__
+    __GSLOGSTRING1("[CGSDisplayPluginModel::SetContrastL(%d)]", aContrast );
+    User::LeaveIfError( HAL::Set( HAL::EDisplayContrast, aContrast ) );
+#endif //__WINS__
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::ScreenSaverObjectL
+//
+// Returns screen saver mode.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::ScreenSaverObjectL()
+    {
+    TInt object = KErrNone;
+
+    User::LeaveIfError( iScreensaverRepository->Get( KScreenSaverObject,
+                                                     object ) );
+
+    return object;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetScreenSaverObjectL
+//
+// Sets screen saver mode.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetScreenSaverObjectL( const TInt aObject )
+    {
+    User::LeaveIfError( iScreensaverRepository->Set( KScreenSaverObject,
+                                                     aObject ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::GetScreenSaverTextL
+//
+// Reads screen saver text from shared data and returns it.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::GetScreenSaverTextL( TDes& aText )
+    {
+    User::LeaveIfError( iScreensaverRepository->Get( KScreenSaverText,
+                                                     aText ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetScreenSaverTextL
+//
+// Writes screen saver text to shared data.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetScreenSaverTextL( const TDesC& aText )
+    {
+    User::LeaveIfError( iScreensaverRepository->Set( KScreenSaverText,
+                                                     aText ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::ScreenSaverPeriodL
+//
+// Reads screen saver period from shared data and returns it.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::ScreenSaverPeriodL()
+    {
+    TInt period = KGSSettingOff;
+    User::LeaveIfError( iPersonalizationRepository->
+            Get( KSettingsScreenSaverPeriod, period ) );
+
+    return period;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetScreenSaverPeriodL
+//
+// Writes screen saver text to shared data.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetScreenSaverPeriodL( const TInt aPeriod )
+    {
+    User::LeaveIfError( iPersonalizationRepository->
+            Set( KSettingsScreenSaverPeriod, aPeriod ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::BacklightPeriodL
+//
+// Reads backlight timeout value from shared data and returns it.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::BacklightPeriodL()
+    {
+    TInt period = KGSSettingOff;
+    User::LeaveIfError( iLightRepository->
+                Get( KDisplayLightsTimeout, period ) );
+
+    return period;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetBacklightPeriodL
+//
+// Writes new backlight timeout value to shared data.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetBacklightPeriodL( const TInt aPeriod )
+    {
+    __GSLOGSTRING1("[CGSDisplayPluginModel::SetBacklightPeriodL(%d)]", aPeriod );
+    User::LeaveIfError( iLightRepository->
+            Set( KDisplayLightsTimeout, aPeriod ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::AmbientLightSensorL
+//
+// Returns Ambient Light Sensor value.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::AmbientLightSensorL()
+    {
+    TInt ret;
+    User::LeaveIfError( iLightRepository->Get( KLightSensorSensitivity,
+                                               ret ) );
+
+    return ScaleLightSensorValues( ret, ETrue );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetAmbientLightSensorL
+//
+// Sets Ambient Light Sensor value.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetAmbientLightSensorL(
+                            const TInt aSensorSensitivity )
+    {
+    TInt sensitivity;
+    sensitivity = ScaleLightSensorValues( aSensorSensitivity, EFalse );
+
+    User::LeaveIfError( iLightRepository->
+        Set( KLightSensorSensitivity, sensitivity ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::ScaleLightSensorValues
+//
+// Scaling Ambient Light Sensor values
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::ScaleLightSensorValues( TInt aValue,
+                                                    TBool aDirection )
+    {
+    TInt coeff = 25;
+    TInt ret = 0;
+
+    if( aDirection ) //scaling to slider steps
+        {
+        ret = ( aValue / coeff ) + 1;
+        }
+    else //scaling to sensor percentage
+        {
+        ret = ( aValue - 1 ) * coeff;
+        }
+
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::HandleNotifyInt
+//
+// Handle notification from MCenRepNotifyHandlerCallback
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::HandleNotifyInt( TUint32 aId, TInt /*aNewValue*/)
+    {
+    if ( aId == KSettingsDisplayOperatorLogo ||
+         aId == KSettingsShowOperatorLogoSetting )
+        {
+        iContainer->UpdateListBoxL(EGSSettIdOperatorLogo);
+        iContainer->CloseDialog();
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::ScaleIntensityValues
+//
+// Converts the slider control steps to Intensity values
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::ScaleIntensityValues( TInt aValue, TBool aSample )
+    {
+    TReal sampledValue;
+    TReal intResult;
+    TReal sampleCoeff = 3.226; //100 by 31
+    TInt aDecimalPlaces = 0;
+    TInt32 result;
+
+    if( aSample )
+        {
+        intResult = sampleCoeff * aValue;
+        }
+    else
+        {
+        intResult = aValue / sampleCoeff;
+        }
+
+    if( intResult > 1 )
+        {
+        Math::Round( sampledValue, intResult, aDecimalPlaces );
+        Math::Int( result, sampledValue );
+        }
+    else
+        {
+        result = 1;
+        }
+    return result;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetBackLightValueL
+//
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetBackLightValueL()
+    {
+    iCoreAppProperty->Attach( KPSUidCoreApplicationUIs, KLightsControl );
+
+    TLightsControl value = ELightsUninitialized;
+    iCoreAppProperty->Set( KPSUidCoreApplicationUIs,
+                           KLightsControl, value );
+
+    iCoreAppProperty->Cancel();
+
+    delete iCoreAppProperty;
+    iCoreAppProperty = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::IsUWNoteSupportedL
+//
+// Allow user welcome note item to be disabled, if required
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::IsUWNoteSupportedL()
+    {
+    TInt value = KGSSettingOff;
+    User::LeaveIfError( iPersonalizationRepository->
+            Get( KSettingsWelcomeNoteSupported, value ) );
+
+    return value;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::BrightnessL
+//
+// Returns brightness value from DosLights.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::BrightnessL()
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl ) )
+        {
+        TInt brightness;
+        User::LeaveIfError( iLightRepository->Get( KLightIntensity,
+                                                   brightness ) );
+
+        return ScaleIntensityValues( brightness, EFalse );
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetBrightnessL
+//
+// Sets brightness value to DosLights.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetBrightnessL( const TInt aBrightness )
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl ) )
+        {
+        TInt brightness;
+
+        brightness = ScaleIntensityValues( aBrightness, ETrue );
+        __GSLOGSTRING1("[CGSDisplayPluginModel::SetBrightnessL(%d)]", aBrightness );
+        User::LeaveIfError( iLightRepository->Set( KLightIntensity,
+                                                   brightness ) );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::DisplayTextSizeL
+//
+// Return current display text size.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::DisplayTextSizeL()
+    {
+    TInt textSize = EAknUiZoomNormal;
+
+    if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) )
+        {
+        User::LeaveIfError( iAvkonRepository->Get( KAknGlobalUiZoom,
+                                                   textSize ) );
+        }
+
+    return textSize;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetDisplayTextSizeL
+//
+// Sets new display text size.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetDisplayTextSizeL( TInt aSize )
+    {
+    // not checking for feature manager constant to avoid compiler
+    // warning for the input parameter.
+    User::LeaveIfError( iAvkonRepository->Set( KAknGlobalUiZoom, aSize ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::PowerSaveLedL
+//
+// Returns Tracking Transaction state value.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::PowerSaveLedL()
+    {
+    TInt ret = 0;
+    User::LeaveIfError( iPersonalizationRepository->Get(
+        KSettingsDisplayTurnoffTimeout, ret ) );
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetPowerSaveLedL
+//
+// Sets Tracking Transaction state value.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetPowerSaveLedL( const TInt aPowerLedState )
+    {
+    User::LeaveIfError( iPersonalizationRepository->
+        Set( KSettingsDisplayTurnoffTimeout, aPowerLedState ) );
+
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::CheckPowerSaveLedSupportL
+//
+// Checks local variation flag for supporting Power Save Led feature.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::CheckPowerSaveLedSupportL()
+    {
+    TInt value = 0;
+    User::LeaveIfError( iGSVariationRepository->Get(
+                        KSettingsVariationFlags, value ) );
+
+    TBool supported = EFalse;
+
+    if ( value & EGSConfigPowerSaveLed )
+        {
+        supported = ETrue;
+        }
+
+    return supported;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::BackgroundImage
+// ----------------------------------------------------------------------------
+//
+CGSBackgroundImage* CGSDisplayPluginModel::BackgroundImage()
+    {
+    return iBackgroundApi;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::CheckScreenSaverTimeoutSupportL
+// 
+// Checks ScreenSaver timeout support
+// ----------------------------------------------------------------------------
+//
+TBool CGSDisplayPluginModel::CheckScreenSaverTimeoutSupportL()
+    {
+    TInt value = 0;
+    User::LeaveIfError( iPersonalizationRepository->Get(
+                        KSettingsScreensaverTimeoutItemVisibility, value ) );
+    
+    if ( value )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::ShowOperatorLogoSettingL
+//
+// Checks if Operator Logo item is to be made visible.
+// ----------------------------------------------------------------------------
+//
+TBool CGSDisplayPluginModel::ShowOperatorLogoSettingL()
+    {
+    TInt opLogoSettingState = KGSSettingOff;
+    TBool showSetting = EFalse;
+
+    User::LeaveIfError( iPersonalizationRepository->
+        Get( KSettingsShowOperatorLogoSetting, opLogoSettingState ) );
+    switch( opLogoSettingState )
+        {
+        case KGSSettingOn:
+            showSetting = ETrue;
+            break;
+        case KGSSettingOff:
+            showSetting = EFalse;
+        default:
+            break;
+        }
+    return showSetting;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::OperatorLogoL
+//
+// Returns operator logo value from shared data.
+// ----------------------------------------------------------------------------
+//
+TInt CGSDisplayPluginModel::OperatorLogoL()
+    {
+    TInt opLogo = KGSSettingOff;
+    User::LeaveIfError( iPersonalizationRepository->
+        Get( KSettingsDisplayOperatorLogo, opLogo ) );
+    return opLogo;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetOperatorLogoL
+//
+// Sets operator logo value to shared data.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetOperatorLogoL( TInt aOperatorLogo )
+    {
+    User::LeaveIfError( iPersonalizationRepository->
+        Set( KSettingsDisplayOperatorLogo, aOperatorLogo ) );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSDisplayPluginModel::SetOwner
+//
+// Sets its owner.
+// ----------------------------------------------------------------------------
+//
+void CGSDisplayPluginModel::SetOwner( CGSDisplayPluginContainer* aContainer)
+    {
+    iContainer = aContainer;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/PSMDisplayPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,218 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Stub imlementation
+*
+*/
+
+
+// INCLUDE FILES
+#include <psmsettingsprovider.h>
+#include "PSMDisplayPlugin.h"
+#include "GSDisplayPluginModel.h"
+#include "GsLogger.h"
+#include <psmsrvdomaincrkeys.h>
+#include <featmgr.h>
+#include <settingsinternalcrkeys.h>
+
+#ifndef __WINS__
+#include <power_save_display_mode.h>
+#endif
+
+// CONSTANT DEFINITIONS
+const TUint32 KPSMDisplayPluginStorageId = 0x2000B591;
+
+enum TPsmDisplayPluginKeys
+    {
+    EContrast = 1,
+    EBacklightPeriod,
+    EBrightness,
+    EAmbientLightSensor,
+    EScreenSaverPeriod,
+    EAutomaticBrightnessControl
+    };
+//
+// ----------------------------------------------------------------------------------
+// CPSMDisplayPlugin::CPSMDisplayPlugin()
+// ----------------------------------------------------------------------------------
+//
+CPSMDisplayPlugin::CPSMDisplayPlugin( TPsmPluginCTorParams& aInitParams ) :
+    CPsmPluginBase( aInitParams )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CPSMDisplayPlugin::ConstructL(
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPSMDisplayPlugin::ConstructL()
+    {
+    iModel = CGSDisplayPluginModel::NewL( EFalse );
+#ifndef __WINS__ 
+    iDisplayModel = CPowerSaveDisplayMode::NewL();
+#endif
+    }
+
+//
+// ----------------------------------------------------------------------------------
+// CPSMDisplayPlugin::NewL()
+// ----------------------------------------------------------------------------------
+//
+// Two-phased constructor.
+CPSMDisplayPlugin* CPSMDisplayPlugin::NewL( TPsmPluginCTorParams& aInitParams )
+	{
+	CPSMDisplayPlugin* self = new ( ELeave ) CPSMDisplayPlugin( aInitParams );
+
+	CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+	}
+
+// ----------------------------------------------------------------------------------
+// CPSMDisplayPlugin::~CPSMDisplayPlugin()
+// ----------------------------------------------------------------------------------
+//
+// Destructor.
+CPSMDisplayPlugin::~CPSMDisplayPlugin()
+	{
+    __GSLOGSTRING( "[CPSMDisplayPlugin::~CPSMDisplayPlugin]" );
+    if( iModel ) delete iModel;
+
+#ifndef __WINS__
+    if ( iDisplayModel )
+        {
+        delete iDisplayModel;
+        }
+#endif
+    
+	}
+
+// ----------------------------------------------------------------------------------
+// CPSMDisplayPlugin::NotifyModeChange()
+// ----------------------------------------------------------------------------------
+//
+void CPSMDisplayPlugin::NotifyModeChange( const TInt aMode )
+    {
+    TInt err = KErrNone;
+    TRAP( err, DoModeChangeL( aMode ) );
+    __GSLOGSTRING2( "[CPSMDisplayPlugin::NotifyModeChange]: Mode:%d Err:%d", aMode, err );
+
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CPSMDisplayPlugin::NotifyModeChange()
+// ----------------------------------------------------------------------------------
+//
+void CPSMDisplayPlugin::DoModeChangeL( const TInt aMode )
+    {
+    RConfigInfoArray infoArray;
+
+    TPsmsrvConfigInfo info1;
+    info1.iConfigId = EContrast;
+    info1.iConfigType = EConfigTypeInt;
+    info1.iIntValue = iModel->ContrastL();
+    infoArray.Append( info1 );
+
+    TPsmsrvConfigInfo info2;
+    info2.iConfigId = EBacklightPeriod;
+    info2.iConfigType = EConfigTypeInt;
+    info2.iIntValue = iModel->BacklightPeriodL();
+    infoArray.Append( info2 );
+
+    TPsmsrvConfigInfo info3;
+    info3.iConfigId = EBrightness;
+    info3.iConfigType = EConfigTypeInt;
+    info3.iIntValue = iModel->BrightnessL();
+    infoArray.Append( info3 );
+    
+    TPsmsrvConfigInfo info4;
+    info4.iConfigId = EAmbientLightSensor;
+    info4.iConfigType = EConfigTypeInt;
+    info4.iIntValue = iModel->AmbientLightSensorL();
+    infoArray.Append( info4 );
+    
+    TPsmsrvConfigInfo info5;
+    info5.iConfigId = EScreenSaverPeriod;
+    info5.iConfigType = EConfigTypeInt;
+    info5.iIntValue = iModel->ScreenSaverPeriodL();
+    infoArray.Append( info5 );
+
+#ifndef __WINS__
+    TPsmsrvConfigInfo info6;
+    info6.iConfigId = EAutomaticBrightnessControl;
+    info6.iConfigType = EConfigTypeInt;
+    info6.iIntValue = iDisplayModel->GetPowerSaveLevel();
+    infoArray.Append( info6 );
+#endif
+
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL] Switching to mode:%d", aMode );
+
+    // Print old values from array
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info1: %d", infoArray[0].iIntValue );
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info2: %d", infoArray[1].iIntValue );
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info3: %d", infoArray[2].iIntValue );   
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info4: %d", infoArray[3].iIntValue );   
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info5: %d", infoArray[4].iIntValue );
+#ifndef __WINS__
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info6: %d", infoArray[5].iIntValue );
+#endif
+
+    iSettingsProvider.BackupAndGetSettingsL( infoArray, KPSMDisplayPluginStorageId );
+
+    // Print new values from array
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info1: %d", infoArray[0].iIntValue );
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info2: %d", infoArray[1].iIntValue );
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info3: %d", infoArray[2].iIntValue );
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info4: %d", infoArray[3].iIntValue );   
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info5: %d", infoArray[4].iIntValue );
+#ifndef __WINS__
+    __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info6: %d", infoArray[5].iIntValue );
+#endif
+    
+    if ( iModel->ContrastL ( )!= KErrNotSupported )
+        {
+        iModel->SetContrastL ( infoArray[0].iIntValue );
+        }
+
+    if ( FeatureManager::FeatureSupported ( KFeatureIdBrightnessControl ) )
+        {
+        iModel->SetBrightnessL ( infoArray[2].iIntValue );
+        }
+
+    if ( iModel->CheckScreenSaverTimeoutSupportL() )
+        {
+        iModel->SetScreenSaverPeriodL( infoArray[4].iIntValue );
+        }
+
+    iModel->SetBacklightPeriodL( infoArray[1].iIntValue );
+    iModel->SetAmbientLightSensorL( infoArray[3].iIntValue );
+ 
+#ifndef __WINS__
+    if ( FeatureManager::FeatureSupported( KFeatureIdFfAbcAgressiveUi ) )
+        {
+        iDisplayModel->SetPowerSaveLevel( 
+              (CPowerSaveDisplayMode::TPowerSaveLevel)infoArray[5].iIntValue );
+        __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: level: %d", 
+                iDisplayModel->GetPowerSaveLevel() );
+        }
+#endif
+    
+    infoArray.Reset();
+    }
+
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSDisplayPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSDisplayPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsdisplayplugin.iby )
+../rom/GSDisplayPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsdisplaypluginresources.iby )
+loc/GsDisplPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsdisplplugin.loc )
+
+#ifdef FF_POWER_SAVE
+	// PSM Config files for emulator use
+	Data/2000B591.xml  /epoc32/release/winscw/urel/z/private/2000b187/2000b591.xml
+	Data/2000B591.xml  /epoc32/release/winscw/udeb/z/private/2000b187/2000b591.xml
+
+	// PSM Config files for HW use
+	Data/2000B591.xml  /epoc32/data/z/private/2000b187/2000b591.xml
+#endif // FF_POWER_SAVE
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsdisplayplugin.mif
+  OPTION HEADERFILE gsdisplayplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_dev_disp
+END
+
+
+
+
+PRJ_MMPFILES
+GSDisplayPlugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSDisplayPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSDisplayPlugin/loc/GsDisplPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,403 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSDsplPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d:Text of a list item in device view's list
+//d:Item opens Display setting view
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_device_display "Display"
+
+//d:Text in title pane
+//d:Display setting list view
+//l:title_pane_t2/opt9
+//w:
+//r:3.1
+//
+#define qtn_set_title_display "Display settings"
+
+//d:Text of a list item in Display setting list view's list
+//d:Item opens Contrast setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_display_contrast "Contrast"
+
+//d:Text of a list item in Display setting list view's list
+//d:Item opens Brightness setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_disp_brightness "Brightness"
+
+//d:Text of a list item in Display setting list view's list
+//d:Item opens Color palette setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_color_palette "Color palette"
+
+//d:Text of a list item in Display setting list view's list
+//d:Item opens Screen saver time-out setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_sanim_time_out "Screen saver time-out"
+
+
+//d:Text of a list item in Display setting list view's list
+//d:Item opens Backlight time-out setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_light_time "Backlight time-out"
+
+
+// **CONTRAST
+
+//d:Text in slider control
+//d:Contrast setting page
+//d:Minimum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.1
+//
+#define qtn_set_contrast_light "lighter"
+
+//d:Text in slider control
+//d:Contrast setting page
+//d:Maximum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.1
+//
+#define qtn_set_contrast_dark "darker"
+
+
+// **BRIGHTNESS
+
+//d:Text in slider control
+//d:Brightness setting page
+//d:Minimum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.1
+//
+#define qtn_set_brightness_bright "bright"
+
+//d:Text in slider control
+//d:Brightness setting page
+//d:Maximum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.1
+//
+#define qtn_set_brightness_dark "dark"
+
+
+// **SCREEN SAVER
+
+//d:Text in setting list item's current value field
+//d:Screen saver time-out setting item
+//d:Current value
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.2
+//
+#define qtn_sanim_time_out_slider_cur_value "%U seconds"
+
+
+//d:Text in slider control
+//d:Screen saver time-out setting page
+//d:Minimum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.2
+//
+#define qtn_sanim_time_out_slider_min_value "5 secs." 
+
+//d:Text in slider control
+//d:Screen saver time-out setting page
+//d:Maximum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.2
+//
+#define qtn_sanim_time_out_slider_max_value "90 secs."
+
+
+// ************************************
+
+// **BACKLIGHT TIMEOUT
+
+//d:Text in setting list item's current value field
+//d:Backlight time-out setting item
+//d:Current value when it's > 1 minute (?)
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_backlight_time_out_slider_cur "%U seconds"
+
+
+//d:Text in slider control
+//d:Backlight time-out setting page
+//d:Minimum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.1
+//
+#define qtn_backlight_time_out_slider_min "5sec" 
+
+//d:Text in slider control
+//d:Backlight time-out setting page
+//d:Maximum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.1
+//
+#define qtn_backlight_time_out_slider_max "60sec"
+
+
+// **AMBIENT LIGHT SENSOR
+
+//d:Text of a list item in display setting list view's list
+//d:Item opens Ambient Light Sensor settings page
+//l:list_setting_pane_t1
+//w:
+//r:3.0
+//
+#define qtn_set_light_sensor_mode "Light sensor"
+
+//d:Text in slider control
+//d:Ambient Light Sensor setting page
+//d:Maximum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.0
+//
+#define qtn_set_light_sensor_bright "Bright"
+
+//d:Text in slider control
+//d:Ambient Light Sensor setting page
+//d:Minimum value
+//l:setting_slider_pane_t2
+//w:
+//r:3.0
+//
+#define qtn_set_light_sensor_dark "Dark"
+
+
+// **WELCOME NOTE SETTING PAGE
+
+//d:Text of a list item in general setting list view's list
+//d:Item opens Welcome note or image setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_uwn "Welcome note or image"
+
+//d:Text in setting list item's current value field
+//d:Item in Welcome note setting page's list
+//d:Setting value Default
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_uwn_default "Default"
+
+//d:Text in setting list item's current value field
+//d:Item in Welcome note setting page's list
+//d:Setting value Text
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_uwn_text "Text"
+
+//d:Text in setting list item's current value field
+//d:Item in Welcome note setting page's list
+//d:Setting value Image
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_uwn_image "Image"
+
+
+//d:Promt text in Welcome note text query
+//d:Data query
+//l:popup_query_data_window
+//w:
+//r:3.1
+//
+#define qtn_set_uwn_enter_text "Enter welcome note:"
+
+
+// **BACKGROUND IMAGE
+
+//d:Text of a list item in idle state setting list view's list
+//d:Item opens Background image setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_bgimage "Background image"
+
+//d:Text in setting list item's current value field
+//d:Item in Background image setting page's list
+//d:Setting value No image
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_bgimage_no "No image"
+
+//d:Text in setting list item's current value field
+//d:Item in Background image setting page's list
+//d:Setting value Image
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_bgimage_image "Image"
+
+
+// ****************** NEW ******************
+// **DISPLAY TEXT SIZE
+
+//d:Text of a list item in display setting list view's list
+//d:Item opens Display text size settings page
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_disp_text_size "Display text size"
+
+//d:Text in setting list item's current value field
+//d:Item in Display text size setting page's list
+//d:Setting value Large
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_disp_text_size_large "Large"
+
+//d:Text in setting list item's current value field
+//d:Item in Display text size setting page's list
+//d:Setting value Normal
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_disp_text_size_normal "Normal"
+
+//d:Text in setting list item's current value field
+//d:Item in Display text size setting page's list
+//d:Setting value Small
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_disp_text_size_small "Small"
+
+
+// **POWER SAVE LED MODE
+
+//d:Text of a list item in display setting list view's list
+//d:Item opens Powersave LED setting page
+//l:list_setting_pane_t1
+//w:
+//r:3.0
+//
+#define qtn_sanim_objec_power_save_led "Power save LED"
+
+//d:Text in setting list item's current value field
+//d:Item in Powersave LED setting page's list
+//d:Setting value ON
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.0
+//
+#define qtn_sanim_power_save_on "On"
+
+//d:Text in setting list item's current value field
+//d:Item in Powersave LED setting page's list
+//d:Setting value OFF
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.0
+//
+#define qtn_sanim_power_save_off "Off"
+
+//d:Text for image too large information note
+//d:Shown when selected background or welcome note image is too large to be opened 
+//  in memory
+//l:popup_note_window
+//
+#define qtn_set_image_too_large "Image size is too large. Image can not be selected."
+
+
+//CONTROL PANEL
+
+//d:Text when settings item is blocked.
+//l:popup_note_window
+//w: 
+//r:3.2
+//
+#define qtn_power_saving_protected_settings_infonote "Power saving is active. Unable to edit."
+
+
+//d:Operator logo plugin caption
+//d:Operator logo
+//l:list_setting_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_oper_logo "Operator logo"
+
+
+//d:Operator logo off text
+//d:Operator logo
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_oper_logo_off "Off"
+
+
+//d:Operator logo on text
+//d:Operator logo
+//l:list_set_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_oper_logo_on "On"
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/GSEcomPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is project specification file for GSEcomPlugin.dll.
+*
+*/
+
+#include "../Logger/GsLoggingConfiguration.h"
+#include  <data_caging_paths.hrh>
+#include  <platform_paths.hrh>
+
+CAPABILITY  CAP_GENERAL_DLL
+VENDORID    VID_DEFAULT
+TARGET      gsecomplugin.dll
+TARGETTYPE  DLL
+UID	        0x1000008d 0x1020723C
+
+// Source files
+SOURCEPATH  src
+SOURCE      GSPluginInterface.cpp
+
+// User include paths
+//USERINCLUDE ../data
+//USERINCLUDE data
+//USERINCLUDE ../Logger
+USERINCLUDE inc
+
+// System include paths
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+SOURCEPATH      data
+// CGSPluginInterface icon resources
+START RESOURCE  GSFrameworkRsc.rss
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+
+// Libraries required by framework
+LIBRARY     aknskins.lib               // for enhanced skinning
+LIBRARY     aknskinsrv.lib             // for enhanced skinning
+LIBRARY     apgrfx.lib                 // for RApaLsSession
+LIBRARY     apparc.lib
+LIBRARY     avkon.lib
+LIBRARY     bafl.lib
+LIBRARY     charconv.lib                //for CnvUtfConverter used in CGSPluginLoader
+LIBRARY     commonengine.lib           // for RConeResourceLoader
+LIBRARY     cone.lib
+LIBRARY     ecom.lib
+LIBRARY     efsrv.lib
+LIBRARY     egul.lib                   // CGulIcon
+LIBRARY     eikcoctl.lib
+LIBRARY     eikcore.lib
+LIBRARY     eikctl.lib                 // CEikColumnListBox
+LIBRARY     euser.lib
+LIBRARY     fbscli.lib                  // for CFbsBitmap
+LIBRARY     featmgr.lib                // feature manager
+LIBRARY     flogger.lib                // logging
+LIBRARY     hlplch.lib                 // for "Help" options menu
+LIBRARY     ws32.lib
+
+
+SOURCEPATH  data
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/GSFramework.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is project specification file for GSFramework.
+*
+*/
+
+#include "../Logger/GsLoggingConfiguration.h"
+#include  <data_caging_paths.hrh>
+#include  <platform_paths.hrh>
+
+CAPABILITY  CAP_GENERAL_DLL
+VENDORID    VID_DEFAULT
+TARGET      gsframework.dll
+TARGETTYPE  DLL
+UID         0x1000008d 0x1020723F
+
+// Source files
+SOURCEPATH  src
+SOURCE      GSBaseContainer.cpp
+SOURCE      GSBaseView.cpp
+SOURCE      GSParentContainer.cpp
+SOURCE      GSParentPlugin.cpp
+SOURCE      GSPluginLoader.cpp
+SOURCE      GSTabHelper.cpp
+SOURCE      GSPluginWrapper.cpp
+SOURCE      GSBaseDocument.cpp
+SOURCE      GSPluginAndViewIdCache.cpp
+SOURCE      GSPlaceholderView.cpp
+SOURCE      GSShimmedView.cpp
+SOURCE      GSPubSubsListener.cpp
+SOURCE      GSWatchDog.cpp
+SOURCE      GSEComNotifier.cpp
+
+// User include paths
+USERINCLUDE data
+USERINCLUDE inc
+USERINCLUDE ../Logger
+USERINCLUDE ../Data
+USERINCLUDE ../Cenrep
+
+// System include paths
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+// Parent plugin resources
+SOURCEPATH      data
+START RESOURCE  GSParentPluginRsc.rss
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+// CGSPluginInterface icon resources
+SOURCEPATH      data
+START RESOURCE  GSFrameworkRsc.rss
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+// Libraries required by framework
+LIBRARY     aknskins.lib               // for enhanced skinning
+LIBRARY     aknskinsrv.lib             // for enhanced skinning
+LIBRARY     apgrfx.lib                 // for RApaLsSession
+LIBRARY     apparc.lib
+LIBRARY     avkon.lib
+LIBRARY     bafl.lib
+LIBRARY     charconv.lib                //for CnvUtfConverter used in CGSPluginLoader
+LIBRARY     commonengine.lib           // for RConeResourceLoader
+LIBRARY     cone.lib
+LIBRARY     ecom.lib
+LIBRARY     efsrv.lib
+LIBRARY     egul.lib                   // CGulIcon
+LIBRARY     eikcoctl.lib
+LIBRARY     eikcore.lib
+LIBRARY     eikctl.lib                 // CEikColumnListBox
+LIBRARY     euser.lib
+LIBRARY     fbscli.lib                  // for CFbsBitmap
+LIBRARY     featmgr.lib                // feature manager
+LIBRARY     flogger.lib                // logging
+LIBRARY     gsecomplugin.lib
+LIBRARY     hlplch.lib                 // for "Help" options menu
+LIBRARY     ws32.lib
+LIBRARY     estor.lib
+LIBRARY     centralrepository.lib      // GSWatchDog
+LIBRARY 	CdlEngine.lib
+SOURCEPATH  data
+DOCUMENT    GSFrameworkRsc.rss
+DOCUMENT    GSParentPluginRsc.rss
+
+SOURCEPATH  ../Data
+DOCUMENT    GSCommonResources.rss
+
+//End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building framework.
+*                
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+//#ifdef __SERIES60_HELP
+../GSFramework/inc/conset.hlp.hrh                   /epoc32/include/cshelp/conset.hlp.hrh
+../GSFramework/inc/div.hlp.hrh                      /epoc32/include/cshelp/div.hlp.hrh
+//../GSFramework/inc/set.hlp.hrh                      /epoc32/include/cshelp/set.hlp.hrh
+//#endif //__SERIES60_HELP   
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsfwicon.mif
+  OPTION HEADERFILE gsfwicon.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_default_sub -c8,1 qgn_prop_set_device_tab4
+END
+
+PRJ_MMPFILES
+    
+GSEcomPlugin.mmp
+GSFramework.mmp    
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSFramework_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/data/GSFrameworkRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GS framework.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    GSFW // 4 letter ID
+
+//  INCLUDES
+#include    <gsfwicon.mbg>
+
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rh>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rh>
+#include    <eikon.rsg>
+
+
+
+// CONSTANTS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_plugin_default_icon_array
+//    Default icons used by the CGSPluginInterface.
+//
+//----------------------------------------------------
+//
+RESOURCE AKN_ICON_ARRAY r_gs_plugin_default_icon_array
+    {
+    bmpfile = KGsBitmap;
+
+    icons =
+        {
+        AKN_ICON
+            {
+            iconId = EMbmGsfwiconQgn_prop_set_default_sub;
+            maskId = EMbmGsfwiconQgn_prop_set_default_sub_mask;
+            }
+        };
+    }
+    
+    
+//End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/data/GSParentPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSParentPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    GSPP // 4 letter ID
+
+//  INCLUDES
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+
+// CONSTANTS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+// -----------------------------------------------------------------------------
+//
+// r_gs_parentplugin_lbx
+// GSParentPlugin listbox.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_gs_parentplugin_lbx
+    {
+    flags = EEikListBoxMultipleSelection;
+    }
+
+RESOURCE TBUF r_gs_parentplugin_cba_exit { buf = text_softkey_exit; }
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/GSBaseDocument.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*           Base Document class required by Symbian OS architecture.
+*
+*/
+
+
+#ifndef GSBASEDOCUMENT_H
+#define GSBASEDOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+#include <ecom/implementationinformation.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CGSPluginWrapper;
+class CGSPluginAndViewIdCache;
+class MGSWatchDog;
+class CGSWatchDog;
+
+
+// CLASS DECLARATION
+
+/**
+*  CGSBaseDocument application class.
+*  @since Series60_3.1
+*/
+class CGSBaseDocument : public CAknDocument
+{
+    public: // Constructor and destructor
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CGSBaseDocument();
+
+    public: // New
+
+        /**
+        *
+        */
+        IMPORT_C CGSPluginWrapper* NewPluginUnloadWrapperLC();
+
+        /**
+        *
+        */
+        IMPORT_C void PreparePluginCacheL( CEikAppUi& aAppUi );
+
+        /**
+        *
+        */
+        IMPORT_C void PrepareForUIDestruction();
+
+        /**
+        * @return Pointer to GS application-wide watchdog. Does not transfer
+        *         ownership.
+        */
+        IMPORT_C MGSWatchDog* WatchDog();
+
+        /**
+        * Stored array of GS plugin implementation infos. Use this instead of
+        * repeatedly using REComSession::ListImplementationsL (performance).
+        *
+        * @ return reference to plugin inplementation info array.
+        *          Does not transfer ownership.
+        */
+        IMPORT_C RImplInfoPtrArray GetImplInfo();
+        
+        IMPORT_C void CreateShimmedViewL(const TUid aViewUid);
+
+    public: // API - but not exported
+        CGSPluginAndViewIdCache& PluginViewIdCache();
+        const CGSPluginAndViewIdCache& PluginViewIdCache() const;
+
+    protected:
+
+        /**
+        * C++ constructor
+        */
+        IMPORT_C CGSBaseDocument( CEikApplication& aApp );
+
+        /**
+        * Second phase constructor
+        */
+        IMPORT_C void ConstructL();
+
+    private: // Cleanup support
+        static void CleanupPluginWrapperObject( TAny* aWrapper );
+        void DoCleanupPluginWrapper( CGSPluginWrapper* aWrapper );
+        static void PrintImplInfoArray( const RImplInfoPtrArray& aImplInfoArray );
+        static void PrintImplInfo( const CImplementationInformation& aInfo );
+        
+    private: // Data
+
+        // Plugin view id cache
+        CGSPluginAndViewIdCache* iPluginViewIdCache;
+
+        // Asynchronous loader for the GS plug-ins.
+        RPointerArray<CGSPluginWrapper> iUnloadWrapperObjects;
+
+        // Watchdog used GS application-wide. Owned.
+        CGSWatchDog* iWatchDog;
+
+        // Array of GS plugin implementation info-objects. Array is created on
+        // GS startup for better performance. Use this instead of repeatedly
+        // querying from ECOM.
+        RImplInfoPtrArray iImplInfoArray;
+};
+
+#endif // GSBASEDOCUMENT_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/GSEComNotifier.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GS utilities.
+*
+*/
+
+
+#ifndef GSECOMNOTIFIER_H
+#define GSECOMNOTIFIER_H
+
+#include <e32std.h>
+#include <ecom/ecom.h>
+
+
+
+/**
+ *  Utility class to capsulate active object observing ECOM events.
+ *  MGSEComObserver is provided as easy callback when GS related ECOM events
+ *  occur.
+ *
+ *  @lib GSFramework.lib
+ *  @since S60 5.0
+ */
+class MGSEComObserver
+    {
+public:
+
+    /**
+     * Not really used yet. To provide more extendability.
+     */
+    enum TEComEvent
+        {
+        EPluginRemoved,
+        EPluginAdded
+        };
+
+public:
+    virtual void HandleEComEvent( TEComEvent aEvent ) = 0;
+    };
+
+
+/**
+ *  Utility class capsulating active object for observing ECOM events.
+ *
+ *  @lib GSFramework.lib
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS( CGSEComNotifier ) : public CActive
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @param aObserver Callback object.
+     * @param aImplInfo Initial list of ECOM interfaces against which new list
+     *        is compared when ECOM events occur.
+     */
+    IMPORT_C static CGSEComNotifier* NewL( MGSEComObserver* aObserver,
+                                           RImplInfoPtrArray aImplInfo );
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CGSEComNotifier();
+
+protected: // from CActive
+
+    /**
+     * See base class.
+     */
+    void DoCancel();
+
+    /**
+     * See base class.
+     */
+    void RunL();
+
+    /**
+     * See base class.
+     */
+    TInt RunError( TInt aError );
+
+protected:
+
+private:
+
+    /**
+     * C++ Constructor.
+     *
+     * @param aObserver Callback object.
+     * @param aImplInfo Initial list of ECOM interfaces against which new list
+     *        is compared when ECOM events occur.
+     */
+    CGSEComNotifier( MGSEComObserver* aObserver,
+                     RImplInfoPtrArray aImplInfo );
+
+    /**
+     * 2nd phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Issues new request.
+     */
+    void IssueRequest();
+
+    /**
+     * @return Difference between old and new list of GS-plugins. Negative
+     *         number means plugins are removed, positive means plugins are
+     *         added, 0 means no change in plugin count.
+     */
+    TInt PluginCountDeltaL();
+
+private: // data
+
+    // Callback.
+    MGSEComObserver* iObserver;
+
+    // ECom handle.
+    REComSession iEComSession;
+
+    // Stored original plugin info. This will be compared against latest info
+    // for any changes.
+    RImplInfoPtrArray iOriginalImplInfo;
+
+    };
+
+
+#endif // GSECOMNOTIFIER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/GSPlaceholderView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Placeholder view during synchronous view activation
+*
+*/
+
+
+#ifndef GSPLACEHOLDERVIEW_H
+#define GSPLACEHOLDERVIEW_H
+
+// INCLUDES
+#include <e32base.h>
+#include <vwsdef.h>
+#include <coeview.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Dummy view class used by CGSPluginAndViewIdCache view switching between two
+*  actual views. See CGSPluginAndViewIdCache for details.
+*
+*  @since Series60_3.1
+*
+*/
+class CGSPlaceholderView : public CBase, public MCoeView
+    {
+    public: // Constructor and destructor
+
+        /**
+        *
+        */
+        static CGSPlaceholderView* NewL( CCoeAppUi& aAppUi );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPlaceholderView();
+
+    private:
+
+        /**
+        * C++ constructor
+        */
+        CGSPlaceholderView( CCoeAppUi& aAppUi );
+
+        /**
+        * Second phase constructor
+        */
+        void ConstructL();
+
+    public: // API
+
+        /**
+        *
+        */
+        void ActivateL();
+
+        /**
+        *
+        */
+        const TVwsViewId& PreviouslyActiveViewId() const;
+
+        /**
+        *
+        */
+        void SetPreviouslyActiveViewId( const TVwsViewId& aViewId );
+
+    private: // From MCoeView
+	    TVwsViewId ViewId() const;
+	    void ViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage );
+	    void ViewDeactivated();
+
+    private: // Internal methods
+
+    private: // Data
+         CCoeAppUi& iAppUi;
+         TVwsViewId iPreviouslyActiveViewId;
+    };
+
+
+#endif // GSPLACEHOLDERVIEW_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/GSPluginAndViewIdCache.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,239 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Plugin and view id caching support
+*
+*/
+
+
+#ifndef GSPLUGINANDVIEWIDCACHE_H
+#define GSPLUGINANDVIEWIDCACHE_H
+
+// INCLUDES
+#include <e32base.h>
+#include <vwsdef.h>
+#include <f32file.h>
+#include <e32hashtab.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CGSShimmedView;
+class CGSPluginInterface;
+class CGSPlaceholderView;
+
+// CLASS DECLARATION
+
+/**
+*  CGSPluginAndViewIdCache application class.
+*   - Creates/Loads a list of CGSShimmedViews from a cache file on GS start-up.
+*   - Inserts CGSShimmedViews into view-framework view list.
+*
+*
+*  Problem/rationale:
+*  Launching GS plugin view outside GS application when GS application is not
+*  already running may fail. This was caused by application inter working
+*  combined with GS application's asynchronized plugin loading. High level
+*  functionality for external view launching goes:
+*   1. Application framework starts desired application
+*   2. Application framework calls view-activation on the desired application view.
+*   3. Desired view handles the activation call-back by drawing itself on
+*      screen or whatever required.
+*
+*  Starting from phase 2, things can go wrong: when GS start-up call returns, GS
+*  has not yet loaded all the plugins and the views owned by plugins are not
+*  added yet to the view-framework view list. Calling non-existing view will
+*  naturally fail.
+*
+*
+*  Solution:
+*  When GS start-up is called, populate view-frameworks view list with all the
+*  views provided by GS application before function return. Kind of: This would
+*  ruin GS's asynchronous plugin loading and would cause devastating freeze-up
+*  times on GS start-up. Hence, on GS start-up we're not actually loading the
+*  plugins nor the real views. We use light-weight dummy views
+*  (aka CGSShimmedView) wich we add into view-framework view list immedieately
+*  on start-up. If it happens so, that the view framework-decides to call view
+*  activation on one of these dummy views, dummy view will load manually the
+*  real plugin view and switch it with the dummy view. Dummy views are created
+*  by CGSPluginAndViewIdCache on GS-application start-up.
+*
+*
+*  Different use scenarios:
+*
+*  1. First GS-application start on a new device, create cache & save as file.
+*
+*  2. Launch GS-application second time. Always populate CCoeAppUi with
+*     CGSShimmedView instances created from cache file (cache maps view uid
+*     to ecom plugin implementation uid).
+*     - When pluginloader loads plugin, it replaces dummy view (shim) with the real
+*       view from the plugin. The shim is then destroyed.
+*
+*  3. GS plugin view is activated externally when GS is not running:
+*     - Uses normal application framework to launch GS application.
+*     - Same functionality as in scenario 2 but if shimmed view is requested
+*       before actual view is created, load actual plugin manually and
+*       synchronously.
+*     - CGSPlaceholderView: View-FW will only switch between two different view
+*       uids. This is why we need to switch between 3 different views.
+*     -> Will result in 3x fold different view activation.
+*     -  Used view activations are:
+*        1. Shimmed view DoActivate for view uid <view_uid>.
+*        2. Shimmed view calls Placeholder::DoActivate with a dummy "uid DEADBED".
+*        3. Placeholder view calls actual plugin::DoActivate with actual view uid
+*           <view_uid>.
+*
+*
+*  NOTE: Requirements:
+*  - Cache: GS has to be launched once successfully for the cache to work.
+*    -> otherwise error if launching from external application.
+*  - Views which need to be used externally (external view launch) must be
+*    implemented as a GS-plugin. Those cannot be implemented as a local view.
+*
+*
+*  @since Series60_3.1
+*
+*/
+class CGSPluginAndViewIdCache : public CBase
+    {
+    public: // Constructor and destructor
+
+        /**
+        *
+        */
+        static CGSPluginAndViewIdCache* NewL( CEikAppUi& aAppUi );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPluginAndViewIdCache();
+
+    private:
+
+        /**
+        * C++ constructor
+        */
+        CGSPluginAndViewIdCache( CEikAppUi& aAppUi );
+
+        /**
+        * Second phase constructor
+        */
+        void ConstructL();
+
+    public: // API - placeholder view related
+
+        /**
+        *
+        */
+        void ActivatePlaceholderViewL();
+
+        /**
+        *
+        */
+        const TVwsViewId& PriorToPlaceholderActiveViewId() const;
+
+        /**
+        *
+        */
+        void SetPriorToPlaceholderActiveViewId( const TVwsViewId& aViewId );
+
+    public: // API - caching
+
+        /**
+        *
+        */
+        void RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid );
+
+        /**
+        *
+        */
+        void RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid, TBool aCreateShim );
+
+        /**
+        *
+        */
+        void PrepareToRegisterPluginInstanceLC( TUid aViewId );
+
+        /**
+        *
+        */
+        void RegisterPluginInstanceL( TUid aViewId, CGSPluginInterface& aPluginInstance );
+
+        /**
+        *
+        */
+        TBool IsPluginLoaded( TUid aViewId ) const;
+
+        /**
+        *
+        */
+        CGSPluginInterface* PluginInstance( TUid aViewId ) const;
+
+        /**
+        *
+        */
+        TUid PluginImplementationUidForView( TUid aViewId ) const;
+
+        /**
+        *
+        */
+        void PrepareForUIDestruction();
+
+        /**
+        *
+        */
+        void HandleShimDestruction( TUid aViewId );
+
+    private: // Internal methods
+        void DestroyShims();
+        void RestoreL();
+        void StoreL();
+        void GetCacheFileNameL( TDes& aFileName );
+        void GetCachePathL( TDes& aPath );
+        static void ReRegisterShimWithUi( TAny* aSelf );
+
+    private: // Hash function support
+        static TUint32 HashFunction( const TUid& aViewId );
+        static TBool HashIdentityRelation( const TUid& aLeft, const TUid& aRight );
+
+    private: // Internal object
+
+        struct TCacheEntry
+            {
+            TUid iImplementationUid;
+            CGSShimmedView* iShim;
+            CGSPluginInterface* iLoadedPluginImplementation;
+            };
+
+    private: // Data
+
+        // UI - not owned
+        CEikAppUi& iAppUi;
+
+        // File server session - owned
+        RFs iFsSession;
+
+        // Cache table - owned
+        RHashMap< TUid /* KEY = view id */, TCacheEntry /* VALUE */ > iLookupTable;
+
+        // Placeholder view - owned
+        CGSPlaceholderView* iPlaceholderView;
+
+        // Transient variable used during plugin registration preparation.
+        TUid iTransientCleanupViewUid;
+    };
+
+
+#endif // GSBASEDOCUMENT_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/GSPluginWrapper.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef GSPLUGINWRAPPER_H
+#define GSPLUGINWRAPPER_H
+
+// System includes
+#include <e32base.h>
+
+// Classes referenced
+class CGSBaseDocument;
+
+
+/**
+ *  Utility class for separating ECOM plugin destruction from view-framework
+ *  view cleanup.
+ *
+ *  Owned by CGSBaseDocument which has the longest lifetime during GS
+ *  application run. This will ensure that ECOM resources are not deleted
+ *  before view cleanup.
+ *
+ *  Problem/rationale:
+ *  Before the functionality provided by this class, GS would occasionally
+ *  crash in exit. This was caused by the dual nature of CGSPluginInterface
+ *  class: It is both ECOM-plugin having individual dll and view-framework
+ *  dependant CAknView owned by CCoeAppUi. When exiting GS, it was possible
+ *  that a  plugin still had local views (CAknViews) which were owned
+ *  by view-framework.
+ *
+ *  When the view framework destroys the registered views, it would cause
+ *  the ECOM plugin dll to be unloaded. Should this happen before all the views
+ *  owned and implemented by the plugin have been destroyed, an access
+ *  violation would occur because the code needed to call the view's destructor
+ *  was no longer loaded into memory within the GS process.
+ *
+ *  Solution:
+ *  Purpose of CGSPluginWrapper is to move ECOM-related memory cleanup outside
+ *  the scope of CGSPluginInterface destructor. This way view-framework can
+ *  call destructor in an arbitrary order on all it's owned views even though
+ *  plugins which had local views were already deleted.
+ *
+ */
+NONSHARABLE_CLASS( CGSPluginWrapper ) : public CBase
+    {
+    public:
+        CGSPluginWrapper( CGSBaseDocument& aDocument );
+        IMPORT_C ~CGSPluginWrapper();
+
+    public:
+        IMPORT_C void SetDetails( TUid aDestructorIdKey );
+        inline CGSBaseDocument& Document() { return iDocument; }
+
+    private:
+        TUid iDestructorIdKey;
+        CGSBaseDocument& iDocument;
+    };
+
+
+
+
+#endif // GSPLUGINWRAPPER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/GSShimmedView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Shim view
+*
+*/
+
+
+#ifndef GSSHIMMEDVIEW_H
+#define GSSHIMMEDVIEW_H
+
+// INCLUDES
+#include <e32base.h>
+#include <vwsdef.h>
+#include <coeview.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CGSPluginAndViewIdCache;
+
+// CLASS DECLARATION
+
+/**
+*  CGSShimmedView is used by CGSPluginAndViewIdCache to provide view-framework
+*  with all existing plugin views immediately in GS start-up. Shimmed views
+*  are used to cache actual views: in case GS view is opened outside GS
+*  application while GS is not running in the background, view-framework needs
+*  the requested view to exist immediately after GS start-up. This is a problem
+*  as GS loads plugins asynchronously after GS start-up. Therefore we provide
+*  view-framework with shimmed views in the GS start-up instead of the actual
+*  views. Afterwards, when each plugin is loaded, we replace the shimmed view
+*  representing the plugin with a real view provided by the loaded plugin.
+*  (Each plugin is normally also a view).
+*
+*  Shimmed views are only used and needed for enabling external GS plugin
+*  view launch.
+*
+*  See CGSPluginAndViewIdCache for details.
+*
+*  @since Series60_3.1
+*
+*/
+class CGSShimmedView : public CActive, public MCoeView
+    {
+    public: // Constructor and destructor
+
+        /**
+        *
+        */
+        static CGSShimmedView* NewLC( TUid aViewId, CGSPluginAndViewIdCache& aCache, CCoeAppUi& aAppUi );
+
+        /**
+        * Destructor.
+        */
+        ~CGSShimmedView();
+
+    private:
+
+        /**
+        * C++ constructor
+        */
+        CGSShimmedView( TUid aViewId, CGSPluginAndViewIdCache& aCache, CCoeAppUi& aAppUi );
+
+        /**
+        * Second phase constructor
+        */
+        void ConstructL();
+
+    public: // API
+
+        /**
+        *
+        */
+        void RegisterViewL();
+
+        /**
+        *
+        */
+        void DeregisterView();
+
+    public: // From MCoeView
+	    TVwsViewId ViewId() const;
+	    void ViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage );
+	    void ViewDeactivated();
+
+    private: // State
+        enum TState
+            {
+            EStateInactive = 0,
+            EStateActivatingPlaceholderView,
+            EStateLoadingPlugin,
+            EStateDeletingSelf
+            };
+
+        void SetState( TState aState, TBool aCompleteRequest = ETrue );
+        void StateActivatePlaceholderViewL();
+        void StateLoadPluginL();
+
+    private: // From CActive
+        void RunL();
+        void DoCancel();
+
+    private: // Data
+        TUid iViewId;
+        CGSPluginAndViewIdCache& iCache;
+        CCoeAppUi& iAppUi;
+        TState iState;
+        TBool iIsRegistered;
+        HBufC8* iCustomMessage;
+        TUid iCustomMessageId;
+    };
+
+
+#endif // GSSHIMMEDVIEW_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/GSWatchDog.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,293 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef GSWATCHDOG_H
+#define GSWATCHDOG_H
+
+// System includes
+#include <e32base.h>
+#include <mgswatchdog.h>
+
+// CONSTANTS
+
+
+/**
+* Maximum number of GS runs during which plugin is held in blacklist. After
+* this plugin is allowed normal execution unless it crashes again.
+*
+* Used only in case no CenRep value is defined.
+*/
+const TInt KGSDefaultMaxPluginBlackListedRuns = 5;
+
+
+/**
+* Defines how many crashes are observed before watchdog is activated. The
+* bigger the value, more tolerant behaviour towards crashing plugins.
+*
+* -1 = Watchdog is completely disabled regardless any crash
+*      (KGSWatchdogActivationDisabled).
+*  1 = In practise, the fastest reaction, meaning watchdog is enabled the next
+*      run GS starts after a crash.
+*  2 = GS can have 1 crash without watchdog being enabled = 2nd GS crash in a
+*      row will enable watchdog.
+*  n = GS can have n-1 crashes before watchdog being activated etc.
+*
+* Used only in case no CenRep value is defined.
+*/
+const TInt KGSDefaultWatchdogActivationLimit = 1;
+
+/**
+* Watchdog is completely disabled.
+*/
+const TInt KGSWatchdogActivationDisabled = -1;
+
+
+// FORWARD DECLARATIONS
+class CRepository;
+class RReadStream;
+class RWriteStream;
+
+// CLASS DECLARATION
+
+
+
+/**
+* Container class for quarantined plugin data.
+*/
+class TGSPluginQuarantine
+    {
+    public:
+        /**
+        * Read data from aStream.
+        * @param aStream read stream.
+        */
+        void InternalizeL( RReadStream& aStream );
+
+        /**
+        * Write data to aStream.
+        * @param aStream write stream.
+        */
+        void ExternalizeL( RWriteStream& aStream ) const;
+
+    public:
+
+        /**
+        * Uid of the plugin.
+        */
+        TUid iUid;
+
+        /**
+        * Counter which is incremented each time GS is started and the plugin
+        * is in blacklist. This is used for removing plugin from blacklist
+        * after certain number of GS runs (iMaxPluginBlackListedRuns). This
+        * means plugins are not in blacklist for ever but it is possible to try
+        * running the plugin after a number of GS runs. This is needed in case
+        * of ramdom crash while some essential plugin is in quarantine.
+        */
+        TInt iRunsAfterCrash;
+    };
+
+/**
+*  CGSWatchDog is responsible for quarantining plugins and updating blacklist
+*  for crashing GS plugins. This is the class responsible for keeping GS
+*  application functional even if some plugin to panics all the time.
+*
+*  @since Series60_3.2
+*/
+NONSHARABLE_CLASS( CGSWatchDog ) : public CBase,
+                                   public MGSWatchDog
+    {
+    public: // Constructor and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return CGSWatchDog.
+        */
+        static CGSWatchDog* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CGSWatchDog();
+
+    public: // From MGSWatchDog
+
+        /**
+        * Adds plugin to quarantine. In case GS crashes, quarantined plugin
+        * will be blacklisted so it is not loaded in next GS run. Same plugin
+        * can be quarantined multiple times or even have several uid instances
+        * in quarantine if needed as long as all these are removed
+        * correspondingly.
+        *
+        * NOTE: Plugin must ALWAYS be removed from quarantine after plugin's
+        * function execution.
+        * 1. QuarantineL().
+        * 2. Call quarantined plugin function.
+        * 3. RemoveFromQuarantineL().
+        *
+        * @param aPluginUid uid of the quarantined plugin.
+        */
+        void QuarantineL( TUid aPluginUid );
+
+        /**
+        * Removes plugin from quarantine. In case plugin is not removed from
+        * quarantine before GS exits, the plugin will be blacklisted during
+        * next GS startup.
+        *
+        * @param aPluginUid uid of the plugin to be removed from quarantine.
+        */
+        void RemoveFromQuarantineL( TUid aPluginUid );
+
+        /**
+        * @return ETrue if GS exited cleanly last time.
+        *         EFalse if GS crashed during last execution.
+        */
+        TBool WasCleanExitL();
+
+        /**
+        * This must be called in all the cases GS exits normally. If GS panics,
+        * this will not be called resulting in banning of all quarantined
+        * plugins.Increments iRunsAfterCrash counter for blacklisted plugins.
+        * Sets iGSAppRunning to EFalse.
+        */
+        void ReportCleanExitL();
+
+        /**
+        * Checks if plugin is in blacklist. This can be used to determine if
+        * plugin should be loaded.
+        *
+        * @return ETrue in case plugin is in blacklist and should not be loaded.
+        *         EFalse in case plugin should not be loaded
+        */
+        TBool IsInBlackList( TUid aPluginUid );
+
+    protected: // New
+
+        /**
+        * C++ constructor
+        */
+        CGSWatchDog();
+
+        /**
+        * Second phase constructor
+        */
+        void ConstructL();
+
+        /**
+        * Reads previous state from persistent data storage.
+        */
+        void ReadStateL();
+
+        /**
+        * Stores iGSAppRunning, iQuarantinedPluginUid and iBlackList data to
+        * persistent storage.
+        */
+        void StoreStateL();
+
+        /**
+        * Sets state values to default values and stores these.
+        */
+        void InitStateL();
+
+        /**
+        * Reads quarantine data from persistent storage.
+        */
+        void ReadQuarantineL();
+
+        /**
+        * Stores quarantine data to persistent storage.
+        */
+        void StoreQuarantineL();
+
+        /**
+        * Reads blacklist data from persistent storage.
+        */
+        void ReadBlackListL();
+
+        /**
+        * Stores blacklist data to persistent storage.
+        */
+        void StoreBlackListL();
+
+        /**
+        * Updates run counter of each blacklisted plugin. Removes plugin from
+        * blacklist if it has been there long enough
+        * (KGSDefaultMaxPluginBlackListedRuns).
+        */
+        void UpdateBlackListedPluginRunCounters();
+
+    private: // Data
+
+        /**
+        * ETrue if WatchDog is active (GS has crashed in previous run).
+        */
+        TBool iIsActive;
+
+        /**
+        * Counter for GS crashes in a row. This is used to customize watchdog
+        * behaviour. Defines how many crashes are observed before watchdog is
+        * activated. The bigger the value, more tolerant behaviour towards crashing
+        * plugins. See iWatchdogActivationLimit.
+        *
+        * -1 = Watchdog is completely disabled regardless any crash.
+        *  1 = In paractise the fastest reaction, meaning watchdog is enabled the next
+        *      run GS starts after a crash.
+        *  2 = GS can have 1 crash without watchdog being enabled = 2nd GS crash in a
+        *      row will enable watchdog.
+        *  n = GS can have n-1 crashes before watchdog being activated etc.
+        */
+        TInt iCrashCounter;
+
+        /**
+        * Emulates stored data. Set on when GS running, off when GS exits
+        * cleanly. Check this when starting GS to see if last exit was clean.
+        */
+        TBool iGSAppRunning;
+
+        /**
+        * Uids for plugins which should be banned. They caused GS crash in
+        * previous runs.
+        */
+        RArray<TGSPluginQuarantine> iBlackList;
+
+        /**
+        * Run time quarantine for plugins.
+        */
+        RArray<TUid> iQuarantine;
+
+        /**
+        * Persistent storage.
+        */
+        CRepository* iStore;
+
+        /**
+        * Defines how long a plugin is held in blacklist.
+        * KGSDefaultMaxPluginBlackListedRuns is used if no CenRep value is defined.
+        */
+        TInt iMaxPluginBlackListedRuns;
+
+        /**
+        * Defines how many crashes is needed to activate watchdog.
+        * KGSDefaultWatchdogActivationLimit is used in case no CenRep value is
+        * defined.
+        */
+        TInt iWatchdogActivationLimit;
+    };
+
+#endif // GSWATCHDOG_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/conset.hlp.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+//
+// conset.hlp.hrh
+//
+
+//
+// File generated by cshlpcmp Version 011
+//
+
+#ifndef __CONSET_HLP_HRH__
+#define __CONSET_HLP_HRH__
+
+
+_LIT(KSET_HLP_CONNEC_AP_VIEW,"SET_HLP_CONNEC_AP_VIEW"); //Access points item of Connection settings 
+_LIT(KSET_HLP_AP_SETTING_DATA,"SET_HLP_AP_SETTING_DATA"); //Data call access point settings 
+_LIT(KSET_HLP_AP_SETTING_GPRS,"SET_HLP_AP_SETTING_GPRS"); //GPRS access point settings 
+_LIT(KSET_HLP_AP_SETTING_WLAN,"SET_HLP_AP_SETTING_WLAN"); //WLAN access point settings
+_LIT(KSET_HLP_WLAN_WEP_MAIN,"SET_HLP_WLAN_WEP_MAIN"); //WLAN security settings for WEP
+_LIT(KSET_HLP_WLAN_WEP_KEY_SETT,"SET_HLP_WLAN_WEP_KEY_SETT"); //WEP key parameters
+_LIT(KSET_HLP_WLAN_8021X_MAIN,"SET_HLP_WLAN_8021X_MAIN"); //WLAN security settings for 802.1
+_LIT(KSET_HLP_WLAN_WPA_MAIN,"SET_HLP_WLAN_WPA_MAIN"); //WLAN security settings for WPA
+_LIT(KSET_HLP_AP_SETTING_GPRS_AS,"SET_HLP_AP_SETTING_GPRS_AS"); //GPRS access point settings, Advanced 
+_LIT(KSET_HLP_AP_SETTING_DATA_AS,"SET_HLP_AP_SETTING_DATA_AS"); //Data call access point settings, Advanced 
+_LIT(KSET_HLP_AP_SETTING_WLAN_AS,"SET_HLP_AP_SETTING_WLAN_AS"); //WLAN access point settings, Advanced 
+_LIT(KSET_HLP_AP_DATA_AS_IPV4,"SET_HLP_AP_DATA_AS_IPV4"); //IPv4 data call ap settings
+_LIT(KSET_HLP_AP_WLAN_AS_IPV4,"SET_HLP_AP_WLAN_AS_IPV4"); //IPv4 WLANl ap settings
+_LIT(KSET_HLP_AP_DATA_AS_IPV6,"SET_HLP_AP_DATA_AS_IPV6"); //IPv6 data call ap settings
+_LIT(KSET_HLP_AP_WLAN_AS_IPV6,"SET_HLP_AP_WLAN_AS_IPV6"); //IPv6 data call ap settings
+_LIT(KSET_HLP_CONNEC_GPRS,"SET_HLP_CONNEC_GPRS"); //GPRS item of Connection settings 
+_LIT(KSET_HLP_WLAN_SETTINGS,"SET_HLP_WLAN_SETTINGS"); //WLAN settings view
+_LIT(KSET_HLP_WLAN_ADV_SETTINGS,"SET_HLP_WLAN_ADV_SETTINGS"); //WLAN advanced settings
+_LIT(KSET_HLP_CONNEC_DATA,"SET_HLP_CONNEC_DATA"); //Data call item of Connection settings 
+_LIT(KPROV_HLP_CONFCONT,"PROV_HLP_CONFCONT"); //Configurations contexts list
+_LIT(KSET_HLP_VPN_AP_VIEW,"SET_HLP_VPN_AP_VIEW"); //VPN access points view
+_LIT(KSET_HLP_VPN_AP_SETTINGS_VIEW,"SET_HLP_VPN_AP_SETTINGS_VIEW"); //VPN access point settings view
+_LIT(KSIP_HLP_MAIN,"SIP_HLP_MAIN"); //SIP settings, main view
+_LIT(KSIP_HLP_PROF_PARAMS,"SIP_HLP_PROF_PARAMS"); //SIP profile parameters
+_LIT(KSIP_HLP_PROXY_PARAMS,"SIP_HLP_PROXY_PARAMS"); //Proxy server parameters view
+_LIT(KSIP_HLP_REGISTRAR_PARAM,"SIP_HLP_REGISTRAR_PARAM"); //Registrar server parameters view
+_LIT(KACL_HLP_MAIN,"ACL_HLP_MAIN"); //ACL main view
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/div.hlp.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Help text context for Divert.
+*
+*/
+
+
+#ifndef __DIV_HLP_HRH__
+#define __DIV_HLP_HRH__
+
+//Call divert/forwarding
+_LIT(KDIV_HLP_CALL_FORW,"DIV_HLP_CALL_FORW"); 
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/inc/set.hlp.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 - 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        All the help IDs are declared here
+*
+*/
+
+//
+// File generated by cshlpcmp Version 011
+//
+
+#ifndef __SET_HLP_HRH__
+#define __SET_HLP_HRH__
+
+
+_LIT(KSET_HLP_SETTINGS_MAIN_VIEW,"SET_HLP_SETTINGS_MAIN_VIEW"); //General settings, Main view
+_LIT(KSET_HLP_GENERAL_LIST,"SET_HLP_GENERAL_LIST"); //General settings list
+_LIT(KSET_HLP_PERSONAL_LIST,"SET_HLP_PERSONAL_LIST"); //Personalisation list view
+_LIT(KSET_HLP_PERSONAL_DISPLAY,"SET_HLP_PERSONAL_DISPLAY"); //Display settings view
+_LIT(KSET_HLP_PERSONAL_IDLE,"SET_HLP_PERSONAL_IDLE"); //Idle settings view
+_LIT(KSET_HLP_PERSONAL_LANGUAGE,"SET_HLP_PERSONAL_LANGUAGE"); //Language settings view
+_LIT(KSET_HLP_ACCESSORIES_LIST,"SET_HLP_ACCESSORIES_LIST"); //Accessories list
+_LIT(KSET_HLP_ACCESSORIES_HEADSET,"SET_HLP_ACCESSORIES_HEADSET"); //Accessories; Headset settings
+_LIT(KSET_HLP_ACCESSORIES_LOOPSET,"SET_HLP_ACCESSORIES_LOOPSET"); //Accessories; Loopset settings
+_LIT(KSET_HLP_ACCESS_WIRED_CK,"SET_HLP_ACCESS_WIRED_CK"); //Wired carkit accessory settings 
+_LIT(KSET_HLP_ACCESS_WIRELESS_CK,"SET_HLP_ACCESS_WIRELESS_CK"); //Wireless carkit accessory settings 
+_LIT(KSET_HLP_ACCESSORIES_TTY,"SET_HLP_ACCESSORIES_TTY"); //Accessories; TTY settings
+_LIT(KSET_HLP_ACCESSORIES_MUSIC_ST,"SET_HLP_ACCESSORIES_MUSIC_ST"); //Music stand settings
+_LIT(KSET_HLP_SECURITY_LIST,"SET_HLP_SECURITY_LIST"); //Security settings list
+_LIT(KSET_HLP_SECURITY_DEVICE_SIM,"SET_HLP_SECURITY_DEVICE_SIM"); //Device & SIM security
+_LIT(KSET_HLP_TRANSACTION_TRACKING,"SET_HLP_TRANSACTION_TRACKING"); //Transaction tracking security settings
+_LIT(KSET_HLP_GENERAL_ORIG_SET,"SET_HLP_GENERAL_ORIG_SET"); //Restore original settings view
+_LIT(KSET_HLP_TELEPHONE_LIST,"SET_HLP_TELEPHONE_LIST"); //Telephone settings list view
+_LIT(KSET_HLP_TELEP_CALL_SET,"SET_HLP_TELEP_CALL_SET"); //Call settings 
+_LIT(KCCBS_HLP_QUEUE_LIST,"CCBS_HLP_QUEUE_LIST"); //CCBS queue view
+_LIT(KDIV_HLP_CALL_FORW_MAIN,"DIV_HLP_CALL_FORW_MAIN"); //Call divert settings, main view
+_LIT(KDIV_HLP_CALL_FORW_VOI,"DIV_HLP_CALL_FORW_VOI"); //Call divert/forward for voice calls
+_LIT(KDIV_HLP_CALL_FORW_DAT,"DIV_HLP_CALL_FORW_DAT"); //Call divert/forward for data and video calls
+_LIT(KDIV_HLP_CALL_FORW_FAX,"DIV_HLP_CALL_FORW_FAX"); //Call divert/forward for fax calls
+_LIT(KDIV_HLP_BARRING_MAIN,"DIV_HLP_BARRING_MAIN"); //Call barring settings
+_LIT(KDIV_HLP_CALL_FORW_VOIP,"DIV_HLP_CALL_FORW_VOIP"); //Internet call barring
+_LIT(KSET_HLP_BARRING_SETTINGS,"SET_HLP_BARRING_SETTINGS"); //Regular call barring settings
+_LIT(KSET_HLP_TELEP_NETWORK_SET,"SET_HLP_TELEP_NETWORK_SET"); //GSM Network settings
+_LIT(KSET_HLP_CONN_LIST,"SET_HLP_CONN_LIST"); //Connection settings list
+_LIT(KVOIP_HLP_SETTING,"VOIP_HLP_SETTING"); //VOip settings
+_LIT(KVOIP_HLP_CONNECTION_SETTING,"VOIP_HLP_CONNECTION_SETTING"); //VoIP connection set view
+_LIT(KSET_HLP_APPLICATIONS_LIST,"SET_HLP_APPLICATIONS_LIST"); //Application settings list view
+_LIT(KSET_HLP_ACCESSORIES_TVOUT,"SET_HLP_ACCESSORIES_TVOUT"); //Accessories; TvOut settings
+_LIT(KSET_HLP_ACCESSORIES_HEADPHONE,"SET_HLP_ACCESSORIES_HEADPHONE"); //Accessories; TvOut settings
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSBaseContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,255 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Base container for GS some views.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <gsbasecontainer.h>
+
+#include    <akncontext.h>
+#include    <aknlists.h>
+#include    <aknnavi.h>
+#include    <akntitle.h>
+#include    <AknUtils.h>
+#include    <avkon.hrh>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <barsread.h>
+#include    <calslbs.h>
+#include    <e32def.h>
+#include    <eikbtgpc.h>
+#include    <eikclbd.h>
+#include    <eikenv.h>
+#include    <eikfrlbd.h>
+#include    <eiklbx.h>
+#include    <eikslb.h>
+#include    <gulicon.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CGSBaseContainer::BaseConstructL
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseContainer::BaseConstructL( const TRect& aRect,
+                                                TInt aResTitleId,
+                                                TInt aResLbxId )
+    {
+    CEikStatusPane* sp = iAvkonAppUi->StatusPane();
+
+    CAknTitlePane* title =
+        static_cast<CAknTitlePane*> (
+        sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+
+    TResourceReader rReader;
+    iCoeEnv->CreateResourceReaderLC( rReader, aResTitleId );
+    title->SetFromResourceL( rReader );
+    CleanupStack::PopAndDestroy(); // rReader
+
+
+    CreateWindowL(); // Makes the control a window-owning control
+
+    // Set iListBox to be contained in this container:
+    iListBox->SetContainerWindowL( *this );
+
+    ConstructListBoxL( aResLbxId );
+
+    iListBox->CreateScrollBarFrameL( ETrue );
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff,
+        CEikScrollBarFrame::EAuto );
+
+    SetRect( aRect );
+    ActivateL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseContainer::CGSBaseContainer
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSBaseContainer::CGSBaseContainer()
+    {
+    iElaf = ( AknLayoutUtils::Variant() == EEuropeanVariant );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseContainer::~CGSBaseContainer
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSBaseContainer::~CGSBaseContainer()
+    {
+    if ( iListBox )
+        {
+        delete iListBox;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseContainer::ConstructListBoxL
+//
+//  Construct's ListBox from Resource ID
+// ---------------------------------------------------------------------------
+//
+void CGSBaseContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    TResourceReader rReader;
+    iCoeEnv->CreateResourceReaderLC( rReader, aResLbxId );
+
+    // Construct's iListBox from resource file
+    iListBox->ConstructFromResourceL( rReader );
+    CleanupStack::PopAndDestroy(); // rReader
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseContainer::SizeChanged
+// called by framwork when the view size is changed
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseContainer::SizeChanged()
+    {
+    if ( iListBox )
+        {
+        iListBox->SetRect( Rect() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseContainer::CountComponentControls
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CGSBaseContainer::CountComponentControls() const
+    {
+    return 1;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseContainer::ComponentControl
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeControl* CGSBaseContainer::ComponentControl( TInt /*aIndex*/ )
+    const
+    {
+    return iListBox;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::TKeyResponse OfferKeyEventL
+// Called when a key is pressed.
+//
+// ---------------------------------------------------------------------------
+
+EXPORT_C TKeyResponse CGSBaseContainer::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+            // Listbox takes all event even if it doesn't use them:
+            return EKeyWasNotConsumed;
+        default:
+            break;
+        }
+
+    // Now it's iListBox's job to process the key event
+    return iListBox->OfferKeyEventL( aKeyEvent, aType );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSMainContainer::HandleResourceChange
+//
+// ---------------------------------------------------------------------------
+EXPORT_C void CGSBaseContainer::HandleResourceChange( TInt aType )
+    {
+    CCoeControl::HandleResourceChange( aType );
+    if ( aType == KAknsMessageSkinChange ||
+         aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
+                                           mainPaneRect);
+        SetRect( mainPaneRect );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSBaseContainer::SetSelectedItem()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseContainer::SetSelectedItem( TInt aIndex )
+    {
+    if( iListBox && aIndex >= 0 )
+        {
+        iListBox->SetCurrentItemIndexAndDraw( aIndex );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSBaseContainer::SelectedItem()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CGSBaseContainer::SelectedItem()
+    {
+    TInt selectedItem = 0;
+    if( iListBox )
+        {
+        selectedItem = iListBox->CurrentItemIndex();
+        }
+    return selectedItem;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSContainer::FocusChanged
+//
+// Set focus on the selected listbox. For animated skins feature.
+// ---------------------------------------------------------------------------
+EXPORT_C void CGSBaseContainer::FocusChanged( TDrawNow /*aDrawNow*/ )
+    {
+    if( iListBox )
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSBaseDocument.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,264 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base Document for the General Settings Application
+*
+*/
+
+#include "GSBaseDocument.h"
+
+// User includes
+#include "GSPluginWrapper.h"
+#include "GSPluginAndViewIdCache.h"
+#include "GSWatchDog.h"
+#include "gsplugininterface.h"
+#include "GsLogger.h"
+
+// Constants
+const TInt KGSPluginWrapperObjectGranularity = 10;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------
+// CGSBaseDocument::CGSBaseDocument()
+// constructor
+//
+// ----------------------------------------------------
+//
+EXPORT_C CGSBaseDocument::CGSBaseDocument( CEikApplication& aApp )
+:   CAknDocument( aApp ),
+    iUnloadWrapperObjects( KGSPluginWrapperObjectGranularity )
+    {
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::~CGSBaseDocument()
+// destructor
+//
+// ----------------------------------------------------
+//
+EXPORT_C CGSBaseDocument::~CGSBaseDocument()
+    {
+    // This physically unloads the plugin dlls if their ECOM
+    // reference count is zero. This must be the last thing to
+    // occur to any plugin object (i.e. all of its code must have
+    // finished running by the time this next line takes place).
+    const TInt count = iUnloadWrapperObjects.Count();
+    for( TInt i=count-1; i>=0; i-- )
+        {
+        CGSPluginWrapper* object = iUnloadWrapperObjects[ i ];
+        (void) object;
+        delete object;
+        }
+
+    iUnloadWrapperObjects.Close();
+    delete iPluginViewIdCache;
+    delete iWatchDog;
+
+    iImplInfoArray.ResetAndDestroy();// This is needed
+    iImplInfoArray.Close();
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::ConstructL()
+// Symbian OS second phase constructor
+//
+// ----------------------------------------------------
+//
+EXPORT_C void CGSBaseDocument::ConstructL()
+    {
+    iWatchDog = CGSWatchDog::NewL();
+
+    REComSession::ListImplementationsL(
+        KGSPluginInterfaceUid,
+        iImplInfoArray );
+#ifdef _DEBUG
+    PrintImplInfoArray( iImplInfoArray );
+#endif //_DEBUG
+        
+    __GSLOGSTRING1(
+        "[CGSBaseDocument::ConstructL] iImplInfoArray count:%d",
+        iImplInfoArray.Count() );
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::NewPluginUnloadWrapperLC()
+//
+//
+// ----------------------------------------------------
+//
+EXPORT_C CGSPluginWrapper* CGSBaseDocument::NewPluginUnloadWrapperLC()
+    {
+    CGSPluginWrapper* wrapper = new(ELeave) CGSPluginWrapper( *this );
+    TCleanupItem wrapperCleanupItem( CleanupPluginWrapperObject, wrapper );
+    CleanupStack::PushL( wrapperCleanupItem );
+    iUnloadWrapperObjects.AppendL( wrapper );
+    //
+    return wrapper;
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::PreparePluginCacheL()
+//
+//
+// ----------------------------------------------------
+//
+EXPORT_C void CGSBaseDocument::PreparePluginCacheL( CEikAppUi& aAppUi )
+    {
+    iPluginViewIdCache = CGSPluginAndViewIdCache::NewL( aAppUi );
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::PrepareForUIDestruction()
+//
+//
+// ----------------------------------------------------
+//
+EXPORT_C void CGSBaseDocument::PrepareForUIDestruction()
+    {
+    if  ( iPluginViewIdCache )
+        {
+        iPluginViewIdCache->PrepareForUIDestruction();
+        }
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::CleanupPluginWrapperObject()
+// Cleanup support
+//
+// ----------------------------------------------------
+//
+void CGSBaseDocument::CleanupPluginWrapperObject( TAny* aWrapper )
+    {
+    CGSPluginWrapper* wrapper =
+        reinterpret_cast< CGSPluginWrapper* >( aWrapper );
+    CGSBaseDocument& document = wrapper->Document();
+    document.DoCleanupPluginWrapper( wrapper );
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::DoCleanupPluginWrapper()
+// Cleanup support - called when loading a plugin fails
+//
+// ----------------------------------------------------
+//
+void CGSBaseDocument::DoCleanupPluginWrapper( CGSPluginWrapper* aWrapper )
+    {
+    const TInt index = iUnloadWrapperObjects.Find( aWrapper );
+    if  ( index >= 0 && index < iUnloadWrapperObjects.Count() )
+        {
+        iUnloadWrapperObjects.Remove( index );
+        delete aWrapper;
+        }
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::PluginViewIdCache()
+//
+//
+// ----------------------------------------------------
+//
+CGSPluginAndViewIdCache& CGSBaseDocument::PluginViewIdCache()
+    {
+    ASSERT( iPluginViewIdCache );
+    return *iPluginViewIdCache;
+    }
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::PluginViewIdCache()
+//
+//
+// ----------------------------------------------------
+//
+const CGSPluginAndViewIdCache& CGSBaseDocument::PluginViewIdCache() const
+    {
+    ASSERT( iPluginViewIdCache );
+    return *iPluginViewIdCache;
+    }
+
+
+
+// ----------------------------------------------------
+// CGSBaseDocument::WatchDog()
+//
+//
+// ----------------------------------------------------
+//
+EXPORT_C MGSWatchDog* CGSBaseDocument::WatchDog()
+    {
+    return iWatchDog;
+    }
+
+// ----------------------------------------------------
+// CGSBaseDocument::GetImplInfos()
+//
+//
+// ----------------------------------------------------
+//
+EXPORT_C RImplInfoPtrArray CGSBaseDocument::GetImplInfo()
+    {
+    return iImplInfoArray;
+    }
+
+EXPORT_C void CGSBaseDocument::CreateShimmedViewL(const TUid aViewUid)
+	{
+	ASSERT(iPluginViewIdCache);
+	if ( !iPluginViewIdCache->PluginInstance(aViewUid) )
+		{
+		iPluginViewIdCache->RegisterViewAndImplementationAssociationL(aViewUid, aViewUid, ETrue);
+		}
+	}
+
+void CGSBaseDocument::PrintImplInfoArray( const RImplInfoPtrArray& aImplInfoArray )
+    {
+    for( TInt i = 0; i < aImplInfoArray.Count(); i++ )
+        {
+        PrintImplInfo( *aImplInfoArray[ i ] );
+        }
+    }
+
+
+void CGSBaseDocument::PrintImplInfo( const CImplementationInformation& aInfo )
+    {
+    __GSLOGSTRING1( "[CGSBaseDocument] --Plugin 0x%X info--", &aInfo);
+    __GSLOGSTRING1( "[CGSBaseDocument] DisplayName:%S", &aInfo.DisplayName() );
+    __GSLOGSTRING1( "[CGSBaseDocument] ImplementationUid:0x%X",
+                    aInfo.ImplementationUid() );
+
+    const TInt KMaxEComDataLength = 256;
+
+    HBufC* dataType = HBufC::New( KMaxEComDataLength );
+    HBufC* opaqueData = HBufC::New( KMaxEComDataLength );
+
+    dataType->Des().Copy( aInfo.DataType() );
+    opaqueData->Des().Copy( aInfo.OpaqueData() );
+    __GSLOGSTRING1( "[CGSBaseDocument] DataType:%S", dataType );
+    __GSLOGSTRING1( "[CGSBaseDocument] OpaqueData:%S", opaqueData );
+
+    delete opaqueData;
+    delete dataType;
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,308 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base view for all General Settings views.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <gsbaseview.h>
+#include    <gsbasecontainer.h>
+
+#include    <aknnavide.h>
+#include    <akntabgrp.h>
+#include    <akntitle.h>
+#include    <AknUtils.h>
+#include    <aknViewAppUi.h>
+#include    <barsread.h>
+#include    <bautils.h> // BaflUtils
+#include    <bldvariant.hrh>
+#include    <featmgr.h>
+
+
+//Disabling warning caused by KGSDoActivateError constant
+#pragma diag_suppress 177
+// CONSTANTS
+_LIT( KGSDoActivateError, "DoActivateL" );
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::CGSBaseView
+//
+// C++ constructor
+// ---------------------------------------------------------------------------
+EXPORT_C CGSBaseView::CGSBaseView()
+    : iResourceLoader( *iCoeEnv )
+    {
+    iAppUi = AppUi();
+    iElaf = ( AknLayoutUtils::Variant() == EEuropeanVariant );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::~CGSBaseView
+//
+// Destructor
+// ---------------------------------------------------------------------------
+EXPORT_C CGSBaseView::~CGSBaseView()
+    {
+    iResourceLoader.Close();
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    if ( iNaviPaneContext )
+        {
+        delete iNaviPaneContext;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::Container
+//
+//
+// ---------------------------------------------------------------------------
+EXPORT_C CGSBaseContainer* CGSBaseView::Container()
+    {
+    return iContainer;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::SetCurrentItem
+//
+//
+// ---------------------------------------------------------------------------
+EXPORT_C void CGSBaseView::SetCurrentItem( TInt aIndex )
+    {
+    iCurrentItem = aIndex;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::HandleListBoxEventL
+//
+//
+// ---------------------------------------------------------------------------
+
+EXPORT_C void CGSBaseView::HandleListBoxEventL( CEikListBox* /*aListBox*/,
+                                                TListBoxEvent aEventType )
+    {
+    switch ( aEventType )
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemSingleClicked:
+            HandleListBoxSelectionL();
+            break;
+        default:
+           break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::SetNaviPaneL
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseView::SetNaviPaneL()
+    {
+    CAknNavigationControlContainer* naviControlContainer = 
+                                            NaviControlContainerL();
+    if ( iNaviPaneContext )
+        {
+        naviControlContainer->PushL( *iNaviPaneContext );
+        }
+    else
+        {
+        naviControlContainer->PushDefaultL();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::CreateNaviPaneContextL
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseView::CreateNaviPaneContextL( TInt aResourceId )
+    {
+    TResourceReader reader;
+    iCoeEnv->CreateResourceReaderLC( reader, aResourceId );
+    CAknNavigationControlContainer* naviControlContainer = 
+                                             NaviControlContainerL();
+    iNaviPaneContext = naviControlContainer->CreateMessageLabelL( reader );
+    CleanupStack::PopAndDestroy();  // reader
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::NaviControlContainerL
+//
+//
+// ---------------------------------------------------------------------------
+//
+CAknNavigationControlContainer* CGSBaseView::NaviControlContainerL()
+    {
+    CAknNavigationControlContainer* control = NULL;
+    if( !iNaviControlContainer )
+        {
+        iNaviControlContainer =
+            static_cast<CAknNavigationControlContainer*>(
+                AppUi()->StatusPane()->ControlL( TUid::Uid(
+                    EEikStatusPaneUidNavi ) ) );
+        }
+    else
+        {
+        control = iNaviControlContainer;
+        }
+    
+    return control;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::HandleClientRectChange
+//
+//
+// ---------------------------------------------------------------------------
+void CGSBaseView::HandleClientRectChange()
+    {
+    if ( iContainer && iContainer->iListBox )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::DoActivateL
+// Activates the view.
+//
+// ---------------------------------------------------------------------------
+EXPORT_C void CGSBaseView::DoActivateL( const TVwsViewId& aPrevViewId,
+                                        TUid /*aCustomMessageId*/,
+                                        const TDesC8& /*aCustomMessage*/ )
+    {
+    iPrevViewId = aPrevViewId;
+//    if( iContainer )
+//        {
+//        AppUi()->RemoveFromViewStack( *this, iContainer );
+//
+//        delete iContainer;
+//        iContainer = NULL;
+//        }
+    if ( !iContainer )
+    	{
+    	CreateContainerL();
+		AppUi()->AddToViewStackL( *this, iContainer );
+		iContainer->iListBox->SetListBoxObserver( this ) ;
+		iContainer->iListBox->SetTopItemIndex( iTopItemIndex );
+		iContainer->SetSelectedItem( iCurrentItem );
+    	}
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+EXPORT_C void CGSBaseView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iCurrentItem = iContainer->SelectedItem();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::CreateContainerL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseView::CreateContainerL()
+    {
+    NewContainerL();
+    __ASSERT_DEBUG(
+        iContainer, User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) );
+    iContainer->SetMopParent( this );
+
+    TRAPD( error, iContainer->ConstructL( ClientRect() ) );
+
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSBaseView::OpenLocalizedResourceFileL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseView::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    aResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSBaseView::ResetSelectedItemIndex()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSBaseView::ResetSelectedItemIndex()
+    {
+    iCurrentItem = 0;
+    if( iContainer )
+        {
+        iContainer->SetSelectedItem( iCurrentItem );
+        }
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSEComNotifier.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <gsplugininterface.h>
+#include "GSEComNotifier.h"
+#include "GsLogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CGSEComNotifier::CGSEComNotifier( MGSEComObserver* aObserver,
+                                  RImplInfoPtrArray aImplInfo )
+    : CActive( EPriorityStandard ),
+      iObserver( aObserver ),
+      iOriginalImplInfo( aImplInfo )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CGSEComNotifier::ConstructL()
+    {
+    iEComSession = REComSession::OpenL();
+    IssueRequest();
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSEComNotifier* CGSEComNotifier::NewL( MGSEComObserver* aObserver,
+                                                 RImplInfoPtrArray aImplInfo )
+    {
+    CGSEComNotifier* self = new( ELeave ) CGSEComNotifier(
+        aObserver,
+        aImplInfo );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSEComNotifier::~CGSEComNotifier()
+    {
+    Cancel();
+    iEComSession.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// See base class.
+// ---------------------------------------------------------------------------
+//
+void CGSEComNotifier::DoCancel()
+    {
+    iEComSession.CancelNotifyOnChange( iStatus );
+    }
+
+
+// ---------------------------------------------------------------------------
+// See base class.
+// ---------------------------------------------------------------------------
+//
+void CGSEComNotifier::RunL()
+    {
+    __GSLOGSTRING1( "[CGSEComNotifier::RunL] iStatus:%d", iStatus );
+
+    if( PluginCountDeltaL() < 0 )
+        {
+        iObserver->HandleEComEvent( MGSEComObserver::EPluginRemoved );
+        }
+
+    IssueRequest();
+
+    __GSLOGSTRING1( "[CGSEComNotifier::RunL] iStatus:%d", iStatus );
+    }
+
+
+// ---------------------------------------------------------------------------
+// See base class.
+// ---------------------------------------------------------------------------
+//
+TInt CGSEComNotifier::RunError( TInt aError )
+    {
+    __GSLOGSTRING2(
+        "[CGSEComNotifier::RunError] aError:%d iStatus:%d",
+        aError, iStatus );
+
+    // Special case: Application can throw KLeaveExit basically anytime so we
+    // have to forward it upwards to app framework.
+    if( aError == KLeaveExit )
+        {
+        return aError;
+        }
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CGSEComNotifier::IssueRequest()
+    {
+    if( !IsActive() )
+        {
+        // NotifyOnChange is single shot.
+        iEComSession.NotifyOnChange( iStatus );
+        SetActive();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSEComNotifier::PluginCountDeltaL()
+    {
+    // Owned
+    RImplInfoPtrArray newImplInfo;
+
+    REComSession::ListImplementationsL(
+        KGSPluginInterfaceUid,
+        newImplInfo );
+
+    TInt oldInfoCount = iOriginalImplInfo.Count();
+    TInt newInfoCount = newImplInfo.Count();
+
+    __GSLOGSTRING2(
+        "[CGSEComNotifier::PluginCountDeltaL] iOriginalImplInfo:%d newImplInfo:%d",
+        oldInfoCount, newInfoCount );
+
+    newImplInfo.ResetAndDestroy();
+    newImplInfo.Close();
+
+    // Count the delta between old and current infos:
+    return newInfoCount - oldInfoCount;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,869 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for GSParentPlugin.
+*
+*/
+
+// INCLUDE FILES
+#include    <gsparentcontainer.h>
+#include    <gsparentplugin.h>
+#include    <gsplugininterface.h>
+#include    "GsLogger.h"
+#include    <GSParentPluginRsc.rsg>
+#include    <gsfwviewuids.h>
+#include    "GSBaseDocument.h"
+#include    <mgswatchdog.h>
+
+#include    <AknIconArray.h>  //for loading icons
+#include    <aknlists.h>
+#include    <AknsUtils.h>     //for loading icons
+#include    <akntitle.h>
+#include    <akntitle.h>
+#include    <aknViewAppUi.h>
+#include    <barsread.h> // For TResourceReader
+#include    <bldvariant.hrh>
+#include    <calslbs.h>
+#include    <eikclbd.h>
+
+//CONSTANTS
+const TInt KGSPluginArrayInitSize = 10;
+const TInt KGSCaptionBufSize = 256;
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::ConstructL(const TRect& aRect)
+// Symbian OS two phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSParentContainer::ConstructL(
+    const TRect& aRect,
+    CAknViewAppUi* aAppUi,
+    CArrayPtrFlat<CGSPluginInterface>* aPluginArray,
+    TInt aTitleRscId,
+    CGSParentPlugin* aParentPlugin,
+    TGSListboxTypes aListBoxType )
+    {
+    iAppUi = aAppUi;
+    iPluginArray = aPluginArray;
+    iListBoxType = aListBoxType;
+    iParentPlugin = aParentPlugin;
+
+    CGSBaseDocument* doc = static_cast< CGSBaseDocument* >( iAppUi->Document() );
+    iGSWatchDog = doc->WatchDog();
+
+    // Initialize the array containing pointers to plugins that are actually
+    // displayed in lbx.
+    iVisiblePlugins = new (ELeave) CArrayPtrFlat<CGSPluginInterface>( KGSPluginArrayInitSize );
+
+    __GSLOGSTRING( "[CGSParentContainer] ConstructL" );
+
+    // Set view title from resource:
+    CEikStatusPane* sp = iAppUi->StatusPane();
+    CAknTitlePane* title = static_cast<CAknTitlePane*>
+        ( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    TResourceReader rReader;
+    iCoeEnv->CreateResourceReaderLC( rReader, aTitleRscId );
+    title->SetFromResourceL( rReader );
+    CleanupStack::PopAndDestroy(); // rReader
+
+    CreateWindowL(); //makes this control a window-owning control
+
+    CreateListBoxL( iListBoxType );
+
+    SetRect( aRect );
+    ActivateL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::~CGSParentContainer()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSParentContainer::~CGSParentContainer()
+    {
+    __GSLOGSTRING( "[CGSParentContainer] ~CGSParentContainer()|->" );
+    if  ( iVisiblePlugins )
+        {
+        iVisiblePlugins->Reset();
+        }
+    delete iVisiblePlugins;
+    if ( iListBox )
+        {
+        delete iListBox;
+        }
+    __GSLOGSTRING( "[CGSParentContainer] ~CGSParentContainer()-|" );
+  }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::UpdateListboxL
+//
+// Updates listbox from iPluginArray. Uses switch statement to handle different
+// listbox types from TGSListboxTypes because the list item format
+// and icon numbers depend on the listbox type.
+// ---------------------------------------------------------------------------
+//
+void CGSParentContainer::UpdateListBoxL()
+    {
+    __GSLOGSTRING( "[CGSParentContainer::UpdateListBoxL]" );
+    iItemTextArray->Reset();
+
+    // Empty the array because it will be updated.
+    iVisiblePlugins->Reset();
+
+    // Array for icons in the listbox. Array owns the icons.
+    CAknIconArray* icons = NULL;
+
+    // Create icon array if required by the listbox type:
+    switch( iListBoxType )
+        {
+        case EGSListBoxTypeSingleLarge:
+        case EGSListBoxTypeDouble2Large:
+        case EGSListBoxTypeDoubleLarge:
+            icons = new (ELeave) CAknIconArray( KGSPluginArrayInitSize );
+            CleanupStack::PushL( icons );
+            break;
+
+        default:
+            break;
+        }
+
+    // Counter for created icons. This is used to maintain corrext indexing for
+    // each plugin's icons in case a plugin has multiple icons and icon indexes
+    // can not be mapped directly to plugin index.
+    TInt iconCounter = 0;
+
+    // 1) Add each plugin's data to listbox if the plugin is visible.
+    for( TInt i = 0; i < iPluginArray->Count(); i++ )
+        {
+        CGSPluginInterface* plugin = iPluginArray->operator[]( i );
+
+        // Adding plugin data to lbx has a lot of CGSPluginInterface API calls.
+        // -> A good place to use quarantine to catch panicking plugins in
+        // any of these calls.
+        iGSWatchDog->QuarantineL( plugin->Id() );
+        if( plugin->Visible() )
+            {
+            AddPluginDataToLbxL( plugin,
+                                 iItemTextArray,
+                                 icons,
+                                 iconCounter );
+            }
+        iGSWatchDog->RemoveFromQuarantineL( plugin->Id() );
+        }
+
+    // 2) Replace old icon array if needed.
+    switch( iListBoxType )
+        {
+        case EGSListBoxTypeSingleLarge:
+            {
+            // Temporary variable needed to use casted lbx.
+            CAknSingleLargeStyleListBox* lbx =
+                STATIC_CAST( CAknSingleLargeStyleListBox*, iListBox );
+            // Destroy the old icons because SetIconArray() does not destroy them.
+            CArrayPtr<CGulIcon>* oldIcons
+                = lbx->ItemDrawer()->ColumnData()->IconArray();
+            if( oldIcons )
+                {
+                __GSLOGSTRING( "[CGSParentContainer] Destroying old icons." );
+                oldIcons->ResetAndDestroy();
+                delete oldIcons;
+                }
+            // Transfer ownership of icon array to the lbx.
+            // SetIconArray() does not delete the old icon array
+            lbx->ItemDrawer()->ColumnData()->SetIconArray( icons );
+            CleanupStack::Pop( icons );
+            }
+            break;
+        case EGSListBoxTypeDouble2Large:
+        case EGSListBoxTypeDoubleLarge:
+            {
+            // Temporary variable needed to use casted lbx.
+            CEikFormattedCellListBox* lbx =
+                STATIC_CAST( CEikFormattedCellListBox*, iListBox );
+            // Destroy the old icons because SetIconArray() does not destroy them.
+            CArrayPtr<CGulIcon>* oldIcons
+                = lbx->ItemDrawer()->ColumnData()->IconArray();
+            if( oldIcons )
+                {
+                __GSLOGSTRING( "[CGSParentContainer] Destroying old icons." );
+                oldIcons->ResetAndDestroy();
+                delete oldIcons;
+                }
+            // Transfer ownership of icon array to the lbx.
+            // SetIconArray() does not delete the old icon array
+            lbx->ItemDrawer()->ColumnData()->SetIconArray( icons );
+            CleanupStack::Pop( icons );
+            }
+            break;
+
+        case EGSListBoxTypeSettings:
+            break;
+
+        default:
+            break;
+        }
+
+#ifdef _GS_PARENTPLUGIN_LBX_FORMAT_TRACES
+#pragma message("_GS_PARENTPLUGIN_LBX_FORMAT_TRACES activated")
+        __GSLOGSTRING( "[CGSParentContainer::UpdateListBoxL] iItemTextArray:" );
+        for( TInt i = 0; i < iItemTextArray->Count(); i++ )
+            {
+            __GSLOGSTRING1( "%S", &iItemTextArray->operator[]( i ) );
+            }
+#endif // _GS_PARENTPLUGIN_LBX_FORMAT_TRACES
+
+    // 3) Draw listbox again
+    iListBox->HandleItemAdditionL();
+    __GSLOGSTRING( "[CGSParentContainer] UpdateListBoxL()-|" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::AddPluginDataToLbxL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSParentContainer::AddPluginDataToLbxL( CGSPluginInterface* aPlugin,
+                                              CDesCArray* aItemTextArray,
+                                              CAknIconArray* aIconArray,
+                                              TInt& aIconCounter )
+    {
+    // Used to disable icon
+    const TInt KIconNotSupported = -1;
+
+    // Index of icon used in AB-column
+    TInt iconIndexAB = KIconNotSupported;
+
+    // Index of icon used in D-column
+    TInt iconIndexD = KIconNotSupported;
+
+#pragma message("TODO: The HBufC buffer sizes could be optimized if possible:")
+
+    // First line of lbx item text (plugin caption)
+    HBufC* firstLabelBuf = HBufC::NewLC( KGSCaptionBufSize );
+    TPtr firstLabel = firstLabelBuf->Des();
+
+    // Second line of lbx item text (optional)
+    HBufC* secondLabelBuf = HBufC::NewLC( KGSCaptionBufSize );
+    TPtr secondLabel = secondLabelBuf->Des();
+
+    // The complete formatted lbx item string which is added to lbx
+    HBufC* lbxItemStringBuf = HBufC::NewLC( KGSCaptionBufSize * 2 );
+    TPtr lbxItemString = lbxItemStringBuf->Des();
+
+    // Separates lbx item elements
+    _LIT( KTab, "\t" );
+
+    // Normal icon in AB-Column
+    CGulIcon* iconAB = NULL;
+
+    // Small icon used in D-column (optional)
+    CGulIcon* iconD = NULL;
+
+    // Add the plugin to visible plugins array:
+    iVisiblePlugins->AppendL( aPlugin );
+
+    // 1) Read item descriptor from plugin:
+    TRAPD( captionErr,
+           aPlugin->GetCaptionL( firstLabel );
+         )
+
+    // If plugin caption fails, set caption to error string.
+    if( captionErr != KErrNone )
+        {
+        _LIT( KGSParentPluginCaptionErrorTxt, "Error" );
+        firstLabel.Append( KGSParentPluginCaptionErrorTxt );
+        }
+       else
+        {
+        __GSLOGSTRING2( "[CGSParentContainer] 0x%X::GetCaptionL Error: %d",
+        aPlugin->Id().iUid, captionErr );
+        }
+
+    // 2) Add icons if listbox uses them:
+    //    - AB-column icon
+    //    - D-column icon
+    switch( iListBoxType )
+        {
+        case EGSListBoxTypeSingleLarge:
+        case EGSListBoxTypeDouble2Large:
+        case EGSListBoxTypeDoubleLarge:
+            {
+            // This might fail because plugin implementors might do funny stuff.
+            // GS Must still behave well...
+            TRAPD( iconErr,
+                   iconAB = aPlugin->CreateIconL( KGSIconTypeLbxItem );
+                 )
+            if( iconErr != KErrNone )
+                {
+                // Use default icon because plugin implementor's CreateIconL
+                // failed. If this fails, everything is lost anyway so might as
+                // well leave (abort GS).
+                iconAB = aPlugin->CGSPluginInterface::CreateIconL( KGSIconTypeLbxItem );
+                __GSLOGSTRING2( "[CGSParentContainer] CreateIconL for 0x%X failed:%d",
+                                aPlugin->Id().iUid,
+                                iconErr );
+                }
+            if( iconAB ) // Append only if not NULL (not supported)
+                {
+                CleanupStack::PushL( iconAB );
+                aIconArray->AppendL( iconAB );
+                CleanupStack::Pop( iconAB );
+                iconIndexAB = aIconCounter;
+                aIconCounter++;
+                }
+
+            TRAPD( iconDColErr,
+                   iconD = aPlugin->CreateIconL( KGSIconTypeDColumn );
+                 )
+            if( iconDColErr != KErrNone )
+                {
+                iconD = aPlugin->CGSPluginInterface::CreateIconL( KGSIconTypeDColumn );
+                __GSLOGSTRING2( "[CGSParentContainer] CreateIconL for 0x%X failed:%d",
+                                aPlugin->Id().iUid,
+                                iconErr );
+                }
+            if( iconD ) // Append only if not NULL (not supported)
+                {
+                CleanupStack::PushL( iconD );
+                aIconArray->AppendL( iconD );
+                CleanupStack::Pop( iconD );
+                iconIndexD = aIconCounter;
+                aIconCounter++;
+                }
+            break;
+            }
+        case EGSListBoxTypeSettings:
+            break;
+
+        default:
+            break;
+        }
+
+    /**
+    * 3) Create formatted item string. Lbx item's format string depends
+    *    on lbx type.
+    */
+    switch( iListBoxType )
+        {
+        /**
+        * list_single_large_pane:
+        * list item string format: "1\tTextLabel\t0\t0"
+        * where 0 is an index to icon array
+        */
+        case EGSListBoxTypeSingleLarge:
+            {
+            if( iconIndexAB != KIconNotSupported ) lbxItemString.AppendNum( iconIndexAB ); // AB-Column icon
+            lbxItemString.Append( KTab );
+            lbxItemString.Append( firstLabel );
+            break;
+            }
+        /**
+        * list_setting_pane and list_big_single_setting_pane:
+        * list item string format: "\tFirstLabel\t\tValueText"
+        * list item string format: "\tFirstLabel\t0\t"
+        * list item string format: "\tFirstLabel\t\tValueText\t*"
+        * list item string format: "\tFirstLabel\t\t\t\tSecondLabel"
+        * where 0 is an index to icon array
+        */
+        case EGSListBoxTypeSettings:
+            {
+            aPlugin->GetValue( EGSPluginKeySettingsItemValueString, secondLabel );
+
+            lbxItemString.Append( KTab );
+            lbxItemString.Append( firstLabel );
+            lbxItemString.Append( KTab );
+            lbxItemString.Append( KTab );
+            lbxItemString.Append( secondLabel );
+            break;
+            }
+        /**
+        * list_double2_large_graphic_pane:
+        * list item string format: "1\tFirstLabel\tSecondLabel\t0"
+        * where 0 is an index of small (13x13) icon in icon array
+        *   and 1 is an index of a thumbnail image
+        */
+        case EGSListBoxTypeDouble2Large:
+        case EGSListBoxTypeDoubleLarge:
+            {
+            aPlugin->GetValue( EGSPluginKeySettingsItemValueString, secondLabel );
+
+            if( iconIndexAB != KIconNotSupported ) lbxItemString.AppendNum( iconIndexAB ); // AB-Column icon
+            lbxItemString.Append( KTab );
+            lbxItemString.Append( firstLabel ); // FirstLabel
+            lbxItemString.Append( KTab );
+            lbxItemString.Append( secondLabel ); // SecondLabel
+            lbxItemString.Append( KTab );
+            if( iconIndexD != KIconNotSupported ) lbxItemString.AppendNum( iconIndexD ); // D-Column Icon
+            break;
+            }
+        }
+    aItemTextArray->AppendL( lbxItemString );
+
+    CleanupStack::PopAndDestroy( lbxItemStringBuf );
+    CleanupStack::PopAndDestroy( secondLabelBuf );
+    CleanupStack::PopAndDestroy( firstLabelBuf );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::ListBox()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CEikListBox* CGSParentContainer::ListBox()
+    {
+    return iListBox;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::SizeChanged
+// called by framework when the view size is changed
+//
+// ---------------------------------------------------------------------------
+//
+void CGSParentContainer::SizeChanged()
+    {
+    if ( iListBox )
+        {
+        iListBox->SetRect( Rect() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::CountComponentControls
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSParentContainer::CountComponentControls() const
+    {
+    return 1;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::ComponentControl
+//
+//
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CGSParentContainer::ComponentControl(TInt /*aIndex*/) const
+    {
+    return iListBox;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::TKeyResponse OfferKeyEventL
+// Called when a key is pressed.
+//
+// ---------------------------------------------------------------------------
+//
+TKeyResponse  CGSParentContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                  TEventCode aType )
+    {
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyUpArrow:
+        case EKeyDownArrow:
+            {
+            TKeyResponse listboxResp =
+                iListBox->OfferKeyEventL( aKeyEvent, aType );
+            if ( iParentPlugin )
+                {
+                iParentPlugin->CheckMiddleSoftkeyLabelL();
+                }
+            return listboxResp;
+            }
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+            // Listbox takes all events even if it doesn't use them
+            return EKeyWasNotConsumed;
+        default:
+            break;
+        }
+    // now it's iListBox's job to process the key event
+    return iListBox->OfferKeyEventL( aKeyEvent, aType );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::HandleListBoxEventL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSParentContainer::HandleListBoxEventL( CEikListBox* aListBox,
+                                              TListBoxEvent aEventType )
+    {
+    __GSLOGSTRING1(
+        "[CGSParentContainer] HandleListBoxEventL aEventType:%d",
+        aEventType);
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemSingleClicked:
+            {
+            __GSLOGSTRING1(
+                "[CGSParentContainer] Activating view plugin in index[%d]",
+                aListBox->CurrentItemIndex() );
+            
+            if( aListBox->CurrentItemIndex() < 0 )
+                {
+                // Negative listbox value -> no item selected? 
+                break;
+                }
+            
+            CGSPluginInterface* selectedPlugin = iVisiblePlugins->operator[](
+                aListBox->CurrentItemIndex() );
+
+            // Different command is used depending on the plugin type.
+            switch( selectedPlugin->ItemType() )
+                {
+                // In these cases the plugin is a view:
+                case EGSItemTypeSingleLarge:
+                case EGSItemTypeSetting:
+                case EGSItemTypeSettingIcon:
+                    iAppUi->ActivateLocalViewL( selectedPlugin->Id() );
+                    break;
+                // In these cases the plugin is a dialog:
+                case EGSItemTypeSettingDialog:
+                case EGSItemTypeSingleLargeDialog:
+                    selectedPlugin->HandleSelection(
+                        EGSSelectionBySelectionKey );
+                    UpdateListBoxL(); // Refrest the listbox if value changed.
+                    break;
+                }
+            }
+            break;
+
+        default:
+           break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::HandleResourceChange()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSParentContainer::HandleResourceChange( TInt aType )
+    {
+    CCoeControl::HandleResourceChange( aType );
+    //Handle layout orientation or skin change
+    if ( aType == KAknsMessageSkinChange ||
+         aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
+                                           mainPaneRect);
+        SetRect( mainPaneRect );
+        if ( aType == KAknsMessageSkinChange )
+            {
+            TRAP_IGNORE( UpdateListBoxL() );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::CreateListBoxL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSParentContainer::CreateListBoxL(
+    TGSListboxTypes aListBoxType )
+    {
+    switch( aListBoxType )
+        {
+        case EGSListBoxTypeSingleLarge:
+            {
+            CAknSingleLargeStyleListBox* lbx =
+                new( ELeave ) CAknSingleLargeStyleListBox;
+            iListBox = lbx;
+            lbx->ConstructL( this );
+            lbx->SetContainerWindowL( *this );
+            lbx->SetListBoxObserver( this );
+            lbx->CreateScrollBarFrameL( ETrue );
+            lbx->ScrollBarFrame()->SetScrollBarVisibilityL(
+                CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+            // Obtain reference to listbox model's item text array:
+            iItemTextArray = STATIC_CAST( CDesCArray*,
+                lbx->Model()->ItemTextArray() );
+            }
+            break;
+
+        case EGSListBoxTypeSettings:
+            {
+            CAknSettingStyleListBox* lbx = 
+                new( ELeave ) CAknSettingStyleListBox;
+            iListBox = lbx;
+            lbx->ConstructL( this, EAknListBoxSelectionList );
+            lbx->SetContainerWindowL( *this );
+            lbx->SetListBoxObserver( this );
+            lbx->CreateScrollBarFrameL( ETrue );
+            lbx->ScrollBarFrame()->SetScrollBarVisibilityL(
+                CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+            // Obtain reference to listbox model's item text array:
+            iItemTextArray = STATIC_CAST( CDesCArray*,
+                lbx->Model()->ItemTextArray() );
+            }
+            break;
+            
+        case EGSListBoxTypeDouble2Large:
+            {
+            TInt flags = 0;
+            CAknDouble2LargeStyleListBox* lbx = 
+                new( ELeave ) CAknDouble2LargeStyleListBox;
+            iListBox = lbx;
+            lbx->ConstructL( this, flags );
+            lbx->SetContainerWindowL( *this );
+            lbx->SetListBoxObserver( this );
+            lbx->CreateScrollBarFrameL( ETrue );
+            lbx->ScrollBarFrame()->SetScrollBarVisibilityL(
+                CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+            // Obtain reference to listbox model's item text array:
+            iItemTextArray = STATIC_CAST( CDesCArray*,
+                lbx->Model()->ItemTextArray() );
+            }
+            break;
+
+        case EGSListBoxTypeDoubleLarge:
+            {
+            TInt flags = 0;
+            CAknDoubleLargeStyleListBox* lbx = 
+                new( ELeave ) CAknDoubleLargeStyleListBox;
+            iListBox = lbx;
+            lbx->ConstructL( this, flags );
+            lbx->SetContainerWindowL( *this );
+            lbx->SetListBoxObserver( this );
+            lbx->CreateScrollBarFrameL( ETrue );
+            lbx->ScrollBarFrame()->SetScrollBarVisibilityL(
+                CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+            // Obtain reference to listbox model's item text array:
+            iItemTextArray = STATIC_CAST( CDesCArray*,
+                lbx->Model()->ItemTextArray() );
+            }
+            break;
+
+        default:
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::SelectedPlugin()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGSPluginInterface* CGSParentContainer::SelectedPlugin()
+    {
+    CGSPluginInterface* plugin = NULL;
+    const TInt index = iListBox->CurrentItemIndex();
+    if ( index >= 0 && index < iVisiblePlugins->Count() )
+        {
+        plugin = iVisiblePlugins->operator[]( index );
+        __GSLOGSTRING2( "[CGSParentContainer] SelectedPlugin 0x%X in index %d",
+            plugin->Id().iUid, index );
+        }
+    return plugin;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::SetSelectedItem()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSParentContainer::SetSelectedItem( TUid aSelectedItemUid )
+    {
+    __GSLOGSTRING1( "[CGSParentContainer] SetSelectedItem(0x%X)",
+        aSelectedItemUid.iUid );
+
+    if( aSelectedItemUid != KGSNoneSelected )
+        {
+        TInt selectedItemIndex  = 0;
+        for( TInt i = 0; i < iVisiblePlugins->Count(); i++ )
+            {
+            CGSPluginInterface* plugin = iVisiblePlugins->operator[]( i );
+            __GSLOGSTRING2( "[CGSParentContainer] Checking [%d] 0x%X)",
+                i, plugin->Id().iUid );
+            // If plugin is found, select it:
+            if( plugin->Id() == aSelectedItemUid )
+                {
+                __GSLOGSTRING2( "[CGSParentContainer] Match 0x%X in index %d",
+                    plugin->Id().iUid, i );
+                selectedItemIndex = i;
+                break;
+                }
+            }
+        iListBox->SetCurrentItemIndexAndDraw( selectedItemIndex );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSParentContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    // This is forwarded to the CGSParentPlugin type class that actually knows
+    // the help context but does not have its own CCoeControl class.
+    iParentPlugin->GetHelpContext( aContext );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::FocusChanged
+//
+// Set focus on the selected listbox. For animated skins feature.
+// ---------------------------------------------------------------------------
+EXPORT_C void CGSParentContainer::FocusChanged( TDrawNow /*aDrawNow*/ )
+    {
+    if( iListBox )
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentContainer::HandleSelectionKeyL
+//
+// Behaves like a selection key.
+// ---------------------------------------------------------------------------
+void CGSParentContainer::HandleSelectionKeyL()
+    {
+    HandleListBoxEventL( iListBox,EEventEnterKeyPressed );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::TopPlugin()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGSPluginInterface* CGSParentContainer::TopPlugin()
+    {
+    CGSPluginInterface* plugin = NULL;
+    const TInt index = iListBox->TopItemIndex();
+    if ( index >= 0 && index < iVisiblePlugins->Count() )
+        {
+        plugin = iVisiblePlugins->operator[]( index );
+        __GSLOGSTRING2( "[CGSParentContainer] TopPlugin 0x%X in index %d",
+            plugin->Id().iUid, index );
+        }
+    return plugin;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::SetSelectedItem()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSParentContainer::SetTopItem( TUid aTopItemUid )
+    {
+    __GSLOGSTRING1( "[CGSParentContainer] SetTopItem(0x%X)",
+        aTopItemUid.iUid );
+
+    if( aTopItemUid != KGSNoneSelected )
+        {
+        TInt topItemIndex  = 0;
+        for( TInt i = 0; i < iVisiblePlugins->Count(); i++ )
+            {
+            CGSPluginInterface* plugin = iVisiblePlugins->operator[]( i );
+            __GSLOGSTRING2( "[CGSParentContainer] Checking [%d] 0x%X)",
+                i, plugin->Id().iUid );
+            // If plugin is found, select it:
+            if( plugin->Id() == aTopItemUid )
+                {
+                __GSLOGSTRING2( "[CGSParentContainer] Match 0x%X in index %d",
+                    plugin->Id().iUid, i );
+                topItemIndex = i;
+                break;
+                }
+            }
+        iListBox->SetTopItemIndex( topItemIndex );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::SetListBoxEmptyTextL()
+//
+//Set the empty text of list box.
+// -----------------------------------------------------------------------------
+//
+void CGSParentContainer::SetListBoxEmptyTextL(const TDes& aEmpty )
+    {
+    if ( iListBox )
+        {
+        iListBox->View()->SetListEmptyTextL( aEmpty );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::GetPositionL()
+//
+//Get the exact position of listbox.
+// -----------------------------------------------------------------------------
+//
+void CGSParentContainer::GetPositionL(RArray<TInt>& posArray)
+	{
+	posArray.AppendL(iListBox->CurrentItemIndex());
+	posArray.AppendL(iListBox->View()->ItemOffsetInPixels());
+	posArray.AppendL(iListBox->View()->TopItemIndex());
+	return;
+	}
+
+// -----------------------------------------------------------------------------
+// CGSParentContainer::GetPositionL()
+//
+//Get the exact position of listbox.
+// -----------------------------------------------------------------------------
+//
+void CGSParentContainer::SetPosition(const RArray<TInt>& pos, TBool aChangeMode)
+	{
+	iListBox->SetCurrentItemIndex(pos.operator[](0));
+	iListBox->View()->SetItemOffsetInPixels(pos.operator[](1));
+	if (aChangeMode)
+		{
+		iListBox->View()->VerticalMoveToItemL(pos.operator[](0), CListBoxView::ESingleSelection);
+		}
+	else
+		{
+		iListBox->View()->SetTopItemIndex(pos.operator[](2));
+		}
+	}
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,727 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for plugins containing other plugins. Asynchronous
+*                 loading of plugins is used.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <gsparentplugin.h>
+#include    <gsparentcontainer.h>
+#include    <gsplugininterface.h>
+#include    "GsLogger.h"
+#include    <gscommon.hrh>
+#include    <GSParentPluginRsc.rsg>
+#include    <gsfwviewuids.h>
+#include    <avkon.rsg>
+
+#include    <aknlists.h>
+#include    <ConeResLoader.h>
+#include    <featmgr.h>
+#include    <akntitle.h>
+#include    <aknViewAppUi.h>
+#include    <bautils.h>
+#include    <eikmenup.h>
+#include    <eikbtgpc.h>
+#include    <hlplch.h>
+#include    <StringLoader.h>
+#include	<LayoutMetaData.cdl.h>
+// Middle Softkey control ID.
+const TInt KGSMSKControlID = 3;
+const TInt KGSMSKLength = 256;
+const TInt KGSPluginArrayInitSize = 10;
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::CGSParentPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSParentPlugin::CGSParentPlugin()
+    : iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::BaseConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::BaseConstructL(
+    TInt aViewRscId,
+    TInt aTitleRscId )
+    {
+    iTitleRscId = aTitleRscId;
+    iSelectedPluginUid = KGSNoneSelected;
+    iTopPluginUid = KGSNoneSelected;
+
+    __GSLOGSTRING( "[CGSParentPlugin] ConstructL()" );
+    iAppUi = AppUi();
+
+    OpenLocalizedResourceFileL( KGSParentPluginResourceFileName,
+                                iResourceLoader );
+    CAknView::BaseConstructL( aViewRscId );
+
+    if( !iOptionFlags[ EGSLoadChildrenOnActivation ] )
+        {
+        StartAsyncPluginLoadL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::StartAsyncPluginLoadL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSParentPlugin::StartAsyncPluginLoadL()
+    {
+    //Initialize array and start loading plugins into it.
+    iPluginArray = new (ELeave) CArrayPtrFlat<CGSPluginInterface>( KGSPluginArrayInitSize );
+    iPluginLoader = CGSPluginLoader::NewL( iAppUi );
+    iPluginLoader->SetObserver( this );
+    iPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, Id(), iPluginArray );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUid CGSParentPlugin::UpperLevelViewUid()
+    {
+    __GSLOGSTRING( "[CGSParentPlugin] UpperLevelViewUid()" );
+    return iPrevViewId.iViewUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::~CGSParentPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSParentPlugin::~CGSParentPlugin()
+    {
+    __GSLOGSTRING( "[CGSParentPlugin] ~CGSParentPlugin" );
+    if  ( iPluginLoader )
+        {
+        iPluginLoader->AbortAsyncLoad();
+        }
+    delete iPluginLoader;
+
+    if  ( iPluginArray )
+        {
+        iPluginArray->Reset();//Do not destroy - Plugins are owned by iAppUi
+        }
+    delete iPluginArray;
+    iResourceLoader.Close();
+
+    if( iContainer )
+        {
+        iAppUi->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::OpenLocalizedResourceFileL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    aResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                            TUid /*aCustomMessageId*/,
+                                            const TDesC8& /*aCustomMessage*/ )
+    {
+    __GSLOGSTRING( "[CGSParentPlugin::DoActivateL]" );
+    iPrevViewId = aPrevViewId;
+    
+    // If iPluginArray does not exist. Lazy loading is enabled and should start 
+    // loading now.
+    if( !iPluginArray )
+        {
+        StartAsyncPluginLoadL();
+        }
+    
+    // Set priority only after plugin loader is created in 
+    // StartAsyncPluginLoadL. 
+    iPluginLoader->RequestPriority( CActive::EPriorityHigh );
+    
+    //if( iContainer )
+    //    {
+    //    iAppUi->RemoveFromViewStack( *this, iContainer );
+    //    delete iContainer;
+    //    iContainer=NULL;
+    //    }
+    
+    if ( !iContainer )
+        {
+        ConstructContainerL();
+    
+        // Set the empty text of list box.
+        _LIT( KEmptyText, "" );
+        TBuf<1> empty( KEmptyText );
+        iContainer->SetListBoxEmptyTextL( empty );
+    
+        // Update listbox from already existing iPluginArray:
+        iContainer->UpdateListBoxL();
+		if (position.Count() > 0)
+			{
+			if (iScreenMode == Layout_Meta_Data::IsLandscapeOrientation())
+				{
+				iContainer->SetPosition(position, EFalse);
+				}
+			else
+				{
+				iContainer->SetPosition(position, ETrue);
+				}
+			}
+		iAppUi->AddToViewStackL(*this, iContainer);
+    // Navigating to parent view will reset all child plugin selected indexes:
+    for( TInt i = 0; i < iPluginArray->Count(); i++ )
+        {
+        CGSPluginInterface* plugin = iPluginArray->operator[]( i );
+        plugin->ResetSelectedItemIndex();
+        }
+
+    iMskCommandId = EAknSoftkeyOpen;
+
+    SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen );
+    CheckMiddleSoftkeyLabelL();
+
+		// If this view was launched from external source, use "exit" as RSK
+		if (iPrevViewId.iAppUid != KUidGS)
+			{
+			CEikButtonGroupContainer* cbaGroup = Cba();
+			if (cbaGroup)
+				{
+				HBufC* rightSKText = StringLoader::LoadLC(
+						R_GS_PARENTPLUGIN_CBA_EXIT);
+				TPtr rskPtr = rightSKText->Des();
+				cbaGroup->SetCommandL(2, EAknSoftkeyExit, *rightSKText);
+				CleanupStack::PopAndDestroy(rightSKText);
+				}
+			}
+
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+EXPORT_C void CGSParentPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSParentPlugin::DoDeactivate]" );
+    
+    iPluginLoader->RequestPriority( CActive::EPriorityLow );
+    
+    if ( iContainer )
+        {
+		if (position.Count() > 0)
+			{
+			position.Reset();
+			}
+		TRAPD(err, iContainer->GetPositionL(position));
+		iScreenMode = Layout_Meta_Data::IsLandscapeOrientation();
+
+		iAppUi->RemoveFromViewStack(*this, iContainer);
+        delete iContainer;
+        iContainer = NULL;
+        }
+    __GSLOGSTRING( "[CGSParentPlugin::DoDeactivate] Done" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::ConstructContainerL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSParentPlugin::ConstructContainerL()
+    {
+    iContainer = new( ELeave ) CGSParentContainer;
+    iContainer->SetMopParent( this );
+
+    TRAPD
+        (
+        error,
+        iContainer->ConstructL(
+            ClientRect() ,
+            AppUi(),
+            iPluginArray,
+            iTitleRscId,
+            this,
+            ListBoxType() )
+        );
+
+    if ( error )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        User::Leave( error );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::HandleCommandL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::HandleCommandL( TInt aCommand )
+    {
+    __GSLOGSTRING1( "[CGSParentPlugin] HandleCommandL(%d)", aCommand );
+
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            __GSLOGSTRING1( "[CGSParentPlugin] Returning to view 0x%X",
+                            UpperLevelViewUid().iUid );
+            iAppUi->ActivateLocalViewL( UpperLevelViewUid() );
+            break;
+        // These all should be handled similarily:
+        case EAknSoftkeyOpen:
+        case EGSCmdAppChange:
+        case EGSCmdAppOpen:
+            if( iContainer && iPluginArray->Count() > 0 )
+                {
+                CGSPluginInterface* selectedPlugin =
+                    iContainer->SelectedPlugin();
+
+                if ( NULL != selectedPlugin )
+                    {
+                    switch( selectedPlugin->ItemType() )
+                        {
+                        // In these cases the plugin is a view:
+                        case EGSItemTypeSingleLarge:
+                        case EGSItemTypeSetting:
+                        case EGSItemTypeSettingIcon:
+                            iAppUi->ActivateLocalViewL( selectedPlugin->Id() );
+                            break;
+                        // In these cases the plugin is a dialog:
+                        case EGSItemTypeSettingDialog:
+                        case EGSItemTypeSingleLargeDialog:
+                             selectedPlugin->HandleSelection(
+                                EGSSelectionByMenu );
+                             break;
+                        }                    
+                    }
+
+                }
+            break;
+        case EGSMSKCmdAppChange:
+            iContainer->HandleSelectionKeyL();
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::HandlePluginLoaded()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::HandlePluginLoaded( KGSPluginLoaderStatus aStatus )
+    {
+    __GSLOGSTRING1( "[CGSParentPlugin::HandlePluginLoaded] aStatus:%d", aStatus );
+    
+    switch( aStatus )
+        {
+        case MGSPluginLoadObserver::EGSSuccess:
+            // Should not update each time when plugin is loaded, only when 
+            // finished loading spesific view plugins?
+            break;
+        case MGSPluginLoadObserver::EGSFinished:
+            if( iContainer )
+                {
+                TRAPD( ignore, iContainer->UpdateListBoxL(); );
+                if( ignore != KErrNone )
+                  {
+                  __GSLOGSTRING1( 
+                      "[CGSParentPlugin] HandlePluginLoaded error:%d",
+                      ignore );
+                  }
+                }
+            break;
+        default:
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::TransferDynamicPluginL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::TransferDynamicPluginL( CGSPluginInterface* aPlugin )
+    {
+    __GSLOGSTRING1( "[CGSParentPlugin] CGSParentPlugin::TransferDynamicPluginL() - plugin id: 0x%x added to appUi.", aPlugin->Id() );
+
+    CleanupStack::PushL( aPlugin );
+    iAppUi->AddViewL( aPlugin );
+    CleanupStack::Pop( aPlugin );
+
+    // Add to the overall plugin array for this parent plugin
+    iPluginArray->AppendL( aPlugin );
+
+    // Resort the plugins so that they are in order
+    iPluginLoader->SortPluginsL( iPluginArray );
+
+    // Update the listbox with the new information
+    HandlePluginLoaded( MGSPluginLoadObserver::EGSSuccess );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::ListBoxType()
+// Default implementation. Overwrite if different type of listbox is needed.
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TGSListboxTypes CGSParentPlugin::ListBoxType()
+    {
+    return EGSListBoxTypeSingleLarge;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::UpdateView()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::UpdateView()
+    {
+    __GSLOGSTRING( "[CGSParentPlugin::UpdateView]" );
+    TRAP_IGNORE
+        (
+        if( iContainer )
+            {
+            iContainer->UpdateListBoxL();
+            }
+        );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentPlugin::ResetSelectedItemIndex()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::ResetSelectedItemIndex()
+    {
+    iSelectedPluginUid = KGSNoneSelected;
+    if( iContainer )
+        {
+        iContainer->ListBox()->SetCurrentItemIndex( 0 );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentPlugin::SetOptionFlags()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::SetOptionFlags( TBitFlags& aOptionFlags )
+    {
+    iOptionFlags = aOptionFlags;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentPlugin::OptionFlags()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TBitFlags& CGSParentPlugin::OptionFlags() const
+    {
+    return iOptionFlags;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentPlugin::DynInitMenuPaneL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::DynInitMenuPaneL( TInt /*aResourceId*/,
+                                                 CEikMenuPane* aMenuPane )
+    {
+    // Check what is the plugin's desired menu item type for activating the
+    // plugin. If it doesn't match to the item defined by parent plugin menu
+    // resource, change the item dynamically.
+    if ( iContainer->SelectedPlugin() )
+        {
+        CGSPluginInterface* selectedPlugin = iContainer->SelectedPlugin();
+        TGSMenuActivationItems desiredItemType = selectedPlugin->MenuActivationItem();
+
+        // Append new item after this position, delete item in this position.
+        TInt removableItemPos;
+
+        // MSK command should be identical to the desired activation command in
+        // options menu. Posibilities are such as 'open' (also as default),
+        // 'change' or custom text.
+        // Note: Activation item in options menu is depending on the highlighted
+        // child plugin's MenuActivationItem() function.
+        switch( desiredItemType )
+            {
+            case EGSMenuActivationItemDefault:
+            case EGSMenuActivationItemOpen:
+                if( aMenuPane->MenuItemExists( EGSCmdAppChange, removableItemPos ) )
+                    {
+                    aMenuPane->AddMenuItemsL( R_GS_MENU_ITEM_OPEN, removableItemPos );
+                    aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos );
+                    }
+                break;
+
+            case EGSMenuActivationItemChange:
+                if( aMenuPane->MenuItemExists( EAknSoftkeyOpen, removableItemPos ) )
+                    {
+                    aMenuPane->AddMenuItemsL( R_GS_MENU_ITEM_CHANGE, removableItemPos );
+                    aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos );
+                    }
+                break;
+
+            case EGSMenuActivationItemCustom:
+                {
+                // Using EGSCmdAppChange as EGSMenuActivationItemCustom
+                // functionality is same as for EGSMenuActivationItemChange.
+                // Here we're replacing EGSCmdAppChange always because we
+                // cannot be sure whether it's the actual custom command
+                // already or just EAknSoftkeyOpen. Custom commands will be set
+                // to use the same command ID (EGSCmdAppChange).
+                //
+                CEikMenuPaneItem::SData menuItem;
+                selectedPlugin->GetValue( EGSCustomMenuActivationText, menuItem.iText );
+                menuItem.iCommandId = EGSCmdAppChange;
+                menuItem.iCascadeId = 0;
+                menuItem.iFlags = 0;
+                
+                if( aMenuPane->MenuItemExists( EGSCmdAppChange, removableItemPos ) )
+                    {
+                    // Add custom item before 'change' and then remove 'change'
+                    if( menuItem.iText.Length() > 0)
+                        {
+                        aMenuPane->AddMenuItemL( menuItem, EGSCmdAppChange );
+                        }
+                    aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos );
+                    }
+                else if( aMenuPane->MenuItemExists( EAknSoftkeyOpen, removableItemPos ) )
+                    {
+                    // Add custom item before 'open' and then remove 'open'
+                    if( menuItem.iText.Length() > 0 )
+                        {
+                        aMenuPane->AddMenuItemL( menuItem, EAknSoftkeyOpen );
+                        }
+                    aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos );
+                    }
+                break;
+                }
+            default:
+                break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSParentPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSParentPlugin::GetHelpContext( TCoeHelpContext& /*aContext*/ )
+    {
+    // Default implementation does nothing.
+    }
+
+// -----------------------------------------------------------------------------
+// When this method is called, view checks based on highlight focus, if the MSK
+// label is correct.
+// -----------------------------------------------------------------------------
+//
+void CGSParentPlugin::CheckMiddleSoftkeyLabelL()
+    {
+    if ( iContainer->SelectedPlugin() )
+        {
+        // Remove current MSK
+        RemoveCommandFromMSK( iMskCommandId );
+
+        CGSPluginInterface* selectedPlugin = iContainer->SelectedPlugin();
+        TGSMenuActivationItems desiredItemType =
+            selectedPlugin->MenuActivationItem();
+
+        switch( desiredItemType )
+            {
+            case EGSMenuActivationItemChange:
+                SetMiddleSoftKeyLabelL( R_QTN_MSK_CHANGE, EGSMSKCmdAppChange );
+                iMskCommandId = EGSMSKCmdAppChange;
+                break;
+            case EGSMenuActivationItemOpen:
+            case EGSMenuActivationItemDefault:
+                SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen );
+                iMskCommandId = EAknSoftkeyOpen;
+                break;
+            case EGSMenuActivationItemCustom:
+                {
+                HBufC* mskText = HBufC::NewLC( KGSMSKLength );
+                TPtr mskPtr = mskText->Des();
+                selectedPlugin->GetValue( EGSCustomMenuActivationText, mskPtr );
+                SetMiddleSoftKeyLabelTextL( mskPtr, EGSMSKCmdAppChange );
+                CleanupStack::PopAndDestroy( mskText );
+                break;
+                }
+            default:
+                // Use 'open' as default
+                SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen );
+                iMskCommandId = EAknSoftkeyOpen;
+                break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Remove unnecessary commands from Middle softkey.
+// -----------------------------------------------------------------------------
+//
+void CGSParentPlugin::RemoveCommandFromMSK( TInt aMskCommandId )
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        cbaGroup->RemoveCommandFromStack( KGSMSKControlID, aMskCommandId );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets middle softkey label.
+// ---------------------------------------------------------------------------
+//
+void CGSParentPlugin::SetMiddleSoftKeyLabelL(
+    const TInt aResourceId, const TInt aCommandId )
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        HBufC* middleSKText = StringLoader::LoadLC( aResourceId );
+        TPtr mskPtr = middleSKText->Des();
+        cbaGroup->AddCommandToStackL(
+            KGSMSKControlID,
+            aCommandId,
+            mskPtr );
+        CleanupStack::PopAndDestroy( middleSKText );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets middle softkey label.
+// ---------------------------------------------------------------------------
+//
+void CGSParentPlugin::SetMiddleSoftKeyLabelTextL(
+    const TPtr aMskLabel, const TInt aCommandId )
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        cbaGroup->AddCommandToStackL(
+            KGSMSKControlID,
+            aCommandId,
+            aMskLabel );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns selected plugin.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSPluginInterface* CGSParentPlugin::SelectedPlugin()
+    {
+    CGSPluginInterface* selectedPlugin = NULL;
+    if( iContainer )
+        {
+        selectedPlugin = iContainer->SelectedPlugin();
+        }
+    return selectedPlugin;
+    }
+
+
+void CGSParentPlugin::RequestPriority( CActive::TPriority aPriority )
+    {
+    iPluginLoader->RequestPriority( aPriority );
+    __GSLOGSTRING2( "[CGSParentPlugin::RequestPriority] 0x%X aPriority:%d",  Id().iUid, aPriority ); 
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSPlaceholderView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        GS plugin wrapper.
+*
+*/
+
+#include "GSPlaceholderView.h"
+
+// System includes
+#include <coeaui.h>
+
+// User includes
+#include <gsfwviewuids.h>
+
+// Constants
+const TUid KGSInternalPlaceholderViewUid = { 0x0DEADBED };
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::CGSPlaceholderView
+//
+// 
+// ----------------------------------------------------------------------------
+//
+CGSPlaceholderView::CGSPlaceholderView( CCoeAppUi& aAppUi )
+:   iAppUi( aAppUi )
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::~CGSPlaceholderView
+//
+// 
+// ----------------------------------------------------------------------------
+//
+CGSPlaceholderView::~CGSPlaceholderView()
+    {
+    iAppUi.DeregisterView( *this );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::ConstructL
+//
+// 
+// ----------------------------------------------------------------------------
+//
+void CGSPlaceholderView::ConstructL()
+    {
+    iAppUi.RegisterViewL( *this );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::NewL
+//
+// 
+// ----------------------------------------------------------------------------
+//
+CGSPlaceholderView* CGSPlaceholderView::NewL( CCoeAppUi& aAppUi )
+    {
+    CGSPlaceholderView* self = new(ELeave) CGSPlaceholderView( aAppUi );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::ActivateL
+//
+// 
+// ----------------------------------------------------------------------------
+//
+void CGSPlaceholderView::ActivateL()
+    {
+    iAppUi.ActivateViewL( ViewId() );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::PreviouslyActiveViewId
+//
+// 
+// ----------------------------------------------------------------------------
+//
+const TVwsViewId& CGSPlaceholderView::PreviouslyActiveViewId() const
+    {
+    return iPreviouslyActiveViewId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPlaceholderView::SetPreviouslyActiveViewId
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPlaceholderView::SetPreviouslyActiveViewId( const TVwsViewId& aViewId )
+    {
+    iPreviouslyActiveViewId = aViewId;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::ViewId
+//
+// 
+// ----------------------------------------------------------------------------
+//
+TVwsViewId CGSPlaceholderView::ViewId() const
+    {
+    const TVwsViewId ret( KUidGS, KGSInternalPlaceholderViewUid );
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::ViewActivatedL
+//
+// 
+// ----------------------------------------------------------------------------
+//
+void CGSPlaceholderView::ViewActivatedL( const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/ )
+    {
+    // NB: aPrevViewId will be the id of the plugin we are trying to load...
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPlaceholderView::ViewDeactivated
+//
+// 
+// ----------------------------------------------------------------------------
+//
+void CGSPlaceholderView::ViewDeactivated()
+    {
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSPluginAndViewIdCache.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,552 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*           Plugin and view id caching support
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSPluginAndViewIdCache.h"
+
+// System includes
+#include <bautils.h>
+#include <s32file.h>
+#include <eikappui.h>
+
+// User includes
+#include "GSShimmedView.h"
+#include "GSPlaceholderView.h"
+
+// Constants
+_LIT( KGSCacheFileName, "PluginUidToViewIdCache.dat" );
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::CGSPluginAndViewIdCache
+// C++ constructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSPluginAndViewIdCache::CGSPluginAndViewIdCache( CEikAppUi& aAppUi )
+:   iAppUi( aAppUi ), iLookupTable( &HashFunction, &HashIdentityRelation )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::~CGSPluginAndViewIdCache
+// C++ destructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSPluginAndViewIdCache::~CGSPluginAndViewIdCache()
+    {
+    TRAP_IGNORE( StoreL() );
+    //
+    delete iPlaceholderView;
+    DestroyShims();
+    iLookupTable.Close();
+    //
+    iFsSession.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::ConstructL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::ConstructL()
+    {
+    User::LeaveIfError( iFsSession.Connect() );
+    User::LeaveIfError( iFsSession.CreatePrivatePath( EDriveC ) );
+    //
+    iPlaceholderView = CGSPlaceholderView::NewL( iAppUi );
+    //
+    TRAP_IGNORE( RestoreL() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::NewL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+CGSPluginAndViewIdCache* CGSPluginAndViewIdCache::NewL( CEikAppUi& aAppUi )
+    {
+    CGSPluginAndViewIdCache* self = new(ELeave) CGSPluginAndViewIdCache( aAppUi );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::ActivatePlaceholderViewL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::ActivatePlaceholderViewL()
+    {
+    iPlaceholderView->ActivateL();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::PriorToPlaceholderActiveViewId
+//
+// 
+// ----------------------------------------------------------------------------
+//
+const TVwsViewId& CGSPluginAndViewIdCache::PriorToPlaceholderActiveViewId() const
+    {
+    return iPlaceholderView->PreviouslyActiveViewId();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::SetPriorToPlaceholderActiveViewId
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::SetPriorToPlaceholderActiveViewId( const TVwsViewId& aViewId )
+    {
+    iPlaceholderView->SetPreviouslyActiveViewId( aViewId );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid )
+    {
+    RegisterViewAndImplementationAssociationL( aViewId, aImplementationUid, EFalse );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::PrepareToRegisterPluginInstanceLC
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::PrepareToRegisterPluginInstanceLC( TUid aViewId )
+    {
+    TCacheEntry* value = iLookupTable.Find( aViewId );
+    if  ( value && value->iShim )
+        {
+        // Store cleanup view uid so that we know which shim to re-register
+        // if the cleanup item is invoked.
+        iTransientCleanupViewUid = aViewId;
+
+        // Prepare item
+        TCleanupItem item( ReRegisterShimWithUi, this );
+        CleanupStack::PushL( item );
+
+        // Unregister shim view
+        value->iShim->DeregisterView();
+
+        // If a leave now occurs, the cleanup stack will unwind and will
+        // invoke our cleanup item. This item will then re-add
+        // the specified shim to the view framework. See ReRegisterShimWithUiL
+        // for further details.
+        }
+    else
+        {
+        // Record not found - just push NULL to ensure cleanup stack
+        // remains balanced.
+        CleanupStack::PushL( (CBase*) NULL );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::RegisterPluginInstanceL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::RegisterPluginInstanceL( TUid aViewId, CGSPluginInterface& aPluginInstance )
+    {
+    TCacheEntry* value = iLookupTable.Find( aViewId );
+    ASSERT( value != NULL );
+    
+    // Can now associate the plugin instance with the cache entry.
+    value->iLoadedPluginImplementation = &aPluginInstance;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::PluginImplementationUidForView
+// 
+//
+// ---------------------------------------------------------------------------
+//
+TBool CGSPluginAndViewIdCache::IsPluginLoaded( TUid aViewId ) const
+    {
+    CGSPluginInterface* instance = PluginInstance( aViewId );
+
+    TBool loaded = EFalse;
+    if ( instance )
+        {
+        loaded = ETrue;
+        }
+    
+    return loaded;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::PluginInstance
+// 
+//
+// ---------------------------------------------------------------------------
+//
+CGSPluginInterface* CGSPluginAndViewIdCache::PluginInstance( TUid aViewId ) const
+    {
+    CGSPluginInterface* ret = NULL;
+    //
+    const TCacheEntry* value = iLookupTable.Find( aViewId );
+    if  ( value )
+        {
+        ret = value->iLoadedPluginImplementation;
+        }
+    //
+    return ret;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::PluginImplementationUidForView
+// 
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSPluginAndViewIdCache::PluginImplementationUidForView( TUid aViewId ) const
+    {
+    TUid pluginUid = KNullUid;
+    //
+    const TCacheEntry* value = iLookupTable.Find( aViewId );
+    if  ( value )
+        {
+        pluginUid = value->iImplementationUid;
+        }
+    //
+    return pluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::DestroyShims
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::DestroyShims()
+    {
+	RHashMap< TUid, TCacheEntry >::TIter iterator( iLookupTable );
+    FOREVER
+		{
+		const TUid* key = iterator.NextKey();
+		if  ( key )
+            {
+            TCacheEntry* value = iterator.CurrentValue();
+
+            // Destroy shim instance
+            delete value->iShim;
+            value->iShim = NULL;
+            }
+        else
+            {
+			break;
+            }
+		}
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::RestoreL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::RestoreL()
+    {
+    TFileName* cacheFile = new(ELeave) TFileName();
+    CleanupStack::PushL( cacheFile );
+    GetCacheFileNameL( *cacheFile );
+    //
+    if  ( BaflUtils::FileExists( iFsSession, *cacheFile ) )
+        {
+        RFileReadStream cacheStream;
+        TInt error = cacheStream.Open( iFsSession, *cacheFile, EFileRead );
+        User::LeaveIfError( error );
+        CleanupClosePushL( cacheStream );
+
+        // Now read in cache hash table
+        TUid key = KNullUid;
+        TUid value = KNullUid;
+        
+        const TInt entryCount = cacheStream.ReadInt32L();
+        for( TInt i=0; i<entryCount; i++ )
+            {
+            key.iUid = cacheStream.ReadUint32L();
+            value.iUid = cacheStream.ReadUint32L();
+            //
+            RegisterViewAndImplementationAssociationL( key, value, ETrue );
+            }
+
+        CleanupStack::PopAndDestroy( &cacheStream );
+        }
+    //
+    CleanupStack::PopAndDestroy( cacheFile );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::StoreL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::StoreL()
+    {
+    TFileName* intermediateFileName = new(ELeave) TFileName();
+    CleanupStack::PushL( intermediateFileName );
+
+    TFileName* cachePath = new(ELeave) TFileName();
+    CleanupStack::PushL( cachePath );
+    GetCachePathL( *cachePath );
+    
+    // Create a temporary file in the GS private data cage to contain
+    // the cache data. We'll rename this to the real cache file name
+    // once the operation has been completed successfully.
+    RFile intermediateCacheFile;
+    TInt error = intermediateCacheFile.Temp( iFsSession, *cachePath, *intermediateFileName, EFileWrite );
+    User::LeaveIfError( error );
+  
+    // Create a stream from the file. Stream takes ownership of file
+    RFileWriteStream stream( intermediateCacheFile );
+    CleanupClosePushL( stream );
+
+    // Write each entry to the stream
+    stream.WriteUint32L( iLookupTable.Count() );
+
+	RHashMap< TUid, TCacheEntry >::TIter iterator( iLookupTable );
+    FOREVER
+		{
+		const TUid* key = iterator.NextKey();
+		if  ( key )
+            {
+            const TCacheEntry* value = iterator.CurrentValue();
+            stream.WriteUint32L( key->iUid );
+            stream.WriteUint32L( value->iImplementationUid.iUid );
+            }
+        else
+            {
+			break;
+            }
+		}
+	
+    // Finalise the stream
+    stream.CommitL();
+    stream.Close(); // Also closes the file
+    CleanupStack::PopAndDestroy( &stream ); 
+
+    // If we got this far it means we created the cache file successfully.
+    // Now its okay to replace any pre-existing cache file with the
+    // file we just created. We're re-use the cachePath variable for the
+    // ultimate filename since it saves allocating another 1/2kb on the heap.
+    GetCacheFileNameL( *cachePath );
+    if  ( BaflUtils::FileExists( iFsSession, *cachePath ) )
+        {
+        error = iFsSession.Delete( *cachePath );
+        User::LeaveIfError( error );
+        }
+
+    // Now rename intermediate file name to ultimate cache file name.
+    error = iFsSession.Rename( *intermediateFileName, *cachePath );
+    User::LeaveIfError( error );
+
+    CleanupStack::PopAndDestroy( 2, intermediateFileName );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::GetCacheFileNameL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::GetCacheFileNameL( TDes& aFileName )
+    {
+    GetCachePathL( aFileName );
+    aFileName.Append( KGSCacheFileName );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::GetCachePathL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::GetCachePathL( TDes& aPath )
+    {
+    aPath.Zero();
+
+    // Get private data cage path
+    TInt err = iFsSession.PrivatePath( aPath );
+    User::LeaveIfError( err );
+
+    // Combine with C: drive
+    const TDriveUnit cDrive( EDriveC );
+    const TDriveName cDriveName( cDrive.Name() );
+    aPath.Insert( 0, cDriveName );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid, TBool aCreateShim )
+    {
+    // Check if aViewId is a key within the look up table, so as to avoid
+    // adding duplicate entries...
+    const TCacheEntry* value = iLookupTable.Find( aViewId );
+    if  ( !value )
+        {
+        // No registration for this view yet, so create a new entry
+        TCacheEntry cacheEntry;
+        cacheEntry.iImplementationUid = aImplementationUid;
+        cacheEntry.iLoadedPluginImplementation = NULL;
+
+        if  ( aCreateShim )
+            {
+            // Create a new shim
+            cacheEntry.iShim = CGSShimmedView::NewLC( aViewId, *this, iAppUi );
+            }
+        else
+            {
+            cacheEntry.iShim = NULL;
+            }
+
+        // Add entry to table - the shim ownership is also transferred 
+        // at this point, since the destructor of this class will
+        // destroy all shims.
+        iLookupTable.InsertL( aViewId, cacheEntry );
+        
+        if  ( aCreateShim )
+            {
+            CleanupStack::Pop( cacheEntry.iShim );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::PrepareForUIDestruction
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::PrepareForUIDestruction()
+    {
+    // Have to remove all UI furniture before the AppUi rug is pulled out
+    // from underneath us...
+    DestroyShims();
+    //
+    delete iPlaceholderView;
+    iPlaceholderView = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::HandleShimDestruction
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::HandleShimDestruction( TUid aViewId )
+    {
+    TCacheEntry* value = iLookupTable.Find( aViewId );
+    if  ( value && value->iShim )
+        {
+        // The shim has been destroyed.
+        value->iShim = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::ReRegisterShimWithUi
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPluginAndViewIdCache::ReRegisterShimWithUi( TAny* aSelf )
+    {
+    CGSPluginAndViewIdCache* self = reinterpret_cast< CGSPluginAndViewIdCache* >( aSelf );
+    //
+    if  ( self->iTransientCleanupViewUid != KNullUid )
+        {
+        TCacheEntry* value = self->iLookupTable.Find( self->iTransientCleanupViewUid );
+        if  ( value && value->iShim )
+            {
+            TRAP_IGNORE( value->iShim->RegisterViewL() );
+            }
+        }
+    //
+    self->iTransientCleanupViewUid = KNullUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::HashFunction
+// 
+//
+// ---------------------------------------------------------------------------
+//
+TUint32 CGSPluginAndViewIdCache::HashFunction( const TUid& aViewId )
+    {
+    const TUint32 hash = DefaultHash::Integer( aViewId.iUid );
+    return hash;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPluginAndViewIdCache::HashIdentityRelation
+// 
+//
+// ---------------------------------------------------------------------------
+//
+TBool CGSPluginAndViewIdCache::HashIdentityRelation( const TUid& aLeft, const TUid& aRight )
+    {
+    const TBool equal = ( aLeft.iUid == aRight.iUid );
+    return equal;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSPluginInterface.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CGSPluginInteface implementation.
+*
+*/
+
+#include <gsplugininterface.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::CGSPluginInterface()
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CGSPluginInterface::CGSPluginInterface()
+    : iOrder( KGSPluginNotIndexed )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::~CGSPluginInterface()
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CGSPluginInterface::~CGSPluginInterface()
+    {
+    // We don't unload the plugin object here. The loader
+    // has to do this for us. Without this kind of destruction idiom,
+    // the view framework can potentially unload an ECOM plugin dll whilst
+    // there are still child views (Created by the plugin) that are registered
+    // with the view framework. If this occurs, the plugin code segment isn't
+    // loaded anymore and so there is no way to run the subsequent destructor
+    // code => exception.
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::NewL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CGSPluginInterface* CGSPluginInterface::NewL( TUid aImplementationUid,
+                                                       TAny* aInitParams )
+    {
+    TAny* ptr;
+    TInt32 keyOffset = _FOFF( CGSPluginInterface, iDtor_ID_Key );
+    ptr = REComSession::CreateImplementationL( aImplementationUid,
+                                               keyOffset,
+                                               aInitParams );
+
+    CGSPluginInterface* plugin = REINTERPRET_CAST( CGSPluginInterface*, ptr );
+
+    return plugin;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::PluginProviderCategory()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CGSPluginInterface::PluginProviderCategory() const
+    {
+    return EGSPluginProvider3rdParty;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::CustomOperationL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TAny* CGSPluginInterface::CustomOperationL(
+    TAny* /*aParam1*/,
+    TAny* /*aParam2*/ )
+    {
+    return NULL;
+    };
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::Visible()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CGSPluginInterface::Visible() const
+    {
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CGulIcon* CGSPluginInterface::CreateIconL(
+    const TUid aIconType )
+    {
+    TParse parse;
+    parse.Set( KGSDefaultIconFileName, &KDC_BITMAP_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+    CGulIcon* icon = NULL;
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+            AknsUtils::SkinInstance(),
+            KAknsIIDQgnPropSetDeviceSub,
+            fileName,
+            EMbmGsfwiconQgn_prop_set_default_sub,
+            EMbmGsfwiconQgn_prop_set_default_sub_mask );
+        }
+    else if( aIconType == KGSIconTypeTab )
+        {
+        }
+    else if( aIconType == KGSIconTypeDColumn )
+        {
+        }
+    else // Unknown type
+        {
+        }
+    return icon;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::GetValue()
+//
+// Empty implementation just to minimize plugin implementor work.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginInterface::GetValue( const TGSPluginValueKeys aKey,
+                                            TDes& aValue )
+    {
+    switch( aKey )
+        {
+        case EGSPluginKeySettingsItemValueString:
+
+            _LIT( KStr, "" );
+            aValue.Append( KStr );
+            break;
+
+        default:
+            _LIT( KEmptyStr, "" );
+            aValue.Append( KEmptyStr );
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::HandleSelection()
+//
+// Default implementation just to minimize plugin implementor work.
+// On default activate plugin.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginInterface::HandleSelection(
+    const TGSSelectionTypes /*aSelectionType*/ )
+    {
+    // There is nothing pluginInterface can do if activating view fails.
+    TRAP_IGNORE( AppUi()->ActivateLocalViewL( Id() ) );
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::ItemType()
+//
+// Default implementation just to minimize plugin implementor work.
+// Default value EGSItemTypeSingleLarge
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TGSListboxItemTypes CGSPluginInterface::ItemType()
+    {
+    return EGSItemTypeSingleLarge;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::ResetSelectedItemIndex()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginInterface::ResetSelectedItemIndex()
+    {
+    // Default implementation does nothing.
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::TGSMenuActivationItems()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TGSMenuActivationItems CGSPluginInterface::MenuActivationItem()
+    {
+    // This default item will be the one read from the resource file.
+    return EGSMenuActivationItemDefault;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::SetOrder()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginInterface::SetOrder( TInt aOrder )
+    {
+    iOrder = aOrder;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPluginInterface::GetEcomDestructorKey()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TUid CGSPluginInterface::GetEcomDestructorKey()
+    {
+    return iDtor_ID_Key;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSPluginLoader.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,983 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GS plugin loader.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <gspluginloader.h>
+#include    <gsplugininterface.h>
+#include    <gsprivatepluginproviderids.h>
+#include    "GsLogger.h"
+#include    "GSBaseDocument.h"
+#include    "GSPluginWrapper.h"
+#include    "GSPluginAndViewIdCache.h"
+#include    <mgswatchdog.h>
+
+#include    <aknViewAppUi.h>
+#include    <AknIconArray.h>
+#include    <aknlists.h> // CAknSingleLargeStyleListbox
+#include    <eikclbd.h> // CColumnListBoxData
+#include    <gulicon.h> // For CGulIcon
+#include    <utf.h> // CnvUtfConverter
+#include  	<basched.h>
+#include    <AknInfoPopupNoteController.h>
+
+//Flag for enabling/disablign compare by category feature
+#undef RD_GS_COMPARE_BY_CATEGORY
+
+// ================= MEMBER FUNCTIONS =======================
+
+#ifdef _DEBUG
+    #pragma message("-----_DEBUG ACTIVATED IN GS!-----")
+#endif //_GEBUG
+
+#ifdef _GS_PERFORMANCE_TRACES
+    #pragma message("-GS plugin load performance measurements activated-")
+#endif // _GS_PERFORMANCE_TRACES
+
+const TInt KGSCaptionSize = 256;
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::NewL
+//
+// EPOC two-phased constructor
+// ----------------------------------------------------------------------------
+//
+EXPORT_C CGSPluginLoader* CGSPluginLoader::NewL( CAknViewAppUi* aAppUi )
+    {
+    CGSPluginLoader* self = new( ELeave ) CGSPluginLoader;
+    CleanupStack::PushL( self );
+    self->ConstructL( aAppUi );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::CGSPluginLoader
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+//  Uses low priority for Active Object so that more bandwith is available for 
+//  the most important pluginloaders. 
+// ----------------------------------------------------------------------------
+//
+CGSPluginLoader::CGSPluginLoader() 
+    : CActive( EPriorityLow ),
+      iRequestedPriority( EPriorityLow )
+    {
+    __GSLOGSTRING( "[GSPlgLoader] CGSPluginLoader()" );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::ConstructL
+//
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginLoader::ConstructL( CAknViewAppUi* aAppUi )
+    {
+    __GSLOGSTRING( "[GSPlgLoader] ConstructL()" );
+    iAppUi = aAppUi;
+    iDocument = static_cast<CGSBaseDocument*>( iAppUi->Document() );
+    iImplInfoArray = iDocument->GetImplInfo();
+
+    CActiveScheduler* scheluder = CActiveScheduler::Current();
+    __GSLOGSTRING1( "[GSPlgLoader] Current CActiveScheduler:0x%X", scheluder );
+    __GSLOGSTRING1( "[GSPlgLoader] CActiveScheduler stackdepth: %d",
+        scheluder->StackDepth() );
+
+    CActiveScheduler::Add( this );
+
+    iWatchDog = iDocument->WatchDog();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::~CGSPluginLoader
+//
+// Destructor
+// ----------------------------------------------------------------------------
+//
+EXPORT_C CGSPluginLoader::~CGSPluginLoader()
+    {
+    __GSLOGSTRING( "[GSPlgLoader] ~CGSPluginLoader()" );
+    AbortAsyncLoad();
+    Cancel();
+
+    if( iErrorPopup )
+        {
+        iErrorPopup->HideInfoPopupNote();
+        delete iErrorPopup;
+        iErrorPopup = NULL;
+        }
+    //iPluginArray is not owned and therefore not deleted.
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::LoadAsync
+//
+//
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginLoader::LoadAsyncL(
+    TUid aInterfaceUid,
+    TUid aParentUid,
+    CArrayPtrFlat<CGSPluginInterface>* aPluginArray )
+    {
+    iPluginArray = aPluginArray;
+    iParentUid = aParentUid;
+
+    __GSLOGSTRING3(
+        "[GSPlgLoader] LoadAsync(). aInterfaceUid:0x%X aParentUid:0x%X, aPluginArray:0x%X",
+        aInterfaceUid, aParentUid, aPluginArray );
+    // Reset iterator:
+    iImplInfoArrayIterator = 0;
+
+    __GSLOGSTRING1( "[GSPlgLoader] Implementation info count: %d",
+        iImplInfoArray.Count() );
+
+    NotifyProgress();
+
+    //Begin CActive asynchronous loop.
+    CompleteOwnRequest();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::LoadSyncL
+//
+//
+// ----------------------------------------------------------------------------
+//
+CGSPluginInterface& CGSPluginLoader::LoadSyncL( TUid aInterfaceUid,
+                                                TUid aImplementationUid )
+    {
+    Cancel();
+    CGSPluginInterface* ret = NULL;
+
+    // Get a list of all implementations, even though we only want one specific.
+    // There appears to be no way to otherwise extract a specific implementation
+    // info object :(
+    // Search for the implementation that matches aImplementationUid
+    const TInt impCount = iImplInfoArray.Count();
+    for( TInt i=0; i<impCount; i++ )
+        {
+        const CImplementationInformation* info = iImplInfoArray[ i ];
+        if  ( info->ImplementationUid() == aImplementationUid )
+            {
+            ret = &CreatePluginInstanceL( *info );
+            break;
+            }
+        }
+
+    if  ( !ret )
+        {
+        User::Leave( KErrNotFound );
+        }
+    return *ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::AbortAsyncLoad
+//
+//
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginLoader::AbortAsyncLoad()
+    {
+    __GSLOGSTRING( "[GSPlgLoader] AbortAsyncLoad()" );
+    Cancel();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::RunL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::RunL()
+    {
+    iRunLDebugCount++;
+    
+    // This must be done only in RunL or otherwise request might be 
+    // outstanding.
+    if( iRequestedPriority != Priority() )
+        {
+        __GSLOGSTRING3(
+            "[CGSPluginLoader::RunL] 0x%X original priority:%d requested priority:%d", 
+            iParentUid.iUid, 
+            Priority(),
+            iRequestedPriority );
+        
+        SetPriority( iRequestedPriority );
+        }
+    
+    LoadNextPluginL();
+
+    // Check if there are still more plugins to be loaded:
+    if ( iImplInfoArrayIterator < iImplInfoArray.Count() )
+        {
+        NotifyProgress();
+        // Continue CActive asynchronous loop.
+        CompleteOwnRequest();
+        }
+    else
+        {
+        // All plugins loaded:
+        __GSLOGSTRING( "[GSPlgLoader] Loading plugins finished." );
+        NotifyFinished();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CScGenreItemConstructionConductor::CompleteOwnRequest
+//
+// Issue request complete notification.
+// ---------------------------------------------------------------------------
+void CGSPluginLoader::CompleteOwnRequest()
+    {
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    SetActive();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::RunError
+//
+//
+// ----------------------------------------------------------------------------
+//
+TInt CGSPluginLoader::RunError( TInt aError )
+    {
+    // This method is called when a plugin loading fails.
+    // Always "fake" the return value so that ActiveSchedule
+    // keeps running and later plugins are continued to be loaded.
+    // Check if still plugins to be loaded:
+    if( iImplInfoArrayIterator < iImplInfoArray.Count() )
+        {
+        NotifyProgress();
+
+        //Continue CActive asynchronous loop.
+        CompleteOwnRequest();
+        }
+    else // All plugins loaded:
+        {
+        NotifyFinished();
+        }
+
+    if ( aError == KLeaveExit )
+        {
+        return KLeaveExit;
+        }
+
+    return KErrNone;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::DoCancel
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::DoCancel()
+    {
+
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::NotifyProgress
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::NotifyProgress()
+    {
+    if( iObserver )
+        {
+        iObserver->HandlePluginLoaded( MGSPluginLoadObserver::EGSSuccess);
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::NotifyFinished
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::NotifyFinished()
+    {
+
+    #ifdef _GS_PLUGINLOADER_FINAL_SORTING_TRACES
+        TRAP_IGNORE( PrintOrderTracesL( iPluginArray ) );
+    #endif // _GS_PLUGINLOADER_FINAL_SORTING_TRACES
+
+    // I have finished loading: No need to keep me in the expensive scheduler
+    // queue.
+    Deque();
+
+    if( iObserver )
+        {
+        iObserver->HandlePluginLoaded( MGSPluginLoadObserver::EGSFinished );
+        }
+    
+    __GSLOGSTRING1( "[CGSPluginLoader::NotifyFinished] 0x%X", 
+                    iParentUid.iUid );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::SetObserver
+//
+//
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginLoader::SetObserver(MGSPluginLoadObserver* aObserver)
+    {
+    __GSLOGSTRING1("[GSPlgLoader] Observer set:0x%X", aObserver);
+    iObserver = aObserver;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::ParseToUid
+// Parses a UID from descriptor of form '0xNNNNNNNN' where N is hexadecimal.
+//
+// ----------------------------------------------------------------------------
+//
+TInt CGSPluginLoader::ParseToUid( const TDesC8& aSource, TUid& aTarget )
+    {
+    // Remove "0x" from the descriptor if it exists
+    _LIT8(KHexPrefix, "0x");
+
+    TPtrC8 pSource( aSource );
+    const TInt prefixPosition = pSource.Find( KHexPrefix );
+    if  ( prefixPosition != KErrNotFound )
+        {
+        pSource.Set( aSource.Mid( prefixPosition + KHexPrefix().Length() ) );
+        }
+
+    // Parse to integer
+    TLex8 lex( pSource );
+    TUint integer = 0;
+
+    // Parse using TRadix::EHex as radix:
+    const TInt err = lex.Val( integer, EHex );
+    aTarget.iUid = integer;
+
+    if( err != KErrNone )
+        {
+        // If parsing parent UID failed, do not load plugin:
+        __GSLOGSTRING1(
+            "[GSPlgLoader] Parsing parent UID failed. Error code:%d",
+            err );
+        }
+    return err;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::ParseOrderNumber
+//
+//
+// ----------------------------------------------------------------------------
+//
+TInt CGSPluginLoader::ParseOrderNumber( const TDesC8& aSource, TInt& aOrderNumber )
+    {
+    // Parse plugin's order number from opaque_data:
+    TLex8 lex( aSource );
+    const TInt orderErr = lex.Val( aOrderNumber );
+    return orderErr;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::PrintInfoDebug
+// Print CImplementationInformation to log. Used for debugging.
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::PrintInfoDebugL( const CImplementationInformation& aInfo,
+                                      TInt aIterator,
+                                      TInt aPluginCount )
+    {
+
+
+    #pragma message("-CGSPluginLoader verbose traces activated-")
+    __GSLOGSTRING2( "[GSPlgLoader::LoadNextPluginL] %d/%d",
+                    aIterator,
+                    aPluginCount);
+
+    __GSLOGSTRING1( "[GSPlgLoader] --Plugin 0x%X info--", &aInfo);
+    __GSLOGSTRING1( "[GSPlgLoader] DisplayName:%S", &aInfo.DisplayName() );
+    __GSLOGSTRING1( "[GSPlgLoader] ImplementationUid:0x%X",
+                    aInfo.ImplementationUid() );
+
+    const TInt KMaxEComDataLength = 256;
+
+    HBufC* dataType = HBufC::New( KMaxEComDataLength );
+    HBufC* opaqueData = HBufC::New( KMaxEComDataLength );
+
+    dataType->Des().Copy( aInfo.DataType() );
+    opaqueData->Des().Copy( aInfo.OpaqueData() );
+    __GSLOGSTRING1( "[GSPlgLoader] DataType:%S", dataType );
+    __GSLOGSTRING1( "[GSPlgLoader] OpaqueData:%S", opaqueData );
+
+    delete opaqueData;
+    delete dataType;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::LoadNextPluginL
+// Iterate through iImplInfoArray. Load the plugin if it is eligible for
+// loading. Loaded plugin is added to iPluginArray. Each time a plugin is
+// loaded, iObserver is notified.
+//
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginLoader::LoadNextPluginL()
+    {
+    // Iterate through iImplInfoArray. This loop continues between function
+    // calls. Therefore member variable iImplInfoArrayIterator is used as a
+    // counter. Loop will break when match is found and continues on next RunL.
+    for( ; iImplInfoArrayIterator < iImplInfoArray.Count();  )
+        {
+        const CImplementationInformation* info =
+            iImplInfoArray[ iImplInfoArrayIterator ];
+
+        iImplInfoArrayIterator++;
+
+        #ifdef _GS_PLUGINLOADER_VERBOSE_TRACES
+            PrintInfoDebugL( *info, iImplInfoArrayIterator, iImplInfoArray.Count() );
+        #endif //_GS_PLUGINLOADER_VERBOSE_TRACES
+
+        // Parse parent UID from default_data:
+        TUid parentUid;
+        const TInt uidErr = ParseToUid( info->DataType(), parentUid );
+
+        if( uidErr == KErrNone  && iParentUid == parentUid )
+            {
+            // If this plugin is OK -> load it:
+            __GSLOGSTRING2( "[GSPlgLoader] %S eligible for parent 0x%X",
+                    &info->DisplayName(), iParentUid.iUid );
+            CGSPluginInterface* plugin = NULL;
+            TInt error = KErrCancel;
+            if( !iWatchDog->IsInBlackList( info->ImplementationUid() ) )
+                {
+                // Only panics move quarantined plugins to blacklist. Leaving is
+                // normal programmatic functionality and therefore does not move
+                // plugin to blacklist.
+                iWatchDog->QuarantineL( info->ImplementationUid() );
+
+                #ifdef _GS_PERFORMANCE_TRACES
+                    TTime timeStart;
+                    TTime timeEnd;
+                    timeStart.HomeTime();
+                #endif //_GS_PERFORMANCE_TRACES
+
+                // Create plugin. Trap leave for debugging purposes.
+                TRAP( error, plugin = &CreatePluginInstanceL( *info ); );
+
+                #ifdef _GS_PERFORMANCE_TRACES
+                    timeEnd.HomeTime();
+                    TTimeIntervalMicroSeconds funcDuration = timeEnd.MicroSecondsFrom( timeStart );
+                    __GSLOGSTRING2( "[GSPlgLoader::LoadNextPluginL/perf] %Ld    (%S)", funcDuration, &info->DisplayName() );
+                #endif //_GS_PERFORMANCE_TRACES
+
+                TRAP_IGNORE( iWatchDog->RemoveFromQuarantineL( info->ImplementationUid() ); );
+                }
+            if( error == KErrNone )
+                {
+                // Plugin ownership is transfered to iPluginArray
+                InsertPluginInOrderL( plugin, iPluginArray );
+                }
+            else if( error == KLeaveExit )
+                {
+                __GSLOGSTRING( "[GSPlgLoader::LoadNextPluginL] LEAVE: KLeaveExit!!!" );
+                // Must pass KLeaveExit through or otherwise Exit-command will
+                // not be handled.
+                User::Leave( KLeaveExit );
+                }
+            else
+                {
+                // Error note is displayed even if plugin is not loaded
+                // -> plugin is in blacklist -> blacklist note displayed.
+                #ifdef _DEBUG
+                    DisplayErrorPopupL( error, info );
+                #endif //_DEBUG
+                }
+            // Wait for next round
+            break;
+            }
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::DisplayErrorPopupL
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::DisplayErrorPopupL(
+        TInt aError,
+        const CImplementationInformation* aInfo )
+    {
+
+    // Log error:
+    __GSLOGSTRING3( "[GSPlgLoader] %S (0x%X) loading failed with error code %d",
+                    &aInfo->DisplayName(),
+                    aInfo->ImplementationUid().iUid,
+                    aError );
+
+    // Runtime info message used only in _DEBUG builds.
+    // Buffer needs space for about 50 chars for debug text
+    // + 8 chars for hex UID
+    // + DisplayName().Length()
+    // + error code 10 chars...
+    HBufC* buf = HBufC::NewLC( 100 + aInfo->DisplayName().Length() );
+    TPtr ptr = buf->Des();
+
+    if( aError == KErrCancel )
+        {
+        _LIT( KDbgMsgBlacklisted, "Plugin in blacklist:\n%S (0x%X)" );
+        ptr.Format( KDbgMsgBlacklisted,
+                    &aInfo->DisplayName(),
+                    aInfo->ImplementationUid().iUid );
+        }
+    else
+        {
+        _LIT( KDbgMsg, "Error:\n%S (0x%X)\nloading failed with error code %d" );
+        ptr.Format( KDbgMsg,
+                    &aInfo->DisplayName(),
+                    aInfo->ImplementationUid().iUid,
+                    aError );
+        }
+    if( iErrorPopup )
+        {
+        delete iErrorPopup;
+        iErrorPopup = NULL;
+        }
+    iErrorPopup = CAknInfoPopupNoteController::NewL();
+    iErrorPopup->SetTextL( ptr );
+    CleanupStack::PopAndDestroy( buf );
+    iErrorPopup->ShowInfoPopupNote();
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::CreatePluginInstanceL
+//
+//
+// ----------------------------------------------------------------------------
+//
+CGSPluginInterface& CGSPluginLoader::CreatePluginInstanceL(
+    const CImplementationInformation& aImpInfo )
+    {
+    // Create a wrapper for the plugin - this will take
+    // care of cleaning up the plugin dll. This must be on
+    // the cleanup stack above the plugin object itself - since
+    // the cleanup stack will first delete the plugin, then the
+    // plugin wrapper will be called to unload the ECOM plugin
+    // dll itself.
+    CGSPluginWrapper* wrapper = iDocument->NewPluginUnloadWrapperLC();
+
+    // Now we can load the plugin
+    const TUid implUid = aImpInfo.ImplementationUid();
+
+    CGSPluginInterface* plugin = CGSPluginInterface::NewL( implUid,
+                                                           iAppUi );// Remove iAppUi
+    CleanupStack::PushL ( plugin );
+
+    // And now its okay to update the wrapper with the plugin's
+    // ECOM destructor info.
+    wrapper->SetDetails( plugin->iDtor_ID_Key );
+
+    // If plugin's resource definition had a valid order number,
+    // set it to plugin.
+    //
+    // If parent is GSAppsPlugin, this is where the ordering
+    // could be changed to follow the to-be-implemented resource file
+    // defining the plugin order.
+
+    // Parse plugin's order number from opaque_data:
+    TInt orderNumber = 0;
+    const TInt orderErr = ParseOrderNumber( aImpInfo.OpaqueData(), orderNumber );
+    if  ( orderErr == KErrNone && orderNumber >= 0 )
+        {
+        plugin->iOrder = orderNumber;
+        }
+
+    // When a specific view has been activated externally to GS (e.g
+    // whilst GS is not running) we have to load the view's plugin on-demand.
+    // This means that the plugin is essentially free-floating and is not bound
+    // to a parent's CGSParentPlugin::iPluginArray.
+    //
+    // In this situation, even though we have activated a specific view,
+    // the plugin loader(s) continue to operate in the background.
+    //
+    // Eventually, as the loaders progress, a second attempt will occur to
+    // load the same view (that was activated externally).
+    //
+    // In this situation, we discard the recently loaded instance of the plugin
+    // and instead preserve the view that the user is (presumably) already using.
+    //
+    // However, we must ensure that we synchronous the parent's iPluginArray
+    // with the pre-existing view instance.
+    const TUid viewId = plugin->Id();
+    CGSPluginAndViewIdCache& pluginViewIdCache = iDocument->PluginViewIdCache();
+    const TBool isAlreadyLoaded = pluginViewIdCache.IsPluginLoaded( viewId );
+
+    if  ( !isAlreadyLoaded )
+        {
+        // Cache the view uid & ECOM plugin dll uid to enable us
+        // to more quickly handle external view activation requests
+        // when GS is not already running.
+        pluginViewIdCache.RegisterViewAndImplementationAssociationL( viewId, implUid );
+
+        // Prepare to register the plugin with the cache.  Pushes a cleanup stack
+        // item in case adding the view should leave.
+        pluginViewIdCache.PrepareToRegisterPluginInstanceLC( viewId );
+
+        // Add loaded view to appUi. At this point, the GS framework
+        // is no longer responsible for the lifetime of the 'plugin'
+        // object.
+        //
+        // However, to ensure sucessful cleanup of deleted
+        // views, we have separated the ECOM plugin dll (controlled by
+        // plugin->iDtor_ID_Key) to a separate object. This object is
+        // owned by the loader.
+        iAppUi->AddViewL( plugin );
+
+        // Pop the cleanup item - all is well now.
+        CleanupStack::Pop(); // cleanup item from PrepareToRegisterPluginInstanceLC
+
+        CleanupStack::Pop( plugin ); // view framework is now responsible for this memory.
+
+        // Document, when it is destroyed, will handle unloading of ECOM dll.
+        CleanupStack::Pop( wrapper );
+
+        // Also register that we have loaded an instance of the specified view
+        // from a plugin.
+        pluginViewIdCache.RegisterPluginInstanceL( viewId, *plugin );
+        }
+    else
+        {
+        // Plugin is already loaded, presumably due to external view activation
+        // request.
+        //
+        // Discard "just loaded" instance and use the pre-loaded one instead.
+        CleanupStack::PopAndDestroy( 2, wrapper );
+        plugin = pluginViewIdCache.PluginInstance( viewId );
+        }
+
+    return *plugin;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::SortPluginsL
+//
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginLoader::SortPluginsL(
+        CArrayPtrFlat<CGSPluginInterface>* aPlugins )
+    {
+    RPointerArray<CGSPluginInterface> plugins;
+    TLinearOrder<CGSPluginInterface> order( CGSPluginLoader::Compare );
+
+    // Insertion will also order
+    for( TInt i = 0; i < aPlugins->Count(); i++ )
+        {
+        plugins.InsertInOrderL( (*aPlugins)[i], order );
+        }
+
+    // Replace original array content with sorted items
+    aPlugins->Reset();
+    for( TInt i = 0; i < plugins.Count(); i++ )
+        {
+        aPlugins->AppendL( plugins[i] );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::Compare
+//
+// Compare two plugins.
+// Precedence:
+// [1. plugin provider category]
+// 2. plugin order number
+// 3. plugin caption
+// Plugin provider gategory is currently disabled (not supported yet).
+// ----------------------------------------------------------------------------
+//
+TInt CGSPluginLoader::Compare( const CGSPluginInterface& aFirst,
+                               const CGSPluginInterface& aSecond )
+    {
+    TInt comparison = CompareCategory( aFirst, aSecond );
+    if( comparison == KGSComparisonEqual )
+        {
+        comparison = CompareIndex( aFirst, aSecond );
+        if( comparison == KGSComparisonEqual )
+            {
+            comparison = CompareCaption( aFirst, aSecond );
+            }
+        }
+    return comparison;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::InsertPluginInOrderL
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::InsertPluginInOrderL(
+    CGSPluginInterface* aPlugin,
+    CArrayPtrFlat<CGSPluginInterface>* aPlugins )
+    {
+    CGSPluginInterface* comparedPlugin;
+    TInt comparison = 0;
+    TBool inserted = EFalse;
+
+    for( TInt i = 0; i < aPlugins->Count(); i++ )
+        {
+        comparedPlugin = (*aPlugins)[i];
+        // Optimization: do not call time consuming Compare() multiple times!
+        comparison = Compare( *aPlugin, *comparedPlugin );
+        if( comparison < 0 )
+            {
+            aPlugins->InsertL( i, aPlugin );
+            inserted = ETrue;
+            break;
+            }
+        else if( comparison == 0 )
+            {
+            aPlugins->InsertL( i+1, aPlugin );
+            inserted = ETrue;
+            break;
+            }
+        }
+    // Plugin was not before any other plugin - make sure it's appended
+    if( !inserted )
+        {
+        aPlugins->AppendL( aPlugin );
+        }
+
+    #ifdef _GS_PLUGINLOADER_ITERATION_SORTING_TRACES
+        PrintOrderTracesL( aPlugins );
+    #endif // _GS_PLUGINLOADER_ITERATION_SORTING_TRACES
+
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::CompareCategory
+//
+// ----------------------------------------------------------------------------
+//
+void CGSPluginLoader::PrintOrderTracesL(
+        CArrayPtrFlat<CGSPluginInterface>* aPlugins )
+    {
+    __GSLOGSTRING1( "---[CGSPluginLoader] Sorted list for 0x%X---", iParentUid.iUid );
+    HBufC* name = HBufC::New( KGSCaptionSize );
+    CleanupStack::PushL( name );
+
+    TPtr ptr = name->Des();
+    CGSPluginInterface* plg;
+
+    for( TInt i = 0; i < aPlugins->Count(); i++ )
+        {
+        plg = (*aPlugins)[i];
+        plg->GetCaptionL( ptr );
+        __GSLOGSTRING4( "[CGSPluginLoader] Sorted list[%d] Category:%d (0x%X) %S",
+                plg->iOrder,
+                plg->PluginProviderCategory(),
+                plg->Id().iUid,
+                &ptr );
+        }
+    CleanupStack::PopAndDestroy( name );
+
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::CompareCategory
+//
+//
+// ----------------------------------------------------------------------------
+//
+TInt CGSPluginLoader::CompareCategory( const CGSPluginInterface& aFirst,
+                                       const CGSPluginInterface& aSecond )
+    {
+#ifdef RD_GS_COMPARE_BY_CATEGORY
+    TInt comparison = KGSComparisonBefore;//KGSComparisonEqual;
+
+    // Compare if a is before b:
+    TInt a = aFirst.PluginProviderCategory();
+    TInt b = aSecond.PluginProviderCategory();
+
+    // Cannot use less/greater comparison because int values used in here
+    // (KGSPluginProviderInternal) must not be revealed to 3rd parties.
+    if( a != b )
+        {
+        switch ( a )
+            {
+/*            case KGSPluginProviderInternal:
+                if( b != KGSPluginProviderInternal )
+                    {
+                    comparison = KGSComparisonAfter;
+                    }
+                break;*/
+            case CGSPluginInterface::EGSPluginProviderOEM:
+                if( b == KGSPluginProviderInternal )
+                    {
+                    comparison = KGSComparisonAfter;
+                    }
+                break;
+            case CGSPluginInterface::EGSPluginProviderOperator:
+                if( b == KGSPluginProviderInternal ||
+                    b == CGSPluginInterface::EGSPluginProviderOEM )
+                    {
+                    comparison = KGSComparisonAfter;
+                    }
+                break;
+            case CGSPluginInterface::EGSPluginProvider3rdParty:
+                if( b == KGSPluginProviderInternal ||
+                    b == CGSPluginInterface::EGSPluginProviderOEM ||
+                    b == CGSPluginInterface::EGSPluginProviderOperator )
+                    {
+                    comparison = KGSComparisonAfter;
+                    }
+                break;
+            default:
+                comparison = KGSComparisonBefore;
+                break;
+            }
+        }
+    else
+        {
+        comparison = KGSComparisonEqual;
+        }
+
+    return comparison;
+
+#else //RD_GS_COMPARE_BY_CATEGORY
+    #pragma message("Comparing by category DISABLED")
+    // Force comparison to equal so category comparison will not matter. If
+    // comparison by gategory is needed, simply remove the line below:
+    return KGSComparisonEqual;
+#endif //RD_GS_COMPARE_BY_CATEGORY
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::CompareCaption
+//
+//
+// ----------------------------------------------------------------------------
+//
+TInt CGSPluginLoader::CompareCaption( const CGSPluginInterface& aFirst,
+                                      const CGSPluginInterface& aSecond )
+    {
+    HBufC* firstCaptionBuf =  HBufC::New( KGSCaptionSize );
+    HBufC* secondCaptionBuf = HBufC::New( KGSCaptionSize );
+    TPtr firstCaption  = firstCaptionBuf->Des();
+    TPtr secondCaption = secondCaptionBuf->Des();
+    TInt comparison = KGSComparisonEqual;
+
+    TRAPD( err,  aFirst.GetCaptionL( firstCaption ); );
+    TRAPD( err2, aSecond.GetCaptionL( secondCaption ); );
+
+    if( err == KErrNone && err2 == KErrNone )
+        {
+        // CompareC return value must be converted to KGSComparisonXXX value.
+        TInt result = secondCaption.CompareC( firstCaption );
+        if( result < 0 )
+            {
+            comparison = KGSComparisonAfter;
+            }
+        else if( result > 0 )
+            {
+            comparison = KGSComparisonBefore;
+            }
+        }
+    delete firstCaptionBuf;
+    delete secondCaptionBuf;
+    return comparison;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginLoader::CompareIndex
+//
+//
+// ----------------------------------------------------------------------------
+//
+TInt CGSPluginLoader::CompareIndex( const CGSPluginInterface& aFirst,
+                                    const CGSPluginInterface& aSecond )
+    {
+    TInt comparison = KGSComparisonEqual;
+
+    // The plugin having index is before the one not having one
+
+    if( aFirst.iOrder  == KGSPluginNotIndexed &&
+        aSecond.iOrder == KGSPluginNotIndexed )
+        {
+        // Neither have index -> equal
+        comparison = KGSComparisonEqual;
+        }
+    else if( aFirst.iOrder == KGSPluginNotIndexed )
+        {
+        // The plugin having index is before the one not having one
+        comparison = KGSComparisonAfter;
+        }
+    else if( aSecond.iOrder == KGSPluginNotIndexed )
+        {
+        // The plugin having index is before the one not having one
+        comparison = KGSComparisonBefore;
+        }
+    else if( aFirst.iOrder < aSecond.iOrder )
+        {
+        // Compare actual index values
+        comparison = KGSComparisonBefore;
+        }
+    else if( aFirst.iOrder > aSecond.iOrder )
+        {
+        // Compare actual index values
+        comparison = KGSComparisonAfter;
+        }
+
+    return comparison;
+    }
+
+
+
+EXPORT_C void CGSPluginLoader::RequestPriority( CActive::TPriority aPriority )
+    {
+    iRequestedPriority = aPriority; 
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSPluginWrapper.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        GS plugin wrapper.
+*
+*/
+
+#include "GSPluginWrapper.h"
+
+// System includes
+#include <ecom.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CGSPluginWrapper::CGSPluginWrapper
+//
+// 
+// ----------------------------------------------------------------------------
+//
+CGSPluginWrapper::CGSPluginWrapper( CGSBaseDocument& aDocument )
+:   iDocument( aDocument )
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginWrapper::~CGSPluginWrapper
+//
+// 
+// ----------------------------------------------------------------------------
+//
+EXPORT_C CGSPluginWrapper::~CGSPluginWrapper()
+    {
+    if  ( iDestructorIdKey != KNullUid )
+        {
+        REComSession::DestroyedImplementation( iDestructorIdKey );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPluginWrapper::SetDetails
+//
+// 
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CGSPluginWrapper::SetDetails( TUid aDestructorIdKey )
+    {
+    iDestructorIdKey = aDestructorIdKey;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSPubSubsListener.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Publish and subscribe settings listener.
+*
+*/
+
+
+// INCLUDE FILES
+#include <gspubsubslistener.h>
+#include <mgssettingpsobserver.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::CGSPubSubsListener
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CGSPubSubsListener::CGSPubSubsListener( const TUid aUid, const TInt aKey, 
+                                       MGSSettingPSObserver* aObserver ) 
+    : CActive( CActive::EPriorityStandard )
+    {
+    iUid = aUid;
+    iId = aKey;
+    iCallback = aObserver;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::~CGSPubSubsListener
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CGSPubSubsListener::~CGSPubSubsListener()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::RunL
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::RunL()
+    {
+    const TRequestStatus status( iStatus );
+    StartListening();
+    iCallback->HandleNotifyPSL( iUid, iId, status );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::DoCancel
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::RunError
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+TInt CGSPubSubsListener::RunError( TInt /*aError*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::NewL
+//
+// Symbian OS two phased constructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CGSPubSubsListener* CGSPubSubsListener::NewL( const TUid aUid, const TInt aKey,
+                                              MGSSettingPSObserver* aObserver )
+    {
+    CGSPubSubsListener* self = new( ELeave ) 
+        CGSPubSubsListener( aUid, aKey, aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::StartListening
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::StartListening() 
+    {
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::ConstructL
+//
+// Symbian OS default constructor
+// -----------------------------------------------------------------------------
+//
+void CGSPubSubsListener::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+    
+    User::LeaveIfError ( iProperty.Attach( iUid, iId, EOwnerThread ) );
+    StartListening();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::Get
+// Read integer value.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CGSPubSubsListener::Get( TInt& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::Get
+// Read binary value.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CGSPubSubsListener::Get( TDes8& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+  
+// -----------------------------------------------------------------------------
+// CGSPubSubsListener::Get
+// Read string value.
+// -----------------------------------------------------------------------------
+//      
+EXPORT_C TInt CGSPubSubsListener::Get( TDes16& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSShimmedView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,318 @@
+/*
+* Copyright (c) 2006-1008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Shim view
+*
+*/
+
+#include "GSShimmedView.h"
+
+// System includes
+#include <eikenv.h>
+#include <aknViewAppUi.h>
+
+// User includes
+#include "GSPluginAndViewIdCache.h"
+#include <gsfwviewuids.h>
+#include <gspluginloader.h>
+#include <gsplugininterface.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::CGSShimmedView
+//
+//
+// ----------------------------------------------------------------------------
+//
+CGSShimmedView::CGSShimmedView( TUid aViewId, 
+                                CGSPluginAndViewIdCache& aCache, 
+                                CCoeAppUi& aAppUi )
+:   CActive( KMaxTInt ), iViewId( aViewId ), iCache( aCache ), iAppUi( aAppUi )
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::~CGSShimmedView
+//
+//
+// ----------------------------------------------------------------------------
+//
+CGSShimmedView::~CGSShimmedView()
+    {
+    Cancel();
+    DeregisterView();
+    iCache.HandleShimDestruction( iViewId );
+    delete iCustomMessage;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::ConstructL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::ConstructL()
+    {
+    RegisterViewL();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::NewLC
+//
+//
+// ----------------------------------------------------------------------------
+//
+CGSShimmedView* CGSShimmedView::NewLC( TUid aViewId, 
+                                       CGSPluginAndViewIdCache& aCache, 
+                                       CCoeAppUi& aAppUi )
+    {
+    CGSShimmedView* self = new(ELeave) CGSShimmedView( aViewId, aCache, aAppUi );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::ViewId
+//
+//
+// ----------------------------------------------------------------------------
+//
+TVwsViewId CGSShimmedView::ViewId() const
+    {
+    const TVwsViewId ret( KUidGS, iViewId );
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::ViewActivatedL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::ViewActivatedL( const TVwsViewId& aPrevViewId, 
+                                     TUid aCustomMessageId, 
+                                     const TDesC8& aCustomMessage )
+    {
+    const TBool isLoaded = iCache.IsPluginLoaded( iViewId );
+    if  ( isLoaded == EFalse )
+        {
+        HBufC8* customMessage = aCustomMessage.AllocL();
+        delete iCustomMessage;
+        iCustomMessage = customMessage;
+
+        iCustomMessageId = aCustomMessageId;
+
+        iCache.SetPriorToPlaceholderActiveViewId( aPrevViewId );
+        SetState( EStateActivatingPlaceholderView );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::ViewDeactivated
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::ViewDeactivated()
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::RunL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::RunL()
+    {
+    // NB: At this point, we are the active view.
+
+    switch( iState )
+        {
+    default:
+    case EStateInactive:
+        break;
+
+    case EStateActivatingPlaceholderView:
+        StateActivatePlaceholderViewL();
+        break;
+
+    case EStateLoadingPlugin:
+        StateLoadPluginL();
+        break;
+
+    case EStateDeletingSelf:
+        SetState( EStateInactive, EFalse );
+        delete this;
+        break;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::RegisterViewL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::RegisterViewL()
+    {
+    iAppUi.RegisterViewL( *this );
+    iIsRegistered = ETrue;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::DeregisterView
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::DeregisterView()
+    {
+    if  ( iIsRegistered )
+        {
+        iAppUi.DeregisterView( *this );
+        }
+    iIsRegistered = EFalse;
+    }
+
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::DoCancel
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::DoCancel()
+    {
+    // Nothing to do here - requests already completed
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::SetState
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::SetState( TState aState, TBool aCompleteRequest )
+    {
+    Cancel();
+    //
+    iState = aState;
+    //
+    if  ( aCompleteRequest )
+        {
+        if  ( !IsAdded() )
+            {
+            // Add only on-demand to avoid cluttering the scheduler
+            CActiveScheduler::Add( this );
+            }
+
+        // Complete ourselves to continue activation process asynchronously
+        // via RunL().
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete( status, KErrNone );
+        SetActive();
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSShimmedView::StateActivatePlaceholderViewL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::StateActivatePlaceholderViewL()
+    {
+    iCache.ActivatePlaceholderViewL();
+    SetState( EStateLoadingPlugin );
+    }
+
+
+//Disabling warning caused by err variable used inside macros
+#pragma diag_suppress 550
+// ----------------------------------------------------------------------------
+// CGSShimmedView::StateLoadPluginL
+//
+//
+// ----------------------------------------------------------------------------
+//
+void CGSShimmedView::StateLoadPluginL()
+    {
+    CAknViewAppUi& appUi = static_cast< CAknViewAppUi& >( iAppUi );
+
+    // As a fall back, we'll try to activate the view that was being
+    // displayed prior to us attempting to load a plugin.
+    TUid viewIdToActivate = iCache.PriorToPlaceholderActiveViewId().iViewUid;
+
+    // Get the implementation uid that contains this view.
+    const TUid impUid = iCache.PluginImplementationUidForView( iViewId );
+
+    if  ( impUid != KNullUid )
+        {
+        CGSPluginLoader* loader = CGSPluginLoader::NewL( &appUi );
+        CleanupStack::PushL( loader );
+
+        // Now try to load the specific instance of the GS plugin that
+        // implements the real view's concrete implementation.
+        //
+        // Since the act of loading a plugin will also attempt to register
+        // that plugin with the app ui (since a GS plugin "is a" view) we
+        // must first unregister the shim view. If there was an error
+        // loading the plugin, then we'll re-register the shim.
+        DeregisterView();
+       
+        CGSPluginInterface* plugin = NULL;
+        TRAPD( loadError, plugin = &loader->LoadSyncL( KGSPluginInterfaceUid, impUid ) );
+        CleanupStack::PopAndDestroy( loader );
+
+        if  ( loadError == KErrNone )
+            {
+            // .. and set us up to activate the newly loaded plugin view.
+            viewIdToActivate = iViewId;
+
+            // Set ourselves up to be destroyed in the next RunL callback
+            SetState( EStateDeletingSelf );
+            }
+        else
+            {
+            // Didn't manage to load plugin. Re-register the view
+            // and bail out.
+            SetState( EStateInactive, EFalse );
+            RegisterViewL();
+            }
+        }
+
+    appUi.ActivateLocalViewL( viewIdToActivate, iCustomMessageId, *iCustomMessage );
+    }
+//Enabling warnings
+#pragma diag_default 550
+
+
+
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSTabHelper.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,288 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Utility class for creating tab groups.
+*
+*/
+
+
+// INCLUDE FILES
+#include "gstabhelper.h"
+#include "gstabbedview.h"
+#include "GsLogger.h"
+
+#include <aknappui.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <akntabgrp.h>
+#include <AknTabObserver.h>
+#include <eikspane.h>
+#include <gulicon.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::CGSTabHelper
+// C++ constructor.
+//
+// ---------------------------------------------------------------------------
+//
+CGSTabHelper::CGSTabHelper()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::NewL()
+// Symbian OS two-phased constructor.
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSTabHelper* CGSTabHelper::NewL()
+    {
+    CGSTabHelper* self = NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::NewLC()
+// Symbian OS two-phased constructor.
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSTabHelper* CGSTabHelper::NewLC()
+    {
+    CGSTabHelper* self = new(ELeave) CGSTabHelper();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::ConstructL(const TRect& aRect)
+// Symbian OS default constuctor.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSTabHelper::ConstructL()
+    {
+    iNaviDecorator = NULL;
+
+    iAppUi =  static_cast<CAknViewAppUi*>( CCoeEnv::Static()->AppUi() );
+
+    CEikStatusPane* statusPane = iAppUi->StatusPane();
+
+    // Fetch pointer to the default navi pane container:
+    iNaviContainer = static_cast<CAknNavigationControlContainer*>
+        ( statusPane->ControlL( TUid::Uid(EEikStatusPaneUidNavi ) ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::~CGSTabHelper()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSTabHelper::~CGSTabHelper()
+    {
+    RemoveTabGroup();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSTabHelper::CreateTabGroupL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGSTabHelper::CreateTabGroupL( TUid aActiveViewUid,
+                                             MGSTabbedViewOwner* aTabOwner )
+    {
+    iTabOwner = aTabOwner;
+    CreateTabGroupL( aActiveViewUid, iTabOwner->TabbedViews() );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::CreateTabGroupL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSTabHelper::CreateTabGroupL(
+    TUid aActiveViewUid,
+    CArrayPtrFlat<CGSPluginInterface>* aTabbedViews )
+    {
+    RemoveTabGroup();//Remove possible old tab group.
+    iNaviDecorator = iNaviContainer->CreateTabGroupL( this );
+    iTabGroup =
+        static_cast<CAknTabGroup*> ( iNaviDecorator->DecoratedControl() );
+
+    switch ( aTabbedViews->Count() )
+        {
+        case 1:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithOneTab );
+            break;
+        case 2:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithTwoTabs );
+            break;
+        case 3:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithThreeTabs );
+            break;
+        default:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithFourTabs );
+            break;
+        }
+
+    for( TInt i = 0; i < aTabbedViews->Count(); i++ )
+        {
+        CGSPluginInterface* tabbedView = aTabbedViews->operator[]( i );
+        CGulIcon* icon = NULL;
+        TRAPD
+            (
+            err,
+            icon = tabbedView->CreateIconL( KGSIconTypeTab );
+            )
+
+        // CreateIconL should not leave outside. If creating icon leaves, use
+        // default icon.
+        if( err != KErrNone )
+            {
+            __GSLOGSTRING2(
+                "[CGSTabHelper] ERROR: 0x%X::CreateIconL failed (%d), using default icon.",
+                tabbedView->Id().iUid, err );
+
+            icon =
+                tabbedView->CGSPluginInterface::CreateIconL( KGSIconTypeTab );
+            }
+        CleanupStack::PushL( icon );
+        iTabGroup->AddTabL( tabbedView->Id().iUid,
+                           icon->Bitmap(),
+                           icon->Mask() );
+
+        // Bitmaps are now owned by the tab:
+        icon->SetBitmapsOwnedExternally( ETrue );
+
+        // Delete icon object. Bitmaps are not owned by icon anymore and thus
+        // not deleted:
+        CleanupStack::PopAndDestroy( icon );
+        }
+
+    iNaviContainer->PushL( *iNaviDecorator );
+
+    // The active tab should be same as active plugin
+    iTabGroup->SetActiveTabById( aActiveViewUid.iUid );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::CreateTabGroupL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSTabHelper::CreateTabGroupL(
+    TUid aActiveViewUid,
+    CArrayPtrFlat<MGSTabbedView>* aTabbedViews )
+    {
+    RemoveTabGroup();//Remove possible old tab group.
+    iNaviDecorator = iNaviContainer->CreateTabGroupL( this );
+    iTabGroup =
+        static_cast<CAknTabGroup*> ( iNaviDecorator->DecoratedControl() );
+
+    switch ( aTabbedViews->Count() )
+        {
+        case 1:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithOneTab );
+            break;
+        case 2:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithTwoTabs );
+            break;
+        case 3:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithThreeTabs );
+            break;
+        default:
+            iTabGroup->SetTabFixedWidthL( KTabWidthWithFourTabs );
+            break;
+        }
+
+    for( TInt i = 0; i < aTabbedViews->Count(); i++ )
+        {
+        MGSTabbedView* tabbedView = aTabbedViews->operator[]( i );
+
+         // Takes icon ownership
+        CGulIcon* icon = tabbedView->CreateTabIconL();
+        CleanupStack::PushL( icon );
+
+
+        iTabGroup->AddTabL( tabbedView->Id().iUid,
+                           icon->Bitmap(),
+                           icon->Mask() );
+
+        //Bitmaps are now owned by the tab:
+        icon->SetBitmapsOwnedExternally( ETrue );
+
+        // Delete icon object. Bitmaps are not owned by icon anymore and thus
+        // not deleted:
+        CleanupStack::PopAndDestroy( icon );
+        }
+
+    iNaviContainer->PushL( *iNaviDecorator );
+
+    // The active tab should be same as active plugin
+    iTabGroup->SetActiveTabById( aActiveViewUid.iUid );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::RemoveTabGroup()
+//
+// Removes the tab group owned by this class from navi pane.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSTabHelper::RemoveTabGroup()
+    {
+    if( iNaviDecorator )
+        {
+        iNaviContainer->Pop( iNaviDecorator );
+        delete iNaviDecorator;
+        iNaviDecorator = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTabHelper::TabChangedL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSTabHelper::TabChangedL( TInt aIndex )
+    {
+    TUid uid;
+    uid.iUid = iTabGroup->TabIdFromIndex( aIndex );
+
+    // If has a tab owner, notify it:
+    if( iTabOwner )
+        {
+        iTabOwner->TabChangedL( uid );
+        }
+
+    iAppUi->ActivateLocalViewL( uid );
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSFramework/src/GSWatchDog.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,565 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include    <bldvariant.hrh>
+#include    <featmgr.h>
+#include    <centralrepository.h>
+
+// USER INCLUDES
+#include    "GSWatchDog.h"
+#include    "GsLogger.h"
+#include    "settingsinternalcrkeys.h"
+#include    "SettingsPrivateCRKeys.h"
+
+#include    <eikenv.h>
+#include    <s32mem.h>
+#include    <centralrepository.h>
+
+using namespace NCentralRepositoryConstants;
+
+// CONSTANTS
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ----------------------------------------------------------------------------
+// CGSWatchDog::NewL
+//
+// EPOC two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSWatchDog* CGSWatchDog::NewL()
+    {
+    CGSWatchDog* self = new( ELeave ) CGSWatchDog;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSWatchDog::ConstructL
+//
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSWatchDog::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSWatchDog] ConstructL()" );
+    iStore = CRepository::NewL( KCRUidMiscSettings );
+
+    // Read last stored state for watchdog...
+    ReadStateL();
+
+    // If GS crashed last time, activate watchdog, reset run counter. Watchdog
+    // will be active as long as exit was not clean (panicked).
+    if( !WasCleanExitL() &&
+        iWatchdogActivationLimit != KGSWatchdogActivationDisabled  )
+        {
+        iCrashCounter++;
+        iIsActive = ETrue;
+
+#ifdef _GS_WATCHDOG_VERBOSE_TRACES
+    #pragma message("-CGSWachDog verbose traces activated-")
+    User::InfoPrint( _L("Watchdog activated!") );
+#endif //_GS_WATCHDOG_VERBOSE_TRACES
+
+        if( iQuarantine.Count() > 0 )
+            {
+            for( TInt i = 0; i < iQuarantine.Count(); i++ )
+                {
+                // If plugin is not already in blacklist, move it there from
+                // quarantinelist.
+                if( !IsInBlackList( iQuarantine[i] ) )
+                    {
+                    TGSPluginQuarantine quarantinedPlugin;
+                    quarantinedPlugin.iRunsAfterCrash = 0;
+                    quarantinedPlugin.iUid = iQuarantine[i];
+                    iBlackList.Append( quarantinedPlugin );
+                    iQuarantine.Remove( i );
+                    }
+                }
+            }
+        }
+     else
+        {
+        iIsActive = EFalse;
+        iCrashCounter = 0;
+
+#ifdef _GS_WATCHDOG_VERBOSE_TRACES
+    User::InfoPrint( _L("Watchdog disabled.") );
+#endif //_GS_WATCHDOG_VERBOSE_TRACES
+
+        // Clean run -> empty quarantine.
+        iQuarantine.Reset();
+        }
+
+    // Continue normal progress, set application to run state...
+    iGSAppRunning = ETrue;
+
+    // Store watchdog state at this point as panic will not call normal
+    // destructors and data would be otherwise lost in case of panic.
+    StoreStateL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::CGSWatchDog
+//
+// C++ constructor
+// ---------------------------------------------------------------------------
+CGSWatchDog::CGSWatchDog()
+    {
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::~CGSWatchDog
+//
+// Destructor
+// ---------------------------------------------------------------------------
+CGSWatchDog::~CGSWatchDog()
+    {
+    // Update all blacklisted plugins in case no crash FIRST, then store...
+    UpdateBlackListedPluginRunCounters();
+    TRAP_IGNORE( StoreStateL(); );
+    iBlackList.Close();
+    iQuarantine.Close();
+    delete iStore;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::Quarantine
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::QuarantineL( TUid aPluginUid )
+    {
+    if( iIsActive )
+        {
+        iQuarantine.Append( aPluginUid );
+        StoreQuarantineL(); // Store to persistent storage
+
+#ifdef _GS_WATCHDOG_VERBOSE_TRACES
+    __GSLOGSTRING1( "[CGSWatchDog] Quarantined:0x%X", aPluginUid.iUid );
+#endif //_GS_WATCHDOG_VERBOSE_TRACES
+
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::RemoveFromQuarantine
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::RemoveFromQuarantineL( TUid aPluginUid )
+    {
+    if( iIsActive )
+        {
+        for( TInt i = 0; i < iQuarantine.Count(); i++ )
+            {
+            if( iQuarantine[i] == aPluginUid )
+                {
+                iQuarantine.Remove( i );
+
+#ifdef _GS_WATCHDOG_VERBOSE_TRACES
+    __GSLOGSTRING1( "[CGSWatchDog] Removed from quarantine:0x%X", aPluginUid.iUid );
+#endif //_GS_WATCHDOG_VERBOSE_TRACES
+
+                StoreQuarantineL();
+                break;
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::WasCleanExit
+//
+//
+// ---------------------------------------------------------------------------
+TBool CGSWatchDog::WasCleanExitL()
+    {
+    return !iGSAppRunning;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::ReportCleanExit
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::ReportCleanExitL()
+    {
+    iGSAppRunning = EFalse;
+    iStore->Set( KWatchDogGSRunning, iGSAppRunning );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::IsInBlackList
+//
+//
+// ---------------------------------------------------------------------------
+TBool CGSWatchDog::IsInBlackList( TUid aPluginUid )
+    {
+    TBool found = EFalse;
+    if( iIsActive )
+        {
+        for( TInt i = 0; i < iBlackList.Count(); i++ )
+            {
+            if( iBlackList[i].iUid == aPluginUid )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        }
+    
+    return found;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::StoreStateL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::StoreStateL()
+    {
+    //iStore->Set( KWatchDogIsActive,         iIsActive );
+    iStore->Set( KWatchDogGSRunning,        iGSAppRunning );
+    iStore->Set( KWatchDogCrashCounter,     iCrashCounter );
+    iStore->Set( KWatchdogActivationLimit,  iWatchdogActivationLimit );
+    iStore->Set( KWatchdogMaxPluginBlackListedRuns,   iMaxPluginBlackListedRuns );
+
+    StoreQuarantineL();
+    StoreBlackListL();
+
+#ifdef _GS_WATCHDOG_VERBOSE_TRACES
+    // The following is just for debug trace:
+    __GSLOGSTRING( "[CGSWatchDog] Storing state:" );
+    __GSLOGSTRING1( "   iIsActive: %d",     iIsActive );
+    __GSLOGSTRING1( "   iGSAppRunning: %d", iGSAppRunning );
+    __GSLOGSTRING1( "   iCrashCounter: %d",   iCrashCounter );
+    __GSLOGSTRING1( "   iWatchdogActivationLimit: %d", iWatchdogActivationLimit );
+    __GSLOGSTRING1( "   iMaxPluginBlackListedRuns: %d", iMaxPluginBlackListedRuns );
+
+    __GSLOGSTRING( "[CGSWatchDog] Stored plugins from quarantine:" );
+    for( TInt i = 0; i < iQuarantine.Count(); i++ )
+        {
+            __GSLOGSTRING1( "    0x%X", iQuarantine[i].iUid );
+        }
+    __GSLOGSTRING( "-" );
+
+    __GSLOGSTRING( "[CGSWatchDog] Stored plugins from blacklist:" );
+    for( TInt i = 0; i < iBlackList.Count(); i++ )
+        {
+            __GSLOGSTRING2( "    0x%X %d runs", iBlackList[i].iUid.iUid, iBlackList[i].iRunsAfterCrash );
+        }
+    __GSLOGSTRING( "-" );
+#endif //_GS_WATCHDOG_VERBOSE_TRACES
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::ReadStateL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::ReadStateL()
+    {
+    /*TInt isActive = EFalse; // Needed for mapping to TBool value
+    TInt err = iStore->Get( KWatchDogIsActive, isActive );
+    if( isActive == 1 )
+        {
+        iIsActive = ETrue;
+        }
+    else
+        {
+        iIsActive = EFalse;
+        }*/
+
+    TInt appRunning; // Needed for mapping to TBool value
+    TInt err = iStore->Get( KWatchDogGSRunning, appRunning );
+
+    if( err )
+        {
+        // CenRep values are uninitialized: first runtime of watchdog
+        // -> init values
+        InitStateL();
+        }
+
+    if( appRunning )
+        {
+        iGSAppRunning = ETrue;
+        }
+    else
+        {
+        iGSAppRunning = EFalse;
+        }
+
+    iStore->Get( KWatchDogCrashCounter, iCrashCounter );
+    iStore->Get( KWatchdogActivationLimit, iWatchdogActivationLimit );
+    iStore->Get( KWatchdogMaxPluginBlackListedRuns, iMaxPluginBlackListedRuns );
+
+    ReadQuarantineL();
+    ReadBlackListL();
+
+#ifdef _GS_WATCHDOG_VERBOSE_TRACES
+    // The following is just for debug trace:
+    __GSLOGSTRING( "[CGSWatchDog] Read state:" );
+    __GSLOGSTRING1( "   iIsActive: %d",     iIsActive );
+    __GSLOGSTRING1( "   iGSAppRunning: %d", iGSAppRunning );
+    __GSLOGSTRING1( "   iCrashCounter: %d", iCrashCounter );
+    __GSLOGSTRING1( "   iWatchdogActivationLimit: %d", iWatchdogActivationLimit );
+    __GSLOGSTRING1( "   iMaxPluginBlackListedRuns: %d", iMaxPluginBlackListedRuns );
+
+    __GSLOGSTRING( "[CGSWatchDog] Read plugins from quarantine:" );
+    for( TInt i = 0; i < iQuarantine.Count(); i++ )
+        {
+            __GSLOGSTRING1( "    0x%X", iQuarantine[i].iUid );
+        }
+    __GSLOGSTRING( "-" );
+
+    __GSLOGSTRING( "[CGSWatchDog] Read plugins from blacklist:" );
+    for( TInt i = 0; i < iBlackList.Count(); i++ )
+        {
+            __GSLOGSTRING2( "    0x%X %d runs", iBlackList[i].iUid.iUid, iBlackList[i].iRunsAfterCrash );
+        }
+    __GSLOGSTRING( "-" );
+#endif //_GS_WATCHDOG_VERBOSE_TRACES
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::InitStateL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::InitStateL()
+    {
+    __GSLOGSTRING( "[CGSWatchDog] initializing state..." );
+    iIsActive = EFalse;
+    iGSAppRunning = EFalse;
+    iCrashCounter = 0;
+
+    // Check CenRep, if values do not exist, use default values:
+    TInt err;
+    err = iStore->Get( KWatchDogCrashCounter, iWatchdogActivationLimit );
+    if( err )
+        {
+        iWatchdogActivationLimit = KGSDefaultWatchdogActivationLimit;
+        }
+
+    err = iStore->Get( KWatchdogMaxPluginBlackListedRuns, iMaxPluginBlackListedRuns);
+    if( err )
+        {
+        iMaxPluginBlackListedRuns = KGSDefaultMaxPluginBlackListedRuns;
+        }
+
+    StoreStateL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::ReadQuarantineL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::ReadQuarantineL()
+    {
+    HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength );
+    TPtr8 serializedArr = buf->Des();
+    iStore->Get( KWatchDogQuarantine, serializedArr );
+    RDesReadStream stream;
+    stream.Open( serializedArr );
+    CleanupClosePushL( stream );
+
+    // In case CenRep value is uninitialized (less than 16 bits), don't try
+    //reading it
+    TInt count = 0;
+    if( buf->Size() > 0 )
+        {
+        count = stream.ReadUint16L();
+        }
+    for( TInt i = 0; i < count; i++  )
+        {
+        TUid uid;
+        uid.iUid = stream.ReadInt32L();
+        iQuarantine.Append( uid );
+        }
+    //stream.Close();
+    CleanupStack::PopAndDestroy( &stream );
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::StoreQuarantineL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::StoreQuarantineL()
+    {
+    // Hmmm. KMaxBinaryLength = 1024*2 unicode characters (16bit)
+    // = 1024*2*16 bits = 32768.
+    // 32768 - 16(count) bits reserved for 32 bit TUids = 1023.5 TUids
+    // -> We can store 1023 UIds in quarantine. Should be enought as we have
+    // about ~50 plugins at the moment and each plugin ought to be listed in
+    // quarantine only once at a specific point of time.
+    HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength );
+    TPtr8 serializedArr = buf->Des();
+    RDesWriteStream stream;
+    stream.Open( serializedArr );
+    CleanupClosePushL( stream );
+
+    stream.WriteUint16L( iQuarantine.Count() );
+
+    for( TInt i = 0; i < iQuarantine.Count(); i++ )
+        {
+        stream.WriteInt32L( iQuarantine[i].iUid );
+        }
+    // This also flushes the stream:
+    CleanupStack::PopAndDestroy( &stream );
+
+    iStore->Set( KWatchDogQuarantine, serializedArr );
+
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::ReadBlackListL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::ReadBlackListL()
+    {
+    HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength );
+    TPtr8 serializedArr = buf->Des();
+    iStore->Get( KWatchDogBlackList, serializedArr );
+    RDesReadStream stream;
+    stream.Open( serializedArr );
+    CleanupClosePushL( stream );
+
+    // In case CenRep value is uninitialized (less than 16 bits), don't try
+    //reading it
+    TInt count = 0;
+    if( buf->Size() > 0 )
+        {
+        count = stream.ReadUint16L();
+        }
+    for( TInt i = 0; i < count; i++  )
+        {
+        TGSPluginQuarantine plugin;
+        plugin.InternalizeL( stream );
+        iBlackList.Append( plugin );
+        }
+
+    //stream.Close();
+    CleanupStack::PopAndDestroy( &stream );
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::StoreBlackListL
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::StoreBlackListL()
+    {
+    HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength );
+    TPtr8 serializedArr = buf->Des();
+    RDesWriteStream stream;
+    stream.Open( serializedArr );
+    CleanupClosePushL( stream );
+
+    stream.WriteUint16L( iBlackList.Count() );
+
+    for( TInt i = 0; i < iBlackList.Count(); i++ )
+        {
+        iBlackList[i].ExternalizeL( stream );
+
+#ifdef _GS_WATCHDOG_VERBOSE_TRACES
+    __GSLOGSTRING1( "[CGSWatchDog] Written to blacklist 0x%X",
+                    iBlackList[i].iUid.iUid );
+#endif //_GS_WATCHDOG_VERBOSE_TRACES
+
+        }
+    // This also flushes the stream:
+    CleanupStack::PopAndDestroy( &stream );
+
+    iStore->Set( KWatchDogBlackList, serializedArr );
+
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSWatchDog::UpdateBlackListedPluginRunCounters
+//
+//
+// ---------------------------------------------------------------------------
+void CGSWatchDog::UpdateBlackListedPluginRunCounters()
+    {
+    TInt count = iBlackList.Count();
+    for( TInt i = 0; i < count; i++ )
+        {
+        iBlackList[i].iRunsAfterCrash++;
+        if( iBlackList[i].iRunsAfterCrash > iMaxPluginBlackListedRuns )
+            {
+//__GSLOGSTRING2( "[CGSWatchDog] 0x%X removed from blacklist (%d runs)", iBlackList[i].iUid.iUid, iBlackList[i].iRunsAfterCrash );
+            iBlackList.Remove( i );
+            i--;    // Item in index i has been removed
+            count--;// One item has been removed from the array
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// TGSPluginQuarantine::InternalizeL
+//
+//
+// ---------------------------------------------------------------------------
+void TGSPluginQuarantine::InternalizeL( RReadStream& aStream )
+    {
+    iUid.iUid = aStream.ReadInt32L();
+    iRunsAfterCrash = aStream.ReadInt16L();
+    }
+
+
+// ---------------------------------------------------------------------------
+// TGSPluginQuarantine::ExternalizeL
+//
+//
+// ---------------------------------------------------------------------------
+void TGSPluginQuarantine::ExternalizeL( RWriteStream& aStream ) const
+    {
+    aStream.WriteInt32L( iUid.iUid );
+    aStream.WriteInt16L( iRunsAfterCrash );
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/GSGenPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSGenPlugin project specification file.
+*
+*/
+
+#include <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsgenplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10207238
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSGenPluginImplementationTable.cpp
+SOURCE              GSGenPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         ../Data
+USERINCLUDE         loc
+USERINCLUDE         ../Logger
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+SOURCEPATH          data
+
+START RESOURCE      10207238.rss
+TARGET              gsgenplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSGenPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+// Libraries
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             egul.lib // CGulIcon
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             euser.lib
+LIBRARY             flogger.lib // For GSLogger
+LIBRARY             gsframework.lib
+LIBRARY             gsecomplugin.lib
+LIBRARY             gslistbox.lib// For CGSListBoxItemTextArray
+LIBRARY             ws32.lib // For RWsSession
+LIBRARY             featmgr.lib  // feature manager
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10207238.rss
+DOCUMENT            GSGenPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSGenPlugin.
+*
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSGenPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsgenplugin.iby )
+../rom/GSGenPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsgenpluginresources.iby )
+loc/GSGenPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsgenplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsgenplugin.mif
+  OPTION HEADERFILE gsgenplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_dev
+END
+
+PRJ_MMPFILES
+GSGenPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSGenPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/data/10207238.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSGenPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x10207238;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x10207237;
+                    version_no          = 1;
+                    display_name        = "General Settings Plugin"; // Debug name
+                    default_data        = "0x1020723B";// Parent UID
+                    #ifdef RD_CONTROL_PANEL
+                        opaque_data         = "20";// Order number
+                    #else //RD_CONTROL_PANEL
+                        opaque_data         = "0";// Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/data/GSGenPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file GSGenPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    GENE // 4 letter ID
+
+//  INCLUDES
+#include    <gsgenplugin.loc>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_gen_view
+//    General settings view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_gen_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_gen_view_title
+//    General settings view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_gen_view_title
+    {
+    #ifdef RD_CONTROL_PANEL
+        txt = qtn_cp_title_device;
+    #else //RD_CONTROL_PANEL
+        txt = qtn_set_title_settings_general;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+//----------------------------------------------------
+//  r_gs_gen_view_caption
+//
+// gen view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_gen_view_caption
+    {
+    #ifdef RD_CONTROL_PANEL
+        buf = qtn_cp_folder_device;
+    #else //RD_CONTROL_PANEL
+        buf = qtn_set_folder_general;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/inc/GSGenPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSGenPlugin header.
+*
+*/
+
+
+#ifndef GSGENPLUGIN_H
+#define GSGENPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <eikmenup.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+class CGSTabHelper;
+
+// Constants
+_LIT( KGSGenPluginResourceFileName, "z:GSGenPluginRsc.rsc" );
+_LIT( KGSGenPluginIconDirAndName, "z:GSGenPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+* CGSGenPlugin view class.
+*
+* @since Series60_3.1
+*/
+class CGSGenPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSGenPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSGenPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSGenPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+
+        // Tab hepler.
+        CGSTabHelper* iTabHelper;
+    };
+
+
+#endif // GSGENPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/loc/GSGenPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSGenPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Plugin caption
+//d:Long string
+//l:title_pane_t2/opt9
+//w:
+//r: 3.1
+//
+#define qtn_set_title_settings_general "General"
+
+// **OPTIONS MENU
+
+//d:Command in Options list
+//d:Opens the highlighted item
+//l:list_single_pane_t1_cp2
+//w:
+//r: 3.1
+//
+#define qtn_set_options_open "Open"
+
+
+//d:Text of a list item in main view list
+//d:Item opens General folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_folder_general "General"
+
+//CONTROL PANEL
+
+//d:Plugin caption
+//d:Long string
+//l:title_pane_t2/opt9
+//w:
+//r: 5.0
+//
+#define qtn_cp_title_device "Device"
+
+//d:Text of a list item in main view list
+//d:Item opens General folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 5.0
+#define qtn_cp_folder_device "Device"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/src/GSGenPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSGenPlugin source code.
+*
+*/
+
+
+// Includes
+#include "GSGenPlugin.h"
+#include "GsLogger.h"
+#include <gsfwviewuids.h>
+#include <gsgenplugin.mbg> // Icons
+#include <GSGenPluginRsc.rsg>
+#include <gsmainview.h>
+#include <gsprivatepluginproviderids.h>
+#include <csxhelp/cp.hlp.hrh>
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <barsread.h> // For TResourceReader
+#include <featmgr.h>
+
+#ifndef RD_CONTROL_PANEL
+    #include <GSTabHelper.h>
+#endif //RD_CONTROL_PANEL
+
+// Constants
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSGenPlugin::CGSGenPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSGenPlugin::CGSGenPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSGenPlugin] CGSGenPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSGenPlugin::~CGSGenPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSGenPlugin::~CGSGenPlugin()
+    {
+    __GSLOGSTRING( "[CGSGenPlugin] ~CGSGenPlugin()|->" );
+    FeatureManager::UnInitializeLib();
+    iResourceLoader.Close();
+    
+    #ifndef RD_CONTROL_PANEL
+        if ( iTabHelper )
+            {
+            delete iTabHelper;
+            }
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSGenPlugin] ~CGSGenPlugin()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSGenPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSGenPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSGenPlugin] ConstructL()|->" );
+    FeatureManager::InitializeLibL();
+    OpenLocalizedResourceFileL( KGSGenPluginResourceFileName,
+                                iResourceLoader );
+    BaseConstructL( R_GS_GEN_VIEW, R_GS_GEN_VIEW_TITLE );
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper = CGSTabHelper::NewL();
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSGenPlugin] ConstructL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSGenPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSGenPlugin* CGSGenPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    __GSLOGSTRING( "[CGSGenPlugin] NewL()" );
+
+    CGSGenPlugin* self = new(ELeave) CGSGenPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSGenPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSGenPlugin] Id():0x%X", KGSGenPluginUid.iUid );
+    return KGSGenPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSGenPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING( "[CGSGenPlugin] DoActivateL()|->" );
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+
+    
+    #ifndef RD_CONTROL_PANEL
+        // Create tab group for this view (do only if casting parent succeeds):
+        if( parent )
+            {
+            iTabHelper->CreateTabGroupL( Id(), parent );
+            }
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSGenPlugin] DoActivateL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSGenPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSGenPlugin] DoDeactivate()|->" );
+    CGSParentPlugin::DoDeactivate();
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper->RemoveTabGroup();
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSGenPlugin] DoDeactivate()-|" );
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSGenPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSGenPlugin::UpperLevelViewUid()
+    {
+    return KGSMainViewUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSGenPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSGenPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __GSLOGSTRING( "[CGSGenPlugin] GetCaptionL()|->" );
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_GEN_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    __GSLOGSTRING( "[CGSGenPlugin] GetCaptionL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSGenPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSGenPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSGenPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSGenPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_DEVICE;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSGenPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSGenPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSGenPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpDev,
+        fp->FullName(),
+        EMbmGsgenpluginQgn_prop_cp_dev,
+        EMbmGsgenpluginQgn_prop_cp_dev_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSGenPlugin::DynInitMenuPaneL()
+// 
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSGenPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                     CEikMenuPane* aMenuPane )
+    {
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSGenPlugin/src/GSGenPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSGenPlugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSGenPlugin.h"
+
+// Constants
+const TImplementationProxy KGSGenPluginImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10207237,	CGSGenPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSGenPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+	return KGSGenPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSIndicatorPlugin/data/200100DD.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Ecom registration resource for gsindicatorplugin
+*
+*/
+
+
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x200100DD;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = 0x10275092;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x200100DC;
+                    version_no = 1;
+                    display_name = "";
+                    default_data = "Default";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSIndicatorPlugin/group/GSindicatorplugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for GSindicatorplugin.
+*
+*/
+
+
+CAPABILITY CAP_ECOM_PLUGIN
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Build target
+TARGET          gsindicatorplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x200100DD
+VENDORID        VID_DEFAULT
+
+
+// Source files location
+SOURCEPATH      ../src
+SOURCE          GSindicatorpluginimplementation.cpp
+SOURCE          dllmain.cpp
+
+
+// Resources
+START RESOURCE  ../data/200100DD.rss
+TARGET					gsindicatorplugin.rsc
+TARGETPATH      ECOM_RESOURCE_DIR
+END
+
+// Include paths
+USERINCLUDE     ../inc
+USERINCLUDE     ../group
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+                
+// Dependencies to system components
+LIBRARY     eikcore.lib
+LIBRARY     cone.lib
+LIBRARY     euser.lib
+LIBRARY     ecom.lib
+LIBRARY     avkon.lib
+LIBRARY     commonengine.lib        // stringloader
+LIBRARY     bafl.lib                // baflutils
+LIBRARY     gslauncher.lib
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSIndicatorPlugin/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project file for gsindicatorplugin 
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+//
+// Platforms
+//
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/gsindicatorplugin.iby	CORE_MW_LAYER_IBY_EXPORT_PATH(gsindicatorplugin.iby)
+
+PRJ_MMPFILES
+GSindicatorplugin.mmp
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSIndicatorPlugin/inc/GSindicatorpluginimplementation.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSIndicatorplugin plugin implementation
+*
+*/
+
+
+
+#ifndef CGSINDICATORPLUGINIMPLEMENTATION_H
+#define CGSINDICATORPLUGINIMPLEMENTATION_H
+
+
+//  INCLUDES
+#include <AknIndicatorPlugin.h> // CAknIndicatorPlugin
+
+/**
+*  GSIndicatorplugin. When user taps signal pane in indicator pop-up pane
+*  this component will open general settings.
+*
+*  @lib gsindicatorplugin.lib
+*  @since 5.0
+*/
+class CGSIndicatorPluginImplementation : public CAknIndicatorPlugin                                        
+    {
+        
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CGSIndicatorPluginImplementation* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CGSIndicatorPluginImplementation();
+    public:
+    	static TInt Tick(TAny* aObject);
+
+    private: // From CAknIndicatorPlugin
+        
+        /**
+         * @see CAknIndicatorPlugin
+         */
+        void HandleIndicatorTapL( const TInt /*aUid */);
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CGSIndicatorPluginImplementation();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // new functions
+    	TInt DoTick();
+
+
+    private: // data
+    	CPeriodic* iTimer;
+    };
+
+#endif      // CGSINDICATORPLUGINIMPLEMENTATION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSIndicatorPlugin/rom/gsindicatorplugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  includes gsindicatorplugin to ROM
+*
+*/
+
+
+#ifndef __GSINDICATORPLUGIN_IBY__
+#define __GSINDICATORPLUGIN_IBY__
+
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN( GSIndicatorPlugin.dll, GSIndicatorPlugin.rsc )
+
+
+#endif  // __GSINDICATORPLUGIN_IBY__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSIndicatorPlugin/src/GSindicatorpluginimplementation.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  gsIndicatorPlugin plugin implementation
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "GSindicatorpluginimplementation.h"
+
+
+#include <coemain.h> // CCoeEnv
+#include <coeaui.h> // CCoeAppUi
+#include <gsfwviewuids.h>
+#include <data_caging_path_literals.hrh> // KDC_RESOURCE_FILES_DIR
+#include <gslauncher.h>
+
+// CONSTANTS
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CGSIndicatorPluginImplementation::CGSIndicatorPluginImplementation
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------------------------
+//
+CGSIndicatorPluginImplementation::CGSIndicatorPluginImplementation()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSIndicatorPluginImplementation::ConstructL
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------------------------
+//
+void CGSIndicatorPluginImplementation::ConstructL()
+    {
+    iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    }
+
+// -----------------------------------------------------------------------------
+// CGSIndicatorPluginImplementation::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CGSIndicatorPluginImplementation* CGSIndicatorPluginImplementation::NewL()
+    {
+    CGSIndicatorPluginImplementation* self = 
+        new( ELeave ) CGSIndicatorPluginImplementation;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// Destructor
+CGSIndicatorPluginImplementation::~CGSIndicatorPluginImplementation()
+    {
+    if ( iTimer )
+    	{
+    	iTimer->Cancel();
+    	delete iTimer;
+    	}
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSIndicatorPluginImplementation::HandleIndicatorTapL
+// ---------------------------------------------------------------------------
+//
+void CGSIndicatorPluginImplementation::HandleIndicatorTapL( const TInt /*aUid */)
+    {
+    if ( iTimer->IsActive() )
+    	{
+    	iTimer->Cancel();
+    	}
+    iTimer->Start(10, 10, TCallBack(Tick, this));
+		// Launch connection view
+//		CGSLauncher* l = CGSLauncher::NewLC();
+//		l->LaunchGSViewL ( KGSConPluginUid, TUid::Uid(0), KNullDesC8 ); 
+//    CleanupStack::PopAndDestroy(l);
+    }
+
+TInt CGSIndicatorPluginImplementation::Tick(TAny* aObject)
+	{
+	return static_cast<CGSIndicatorPluginImplementation*>(aObject)->DoTick();
+	}
+
+TInt CGSIndicatorPluginImplementation::DoTick()
+	{
+	if ( iTimer )
+		{
+		iTimer->Cancel();
+		}
+
+	// Launch connection view
+	CGSLauncher* l = CGSLauncher::NewLC();
+	TInt error = KErrNone;
+	TRAP(error, l->LaunchGSViewL ( KGSConPluginUid, TUid::Uid(0), KNullDesC8 ));
+	CleanupStack::PopAndDestroy(l);
+	return error;
+	}
+
+
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSIndicatorPlugin/src/dllmain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation for DllMain.
+*
+*/
+
+
+
+#include "GSindicatorpluginimplementation.h"
+
+#include <implementationproxy.h>
+
+// Define the interface UIDs
+// Map the interface implementation UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x200100DC, 
+                                CGSIndicatorPluginImplementation::NewL )
+	};
+	
+// Exported proxy for instantiation method resolution.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy
+        (TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(ImplementationTable[0]);
+    return ImplementationTable;
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/GSInstallationsPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSInstallationsPlugin project specification file.
+*
+*/
+
+#include <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsinstallationsplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10283320
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSInstallationsPluginImplementationTable.cpp
+SOURCE              GSInstallationsPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         ../Data
+USERINCLUDE         loc
+USERINCLUDE         ../Logger
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+SOURCEPATH          data
+
+START RESOURCE      10283320.rss
+TARGET              gsinstallationsplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSInstallationsPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+// Libraries
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             egul.lib // CGulIcon
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             euser.lib
+LIBRARY             flogger.lib // For GSLogger
+LIBRARY             gsframework.lib
+LIBRARY             gsecomplugin.lib
+LIBRARY             gslistbox.lib// For CGSListBoxItemTextArray
+LIBRARY             ws32.lib // For RWsSession
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10283320.rss
+DOCUMENT            GSInstallationsPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSInstallationsPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSInstallationsPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsinstallationsplugin.iby )
+../rom/GSInstallationsPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsinstallationspluginresources.iby )
+loc/GSInstallationsPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsinstallationsplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE GSInstallationsPlugin.mif
+  OPTION HEADERFILE GSInstallationsPlugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_inst
+END
+
+
+PRJ_MMPFILES
+GSInstallationsPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSInstallationsPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/data/10283320.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSInstallationsPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10283320;
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10283321;
+					version_no          = 1;
+					display_name        = "GSInstallationsPlugin"; // Debug name
+					default_data        = "0x1020723B";// Parent UID
+					opaque_data         = "30";// Order number
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/data/GSInstallationsPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file GSInstallationsPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    INST // 4 letter ID
+
+//  INCLUDES
+#include    <gsinstallationsplugin.loc>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_installations_view
+//    Installations view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_installations_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_installations_view_title
+//    Installations view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_installations_view_title
+    {
+    txt = qtn_cp_title_installations;
+    }
+
+
+//----------------------------------------------------
+//  r_gs_installations_view_caption
+//
+// gen view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_installations_view_caption
+    {
+    buf = qtn_cp_folder_installations;
+    }
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/inc/GSInstallationsPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSInstallationsPlugin header.
+*
+*/
+
+
+#ifndef GSINSTALLATIONSPLUGIN_H
+#define GSINSTALLATIONSPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+
+// Constants
+_LIT( KGSInstallationsPluginResourceFileName, "z:GSInstallationsPluginRsc.rsc" );
+_LIT( KGSInstallationsPluginIconDirAndName, "z:GSInstallationsPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+* CGSInstallationsPlugin view class.
+*
+* @since Series60_3.2
+*/
+class CGSInstallationsPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSInstallationsPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSInstallationsPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSInstallationsPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+    };
+
+
+#endif // GSINSTALLATIONSPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/loc/GSInstallationsPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSInstallationsPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Plugin title.
+//d:Long string.
+//l:title_pane_t2/opt9
+//w:
+//r:5.0
+//
+#define qtn_cp_title_installations "Installations"
+
+//d:Plugin caption.
+//d:Used by GS FW.
+//l:list_single_large_graphic_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_cp_folder_installations "Installations"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSInstallationsPlugin source code.
+*
+*/
+
+
+// Includes
+#include "GSInstallationsPlugin.h"
+#include "GsLogger.h"
+#include <gsfwviewuids.h>
+#include <GSInstallationsPlugin.mbg> // Icons
+#include <GSInstallationsPluginRsc.rsg>
+#include <gsmainview.h>
+#include <gsprivatepluginproviderids.h>
+#include <csxhelp/cp.hlp.hrh>
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <barsread.h> // For TResourceReader
+
+
+// Constants
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSInstallationsPlugin::CGSInstallationsPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSInstallationsPlugin::CGSInstallationsPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSInstallationsPlugin] CGSInstallationsPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSInstallationsPlugin::~CGSInstallationsPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSInstallationsPlugin::~CGSInstallationsPlugin()
+    {
+    __GSLOGSTRING( "[CGSInstallationsPlugin] ~CGSInstallationsPlugin()|->" );
+    iResourceLoader.Close();
+    __GSLOGSTRING( "[CGSInstallationsPlugin] ~CGSInstallationsPlugin()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSInstallationsPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSInstallationsPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSInstallationsPlugin] ConstructL()|->" );
+    OpenLocalizedResourceFileL( KGSInstallationsPluginResourceFileName,
+                                iResourceLoader );
+    BaseConstructL( R_GS_INSTALLATIONS_VIEW, R_GS_INSTALLATIONS_VIEW_TITLE );
+    __GSLOGSTRING( "[CGSInstallationsPlugin] ConstructL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSInstallationsPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSInstallationsPlugin* CGSInstallationsPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    __GSLOGSTRING( "[CGSInstallationsPlugin] NewL()" );
+
+    CGSInstallationsPlugin* self = new(ELeave) CGSInstallationsPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSInstallationsPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSInstallationsPlugin] Id():0x%X", KGSInstallationsPluginUid.iUid );
+    return KGSInstallationsPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSInstallationsPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING( "[CGSInstallationsPlugin] DoActivateL()|->" );
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+
+    // Create tab group for this view (do only if casting parent succeeds):
+    __GSLOGSTRING( "[CGSInstallationsPlugin] DoActivateL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSInstallationsPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSInstallationsPlugin] DoDeactivate()|->" );
+    CGSParentPlugin::DoDeactivate();
+    __GSLOGSTRING( "[CGSInstallationsPlugin] DoDeactivate()-|" );
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSInstallationsPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSInstallationsPlugin::UpperLevelViewUid()
+    {
+    return KGSMainViewUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSInstallationsPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSInstallationsPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __GSLOGSTRING( "[CGSInstallationsPlugin] GetCaptionL()|->" );
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_INSTALLATIONS_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    __GSLOGSTRING( "[CGSInstallationsPlugin] GetCaptionL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSInstallationsPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSInstallationsPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSInstallationsPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSInstallationsPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_INSTALLATIONS;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSInstallationsPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSInstallationsPlugin::CreateIconL( const TUid aIconType )
+    {
+
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSInstallationsPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpInst,
+        fp->FullName(),
+        EMbmGsinstallationspluginQgn_prop_cp_inst,
+        EMbmGsinstallationspluginQgn_prop_cp_inst_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSInstallationsPlugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSInstallationsPlugin.h"
+
+// Constants
+const TImplementationProxy KGSInstallationsPluginImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10283321,	CGSInstallationsPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSInstallationsPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+	return KGSInstallationsPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSListBox/GSListBox.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is project specification for GS Listbox DLL
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+
+TARGET          gslistbox.dll
+TARGETTYPE      DLL
+UID             0x1000008d 0x101FD68D
+
+SOURCEPATH      Src
+SOURCE          GSListBox.cpp
+
+USERINCLUDE     .
+USERINCLUDE     Inc
+USERINCLUDE     ../Data
+USERINCLUDE     ../GSFramework/inc
+
+//System include paths
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+// Libraries required by framework
+LIBRARY bafl.lib
+LIBRARY euser.lib
+LIBRARY cone.lib
+LIBRARY apparc.lib
+
+//Libraries for the DLL
+LIBRARY eikcoctl.lib
+
+SOURCEPATH      .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSListBox/Src/GSListBox.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,740 @@
+/*
+* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Class declaration for CGSListboxEntry & CGSItemTextArray.
+*
+*/
+
+// INCLUDES
+#include "gslistbox.h"
+#include "gscommon.hrh"
+
+#include <eiklbx.h>
+#include <aknradiobuttonsettingpage.h>
+
+
+// CONSTANTS
+const TInt KGSListboxModelGranularity = 5;
+_LIT(KGSEngineItemArrayPanic, "GSEngItemArray");
+
+// Panic enum
+enum TGSEngineItemArrayPanic
+    {
+    EGSEngineItemArrayPanicNoRadioSettingsPage = 0,
+    };
+
+/*================================================
+*
+*   class declaration for CGSListboxEntry
+*
+*================================================*/
+
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::NewLC()
+// Symbian OS two-phased constructor
+//------------------------------------------------------------------------------
+EXPORT_C CGSListboxEntry* CGSListboxEntry::NewLC( TResourceReader& aReader )
+    {
+    CGSListboxEntry* self = new (ELeave) CGSListboxEntry;
+    CleanupStack::PushL( self );
+    self->ConstructL( aReader );
+    return self;
+    }
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::NewLC()
+// Symbian OS two-phased constructor
+//------------------------------------------------------------------------------
+EXPORT_C CGSListboxEntry* CGSListboxEntry::NewLC( TInt aFeatureId )
+    {
+    CGSListboxEntry* self = new (ELeave) CGSListboxEntry;
+    CleanupStack::PushL( self );
+    self->iFeatureId = aFeatureId;
+    return self;
+    }
+
+//------------------------------------------------
+// CGSListboxEntry::NewLC()
+// Symbian OS two-phased constructor
+//------------------------------------------------
+EXPORT_C CGSListboxEntry* CGSListboxEntry::NewLC(
+    TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId )
+    {
+    CGSListboxEntry* self = new (ELeave) CGSListboxEntry;
+    CleanupStack::PushL( self );
+    self->ConstructL( aResId, aEnv, aFeatureId );
+    return self;
+    }
+
+//------------------------------------------------
+// CGSListboxEntry::ConstructL()
+// Symbian OS 2nd phase constructor
+//------------------------------------------------
+void CGSListboxEntry::ConstructL(
+    TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId )
+    {
+    // Create resource reader
+    TResourceReader reader;
+    aEnv.CreateResourceReaderLC( reader, aResId );
+
+    // Just read, not actually needed anywhere
+    reader.ReadInt16();
+
+    // Take base settings from resources
+    iCaption = reader.ReadHBufCL();
+    iStaticTextLength = iCaption->Length();
+    iFeatureId = aFeatureId + reader.ReadInt16();
+    iType = reader.ReadInt8();
+
+    CleanupStack::PopAndDestroy(); //reader
+    }
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::ConstructL()
+// Symbian OS 2nd phase constructor
+//------------------------------------------------------------------------------
+void CGSListboxEntry::ConstructL( TResourceReader& aReader )
+    {
+    iCaption = aReader.ReadHBufCL();
+    iStaticTextLength = iCaption->Length();
+    iFeatureId = aReader.ReadInt16();
+    iType = aReader.ReadInt8();
+    }
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry()
+// c++ default constructor
+//------------------------------------------------------------------------------
+CGSListboxEntry::CGSListboxEntry()
+    {
+    }
+
+//------------------------------------------------------------------------------
+// ~CGSListboxEntry()
+// destructor
+//------------------------------------------------------------------------------
+EXPORT_C CGSListboxEntry::~CGSListboxEntry()
+    {
+    delete iCaption;
+    }
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::Feature()
+// Provides feature for the selected entry
+// @return feature
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSListboxEntry::FeatureId() const
+    {
+    return iFeatureId;
+    }
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::Caption
+// Provides caption for the selected entry
+// @return caption
+//------------------------------------------------------------------------------
+EXPORT_C const TDesC& CGSListboxEntry::Caption() const
+    {
+    return *iCaption;
+    }
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::Type
+// Provides type for the selected entry
+// @return type
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSListboxEntry::Type() const
+    {
+    return iType;
+    }
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::SetDynamicTextL
+// Appends dynamic text to the static text read
+// from the resource.
+//------------------------------------------------------------------------------
+EXPORT_C void CGSListboxEntry::SetDynamicTextL( const TDesC& aText )
+    {
+    const TInt requiredLength = StaticTextLength() + aText.Length();
+    //
+    TPtr pCaption( iCaption->Des() );
+    const TInt maxLength = pCaption.MaxLength();
+    //
+    if( requiredLength >= maxLength )
+        {
+        // Make enough room for static text + new dynamic text
+        iCaption = iCaption->ReAllocL( requiredLength );
+        }
+
+    // Have to re-get a new modifiable descriptor for the HBufC* since the
+    // memory address may have changed after the realloc.
+    pCaption.Set( iCaption->Des() );
+
+    // Set the length back to only the static part
+    pCaption.SetLength( StaticTextLength() );
+    pCaption.Append( aText );
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSListboxEntry::SetDynamicTextDoublePaneL
+// Appends dynamic text to the static text read
+// from the resource.
+//------------------------------------------------------------------------------
+EXPORT_C void CGSListboxEntry::SetDynamicTextDoublePaneL( const TDesC& aText )
+  {
+  const TInt requiredLength = StaticTextLength() + aText.Length();
+  //
+  TPtr pCaption( iCaption->Des() );
+  const TInt maxLength = pCaption.MaxLength();
+  const TInt textSize = aText.Length();
+  TInt location;
+  
+  // Here if it is the NULL string then we track of the 
+  // Default text size in iDynamicTextSize
+  if ( textSize > 0 )
+    {
+    iDynamicTextSize = textSize;
+    // this location is also preserved for the same purpose
+    location = aText.Locate( aText[0] );  
+    }
+  else
+    {
+    location = KErrNotFound;
+    }
+  //
+  if ( location == KErrNotFound )
+    {
+    // We take the value from the end of the string
+    location = pCaption.LocateReverse('\t');
+    // We then delete the string;
+    // iDynamicTextSize is the size of the "Default" text i.e. 7
+    // 1 is added bcos \tText\t\t for the last tab
+    pCaption.Delete( location - ( iDynamicTextSize + 1 ), iDynamicTextSize );
+    }
+  else
+    {
+    if( requiredLength >= maxLength )
+        {
+        // Make enough room for static text + new dynamic text
+        iCaption = iCaption->ReAllocL( requiredLength );
+        }
+
+    // Have to re-get a new modifiable descriptor for the HBufC* since the
+    // memory address may have changed after the realloc.
+    pCaption.Set( iCaption->Des() );
+    location = pCaption.LocateReverse('\t'); 
+    pCaption.Insert( ( location - 1 ), aText );  
+    }
+  }
+//... HERE IT ENDS
+/*================================================
+*
+*   class declaration for CGSItemTextArray
+*
+*================================================*/
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::NewLC()
+// Symbian OS two-phased constructor
+//------------------------------------------------------------------------------
+EXPORT_C CGSItemTextArray* CGSItemTextArray::NewL( TUint32 aResId,
+                                                   CCoeEnv& aEnv )
+    {
+    CGSItemTextArray* self =
+        new (ELeave) CGSItemTextArray( );
+    CleanupStack::PushL( self );
+    self->ConstructL( aResId, aEnv );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray()
+// constructor
+//------------------------------------------------------------------------------
+CGSItemTextArray::CGSItemTextArray()
+:    iAllEntries( KGSListboxModelGranularity ),
+    iCurrentlyDisplayedEntries( KGSListboxModelGranularity )
+    {
+    }
+
+
+//------------------------------------------------------------------------------
+// ~CGSItemTextArray()
+// destructor
+//------------------------------------------------------------------------------
+CGSItemTextArray::~CGSItemTextArray()
+    {
+    iCurrentlyDisplayedEntries.Close();
+    iAllEntries.ResetAndDestroy();
+    iAllEntries.Close();
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::ConstructL()
+// Symbian OS two-phased constructor
+//------------------------------------------------------------------------------
+void CGSItemTextArray::ConstructL( TUint32 aResId, CCoeEnv& aEnv )
+    {
+    TResourceReader reader;
+    aEnv.CreateResourceReaderLC( reader, aResId );
+    //
+    const TInt count = reader.ReadInt16();
+    for( TInt i = 0; i < count; i++ )
+        {
+        CGSListboxEntry* entry = CGSListboxEntry::NewLC( reader );
+        User::LeaveIfError( iAllEntries.Append( entry ) );
+
+        // Always visible items are added here and never removed
+        if    ( entry->Type() == EGSListBoxItemTypeIsAlwaysVisible )
+            {
+            User::LeaveIfError( iCurrentlyDisplayedEntries.Append( entry ) );
+            }
+        //
+        CleanupStack::Pop( entry );
+        }
+
+    CleanupStack::PopAndDestroy(); //reader
+    }
+
+//------------------------------------------------
+// CGSItemTextArray::ConstructL()
+// Symbian OS two-phased constructor
+//------------------------------------------------
+void CGSItemTextArray::ConstructL(
+    TUint32 aResId, CCoeEnv& aEnv, TInt aCount )
+    {
+    // Create entries and append them to entrylist.
+    for( TInt i = 0; i < aCount; i++ )
+        {
+        CGSListboxEntry* entry = CGSListboxEntry::NewLC( aResId, aEnv, i );
+        User::LeaveIfError( iAllEntries.Append( entry ) );
+        CleanupStack::Pop( entry );
+        }
+    }
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::MdcaCount()
+// from MDesCArray
+// @return count
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSItemTextArray::MdcaCount() const
+    {
+    const TInt count = iCurrentlyDisplayedEntries.Count();
+    return count;
+    }
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::MdcaPoint()
+// from MDesCArray
+// @return item text
+//------------------------------------------------------------------------------
+EXPORT_C TPtrC CGSItemTextArray::MdcaPoint( TInt aIndex ) const
+    {
+    const TPtrC ret( iCurrentlyDisplayedEntries[aIndex]->Caption() );
+    return ret;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::SetDynamicTextL()
+// Appends dynamic text to a selected listbox item
+//
+//------------------------------------------------------------------------------
+EXPORT_C void CGSItemTextArray::SetDynamicTextL( TInt aFeatureId,
+                                              const TDesC& aAdditionalText )
+    {
+    TIdentityRelation<CGSListboxEntry> relation(CompareEntries);
+    //
+    CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId );
+    const TInt index = iAllEntries.Find( entryToSearchFor, relation );
+    CleanupStack::PopAndDestroy( entryToSearchFor );
+    User::LeaveIfError( index );
+    //
+    CGSListboxEntry* entry = iAllEntries[index];
+    entry->SetDynamicTextL( aAdditionalText );
+    }
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::SetDynamicTextDoublePaneL()
+// Appends dynamic text to a selected listbox item
+//
+//------------------------------------------------------------------------------
+EXPORT_C void CGSItemTextArray::SetDynamicTextDoublePaneL( TInt aFeatureId,
+                        const TDesC& aAdditionalText )
+  {
+  TIdentityRelation<CGSListboxEntry> relation(CompareEntries);
+  //
+  CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId );
+  const TInt index = iAllEntries.Find( entryToSearchFor, relation );
+  CleanupStack::PopAndDestroy( entryToSearchFor );
+  User::LeaveIfError( index );
+  //
+  CGSListboxEntry* entry = iAllEntries[index];
+  entry->SetDynamicTextDoublePaneL( aAdditionalText );
+  }
+//*****ENDS HERE
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::SetItemVisibilityL()
+// Indicates whether an item is to be shown/hidden
+//
+//------------------------------------------------------------------------------
+EXPORT_C void CGSItemTextArray::SetItemVisibilityL( TInt aFeatureId,
+                                                 TVisibility aVisibility )
+    {
+    TIdentityRelation<CGSListboxEntry> relation( CompareEntries );
+    CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId );
+    //
+    if    ( aVisibility == EInvisible )
+        {
+        const TInt index = iCurrentlyDisplayedEntries.Find( entryToSearchFor,
+                                                      relation );
+        if    ( index != KErrNotFound )
+            {
+            // Remove the item from the currently visible items array
+            iCurrentlyDisplayedEntries.Remove( index );
+            }
+        }
+    else if ( aVisibility == EVisible )
+        {
+        // Check its not already visible
+        const TInt alreadyVisibleIndex = iCurrentlyDisplayedEntries.Find(
+                                             entryToSearchFor, relation );
+        if    ( alreadyVisibleIndex == KErrNotFound )
+            {
+            const TInt index = iAllEntries.Find( entryToSearchFor, relation );
+            User::LeaveIfError( index );
+
+            // This is the entry we are going to make visible
+            CGSListboxEntry* entry = iAllEntries[index];
+
+            // Now insert it at the correct location.
+            TBool foundInsertionPoint = EFalse;
+            const TInt currentEntriesCount = iCurrentlyDisplayedEntries.Count();
+            for( TInt allEntriesIndex=index-1; allEntriesIndex>=0 &&
+                !foundInsertionPoint; allEntriesIndex-- )
+                {
+                // We are going to try and insert the new entry after the entry
+                // specified as the previous item in the 'all entries' array,
+                // in the iCurrentlyDisplayedEntries array.
+                const TInt featureIdOfPreviousItem =
+                           iAllEntries[allEntriesIndex]->FeatureId();
+
+                for( TInt currentEntriesIndex=0; !foundInsertionPoint &&
+                    currentEntriesIndex<currentEntriesCount;
+                    currentEntriesIndex++ )
+                    {
+                    CGSListboxEntry* visibleEntry = iCurrentlyDisplayedEntries[
+                                                           currentEntriesIndex];
+                    if    ( visibleEntry->FeatureId() == featureIdOfPreviousItem )
+                        {
+                        foundInsertionPoint = ETrue;
+                        // Insert after this item
+                        User::LeaveIfError( iCurrentlyDisplayedEntries.Insert(
+                                            entry, currentEntriesIndex+1 ) );
+                        }
+                    }
+
+                }
+
+            if    (!foundInsertionPoint)
+                {
+                // Just insert the item at the top of the list
+                User::LeaveIfError(
+                    iCurrentlyDisplayedEntries.Insert( entry, 0 ) );
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy( entryToSearchFor );
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::CurrentFeature()
+// Obtains feature id for a selected listbox item (feature)
+// @return feature id
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSItemTextArray::CurrentFeature() const
+    {
+    return KErrNotFound;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::IndexForFeatureId()
+//
+// @return index
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSItemTextArray::IndexForFeatureIdL(TInt aFeatureId) const
+    {
+    TIdentityRelation<CGSListboxEntry> relation( CompareEntries );
+    CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId );
+    //
+    const TInt index = iCurrentlyDisplayedEntries.Find( entryToSearchFor,
+                                                        relation );
+    CleanupStack::PopAndDestroy( entryToSearchFor );
+    //
+    return index;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::FeatureIdByIndexL()
+//
+// @return index
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSItemTextArray::FeatureIdByIndex(TInt aIndex) const
+    {
+    TInt featureId = KErrNotFound;
+    //
+    const TInt currentEntriesCount = iCurrentlyDisplayedEntries.Count();
+    if  (aIndex >= 0 && aIndex < currentEntriesCount)
+        {
+        featureId = iCurrentlyDisplayedEntries[ aIndex ]->FeatureId();
+        }
+    //
+    return featureId;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::FeatureById()
+//
+// @return feature
+//------------------------------------------------------------------------------
+EXPORT_C const CGSListboxEntry* CGSItemTextArray::FeatureByIdL(
+                                                  TInt aFeatureId ) const
+    {
+    const CGSListboxEntry* locatedEntry = NULL;
+    //
+    TIdentityRelation<CGSListboxEntry> relation( CompareEntries );
+    CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId );
+    //
+    const TInt index = iAllEntries.Find( entryToSearchFor,
+                                         relation );
+    if    ( index != KErrNotFound )
+        {
+        locatedEntry = iAllEntries[ index ];
+        }
+    CleanupStack::PopAndDestroy( entryToSearchFor );
+    //
+    return locatedEntry;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::GetItemCaptionFromFeatureIdLC()
+//
+// @return feature's caption
+//------------------------------------------------------------------------------
+EXPORT_C HBufC* CGSItemTextArray::GetItemCaptionFromFeatureIdLC(
+                                                        TUint32 aResourceId,
+                                                        TInt aFeatureId,
+                                                        CCoeEnv& aCone )
+    {
+    HBufC* caption = NULL;
+    //
+    CGSItemTextArray* items = CGSItemTextArray::NewL( aResourceId, aCone );
+    CleanupStack::PushL( items );
+    const CGSListboxEntry* entry = items->FeatureByIdL( aFeatureId );
+    //
+    if ( entry )
+        {
+        caption = entry->Caption().AllocL();
+        }
+    else
+        {
+        caption = KNullDesC().AllocL();
+        }
+    //
+    CleanupStack::PopAndDestroy( items );
+    CleanupStack::PushL( caption );
+    return caption;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSItemTextArray::CompareEntries()
+// Compares feature id's to check if they are the same
+// @return boolean
+//------------------------------------------------------------------------------
+TBool CGSItemTextArray::CompareEntries(const CGSListboxEntry& aLeft,
+                                              const CGSListboxEntry& aRight)
+    {
+    return aLeft.FeatureId() == aRight.FeatureId();
+    }
+
+
+
+
+
+
+
+/*================================================
+*
+*   class declaration for CGSListBoxItemTextArray
+*
+*================================================*/
+
+//------------------------------------------------------------------------------
+// CGSListBoxItemTextArray::NewLC()
+// Symbian OS two-phased constructor
+//------------------------------------------------------------------------------
+EXPORT_C CGSListBoxItemTextArray* CGSListBoxItemTextArray::NewL( TUint32 aResId,
+                                                       CEikListBox& aListBox,
+                                                       CCoeEnv& aEnv )
+    {
+    CGSListBoxItemTextArray* self =
+        new (ELeave) CGSListBoxItemTextArray( aListBox );
+    CleanupStack::PushL( self );
+    self->ConstructL( aResId, aEnv );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+//------------------------------------------------
+// CGSListBoxItemTextArray::NewL()
+// Symbian OS two-phased constructor
+//------------------------------------------------
+EXPORT_C CGSListBoxItemTextArray* CGSListBoxItemTextArray::NewL(
+    TUint32 aResId, CEikListBox& aListBox, CCoeEnv& aEnv, TInt aCount )
+    {
+    CGSListBoxItemTextArray* self =
+        new (ELeave) CGSListBoxItemTextArray( aListBox );
+    CleanupStack::PushL( self );
+    self->ConstructL( aResId, aEnv, aCount );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+//------------------------------------------------------------------------------
+// CGSListBoxItemTextArray()
+// constructor
+//------------------------------------------------------------------------------
+CGSListBoxItemTextArray::CGSListBoxItemTextArray( CEikListBox& aListBox )
+:    iListBox( aListBox )
+    {
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSListBoxItemTextArray::CurrentFeature()
+//
+// Obtains feature id for a selected listbox item (feature)
+// @return feature id
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSListBoxItemTextArray::CurrentFeature() const
+    {
+    TInt featureId = KErrNotFound;
+    const TInt listBoxCurrentItemIndex = iListBox.CurrentItemIndex();
+    const TInt count = iCurrentlyDisplayedEntries.Count();
+    if    ( listBoxCurrentItemIndex >= 0 && listBoxCurrentItemIndex < count )
+        {
+        const CGSListboxEntry* entry =
+                        iCurrentlyDisplayedEntries[ listBoxCurrentItemIndex ];
+        featureId = entry->FeatureId();
+        }
+    return featureId;
+    }
+
+
+
+
+
+
+
+
+
+/*================================================
+*
+*   class declaration for CGSRadioButtonSettingPageItemTextArray
+*
+*================================================*/
+
+//------------------------------------------------------------------------------
+// CGSRadioButtonSettingPageItemTextArray::NewL()
+//
+// Symbian OS two-phased constructor
+//------------------------------------------------------------------------------
+EXPORT_C CGSRadioButtonSettingPageItemTextArray*
+         CGSRadioButtonSettingPageItemTextArray::NewL( TUint32 aResId,
+                                                       CCoeEnv& aEnv,
+                             CAknRadioButtonSettingPage* aSettingPage )
+    {
+    CGSRadioButtonSettingPageItemTextArray* self =
+        new (ELeave) CGSRadioButtonSettingPageItemTextArray( aSettingPage );
+    CleanupStack::PushL( self );
+    self->ConstructL( aResId, aEnv );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSRadioButtonSettingPageItemTextArray()
+//
+// constructor
+//------------------------------------------------------------------------------
+CGSRadioButtonSettingPageItemTextArray::CGSRadioButtonSettingPageItemTextArray (
+                                     CAknRadioButtonSettingPage* aSettingPage )
+:   iSettingPage( aSettingPage )
+    {
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSRadioButtonSettingPageItemTextArray::SetRadioButtonSettingPage()
+//
+//
+//------------------------------------------------------------------------------
+EXPORT_C void CGSRadioButtonSettingPageItemTextArray::SetRadioButtonSettingPage (
+                                     CAknRadioButtonSettingPage& aSettingPage )
+    {
+    iSettingPage = &aSettingPage;
+    }
+
+
+//------------------------------------------------------------------------------
+// CGSRadioButtonSettingPageItemTextArray::CurrentFeature()
+// Obtains feature id for a selected listbox item (feature)
+// @return feature id
+//------------------------------------------------------------------------------
+EXPORT_C TInt CGSRadioButtonSettingPageItemTextArray::CurrentFeature() const
+    {
+    __ASSERT_ALWAYS(iSettingPage, User::Panic( KGSEngineItemArrayPanic,
+                         EGSEngineItemArrayPanicNoRadioSettingsPage ) );
+
+    TInt featureId = KErrNotFound;
+
+    const TInt listBoxCurrentItemIndex =
+                         iSettingPage->ListBoxControl()->CurrentItemIndex();
+    const TInt count = iCurrentlyDisplayedEntries.Count();
+    if    ( listBoxCurrentItemIndex >= 0 && listBoxCurrentItemIndex < count )
+        {
+        const CGSListboxEntry* entry =
+                         iCurrentlyDisplayedEntries[ listBoxCurrentItemIndex ];
+        featureId = entry->FeatureId();
+        }
+    return featureId;
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSListBox/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building GSEngine.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSListBox.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gslistbox.iby )
+
+PRJ_MMPFILES
+GSListBox.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Data/102824A7.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Network Settings plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x102824A7;
+    interfaces  = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x102824A8;
+                    version_no          = 1;
+                    display_name        = "Network Settings Plugin";
+                    default_data        = "0x10207250";// Parent UID
+                    #ifdef RD_CONTROL_PANEL
+                        opaque_data         = "10"; // Order number
+                    #else //RD_CONTROL_PANEL
+                        opaque_data         = "40"; // Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+#ifdef FF_POWER_SAVE
+        ,
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x2000B189;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x2000B594;
+                    version_no         = 1;
+                    display_name       = "PSM Network Plugin";
+                    default_data       = "";
+                    opaque_data        = "";
+                    }
+                };
+            }
+#endif
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Data/2000B593.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,8 @@
+<PowerSaveModeConfig>
+	<Setting mode="1"><!-- PSM mode in power saving mode -->
+		<SetItem key="1" type="0" value="1"></SetItem>  <!--ENetworkMode-->
+	</Setting>
+	<Setting mode="2"><!-- PSM mode in partial power saving mode-->
+		<SetItem key="1" type="0" value="1"></SetItem>  <!--ENetworkMode-->
+	</Setting>
+</PowerSaveModeConfig>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Data/GsNetworkPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,582 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSNetworkPlugin
+*
+*/
+
+//  RESOURCE IDENTIFIER
+NAME    NETP // 4 letter ID
+
+//  INCLUDES
+#include     <bldvariant.hrh>
+
+#include    <gsnetworkplugin.loc>
+#include    "GsNetworkPlugin.hrh"
+
+#include    <gs.loc>
+#include    <gscommon.hrh>
+#include    <gscommon.rh>
+#include    <GSApp.rsg>
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <gsnetworkplugin.mbg>
+#include    <uikon.rh>
+
+#define KGsNetworkPluginIcons      "Z:"APP_RESOURCE_DIR"\\gsnetworkplugin.mbm"
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+RESOURCE TBUF
+    {
+    buf="NET";
+    }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+    
+//----------------------------------------------------
+//
+//    r_gs_net_plugin_icon_array
+//    Default icons used by the CGSPluginInterface.
+//
+//----------------------------------------------------
+//
+/*
+RESOURCE AKN_ICON_ARRAY r_gs_net_plugin_icon_array
+    {
+    bmpfile = KGsNetPluginIcons;
+
+    icons =
+        {
+        AKN_ICON
+            {
+            iconId = EMbmGstelpluginQgn_prop_set_network_sub;
+            maskId = EMbmGstelpluginQgn_prop_set_network_sub_mask;
+            },
+        AKN_ICON
+            {
+            iconId = EMbmGstelpluginQgn_prop_set_network_tab4;
+            maskId = EMbmGstelpluginQgn_prop_set_network_tab4_mask;
+            }
+        };
+    }
+  */
+    
+//----------------------------------------------------
+//  r_gs_net_view_caption
+//
+// Network view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_net_view_caption
+    {
+    buf = qtn_set_folder_network;
+    }
+
+
+//----------------------------------------------------
+//  r_gs_net_view_title
+//
+// Network view title
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_net_view_title
+    {
+    txt = qtn_set_title_settings_network;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_net_view
+//    Network sub-menu view
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_net_view
+    {
+    menubar=r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_net_lbx_resource
+//    Network sub-menu's listbox
+//
+//
+//----------------------------------------------------
+//
+RESOURCE LISTBOX r_net_lbx_resource
+    {
+    array_id = r_net_lbx;
+    flags = EEikListBoxMultipleSelection;
+    }
+
+//----------------------------------------------------
+//
+//    r_net_lbx
+//    Items in cellular network-folder
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_net_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_set_network_mode"\t\t";
+            item = EGSNetworkModeItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_netsl_netselect"\t\t";
+            item = EGSNetworkModeSelectionItemId;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = " \t"qtn_mcn_control"\t\t";
+            item = EGSMCNItemId;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_setting_page
+//    Setting page for Network selection mode/MCN items
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type =  EAknSetListBox;
+    editor_resource_id= r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_netsl_netselectmode
+//    Network selection mode setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_netsl_netselectmode
+    {
+    buf = qtn_netsl_netselectmode;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_netsl_netselectmode_lbx
+//    Item in Network selection setting page
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_netsl_netselectmode_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = qtn_netsl_automatic;
+            item = EGSAutomaticSelectMode;
+            },
+        GS_FEATURE
+            {
+            txt = qtn_netsl_manual;
+            item = EGSManualSelectMode;
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+// r_confirm_note_nwmode_string
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_confirm_note_nwmode_string { buf = qtn_network_mode_note; }
+
+
+//----------------------------------------------------
+//
+//    r_net_network_mode
+//    Network mode selection ui setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_net_network_mode
+    {
+    buf = qtn_set_network_mode;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_net_network_mode_lbx
+//    Network mode selection ui setting page items
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_net_network_mode_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = qtn_network_mode_dual;
+            item = EGSNetworkModeDualmode;
+            },
+        GS_FEATURE
+            {
+            txt = qtn_network_mode_umts;
+            item = EGSNetworkModeUMTS;
+            type = EGSListBoxItemTypeIsDynamic;
+            },
+        GS_FEATURE
+            {
+            txt = qtn_network_mode_gsm;
+            item = EGSNetworkModeGSM;
+            type = EGSListBoxItemTypeIsDynamic;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_netsl_foundoperators
+//    Title for found network operators
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_netsl_foundoperators
+    {
+    buf = qtn_netsl_foundoperators;
+    }
+
+//----------------------------------------------------
+//
+//      r_no_network_found
+//      Texts for note wrappers.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_no_network_found
+    {
+    buf = text_no_networks_found;
+    }
+
+//----------------------------------------------------
+//
+//      r_ongoing_call
+//      Texts for note wrappers.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_ongoing_call
+    {
+    buf = text_call_in_progress;
+    }
+
+//----------------------------------------------------
+//
+//      r_active_gprs_conn_note
+//      Texts for note wrappers.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_active_gprs_conn_note
+    {
+    buf = qtn_mcn_info_not_received;
+    }
+
+//----------------------------------------------------
+//
+//    r_searching_note
+//    Note layout when searching for network operators
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_searching_note
+    {
+    flags = EAknWaitNoteFlags|EEikDialogFlagWait;
+
+    buttons = r_softkeys_empty_quit;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = ESearchingNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = text_searching;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_home_network_selected
+//    Text when home network selected.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_home_network_selected { buf = text_hplmn_selected; }
+
+//----------------------------------------------------
+//
+//    r_network_selected,
+//    r_netsl_networkselected
+//    Note layout when non-home network selected
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_netsl_networkselected { buf = qtn_netsl_networkselected; }
+
+//----------------------------------------------------
+//
+//    r_no_network_access,
+//    Text to be used, when access to network is denied.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_no_network_access { buf = text_no_access; }
+
+//----------------------------------------------------
+//
+//    r_offline_mode,
+//    Text to be used, when nw operation tried in offline mode.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF  r_offline_mode { buf = qtn_offline_not_possible; }
+
+//----------------------------------------------------
+//
+//    r_registration_interrupted,
+//    Note layout when network registration is
+//    interrupted
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_registration_interrupted
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons | EEikDialogFlagWait;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = ENwRegistrationInterrupted;
+            control = AVKON_NOTE
+                {
+                layout = EGeneralLayout;
+                singular_label = qtn_netsl_registration_interrup;
+                animation = R_QGN_NOTE_ERROR_ANIM;
+                };
+            }
+        };
+    }
+
+
+//----------------------------------------------------
+//
+//    r_mcn_cell_info_disp_mode
+//    MCN setting page
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_mcn_cell_info_disp_mode
+    {
+    buf = qtn_mcn_control;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_mcn_cell_info_disp_mode_lbx
+//    Items in setting page - MCN
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_mcn_cell_info_disp_mode_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = qtn_mcn_sett_on;
+            item = EGSMcnSetOn;
+            },
+        GS_FEATURE
+            {
+            txt = qtn_mcn_sett_off;
+            item = EGSMcnSetOff;
+            }
+        };
+    }
+
+//----------------------------------------------------
+// Icon array for Dual mode nw selection
+//----------------------------------------------------
+//
+RESOURCE AKN_ICON_ARRAY r_net_dualmode_icons
+    {
+    bmpfile = KGsNetworkPluginIcons;
+
+    icons =
+        {
+        AKN_ICON
+            {
+            iconId = EMbmGsnetworkpluginQgn_prop_network_3g;
+            maskId = EMbmGsnetworkpluginQgn_prop_network_3g_mask;
+            },
+        AKN_ICON
+            {
+            iconId = EMbmGsnetworkpluginQgn_prop_network_2g;
+            maskId = EMbmGsnetworkpluginQgn_prop_network_2g_mask;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_softkeys_empty_quit
+//    Softkeys for requesting notes: empty-quit
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_softkeys_empty_quit
+    {
+    buttons =
+        {
+        CBA_BUTTON {txt = "";},
+        CBA_BUTTON {id = EGSSoftkeyQuit; txt = text_softkey_quit;}
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_requesting_note
+//    Note layout when requesting something from network
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_requesting_note
+    {
+    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons | EEikDialogFlagWait;
+    buttons = r_softkeys_empty_quit;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = ERequestingNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = text_sending;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+    
+// -----------------------------------------------------------------------------
+//   
+//    r_call_msk_change
+//    Middle softkey label: change.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_call_msk_change
+    {
+    buf = qtn_msk_change;
+    }
+
+// -----------------------------------------------------------------------------
+//   
+//    qtn_cp_detail_cellular_operational
+//    Network operational text in lbx item.
+//
+// -----------------------------------------------------------------------------
+//    
+/*
+RESOURCE TBUF r_cellular_operational
+    {
+    buf = qtn_cp_detail_cellular_operational;
+    }
+*/
+// -----------------------------------------------------------------------------
+//   
+//    qtn_cp_detail_cellular_offline
+//    Network off-line text in lbx item.
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF r_cellular_offline
+    {
+    buf = qtn_cp_detail_cellular_offline;
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_power_saving_protected_settings_infonote
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_power_saving_protected_settings_infonote
+    {
+    buf = qtn_power_saving_protected_settings_infonote;
+    }
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/GSNetworkPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file.
+*
+*/
+
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsnetworkplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x102824A7
+VENDORID            VID_DEFAULT
+
+
+SOURCEPATH  Src
+SOURCE      GSNetworkPluginImplementationTable.cpp
+SOURCE      GSNetworkPluginContainer.cpp
+SOURCE      GSNetworkPlugin.cpp
+SOURCE      GSNetworkPluginModel.cpp
+SOURCE      GSNetworkDebugHelper.cpp
+
+#ifdef FF_POWER_SAVE
+	SOURCE      GSNetworkPluginAO.cpp
+	SOURCE      PSMNetworkPlugin.cpp
+#endif  //#ifdef FF_POWER_SAVE
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Data
+USERINCLUDE     ../Logger
+USERINCLUDE     ../GSTelPlugin/Inc
+USERINCLUDE     ../Cenrep
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  102824A7.rss
+TARGET          gsnetworkplugin.rsc
+END
+
+START RESOURCE  GsNetworkPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   cone.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   egul.lib
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   ws32.lib
+
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   centralrepository.lib
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+
+LIBRARY   aknnotify.lib         // for CAknGlobalNote.h
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   flogger.lib // For GSLogger
+LIBRARY   gsecomplugin.lib
+LIBRARY   phonesettings.lib
+LIBRARY   apgrfx.lib
+LIBRARY   etelmm.lib
+LIBRARY   etel.lib
+LIBRARY   networkhandling.lib    //For CNWSession, TNWInfo
+#ifdef FF_POWER_SAVE
+	LIBRARY   psmclient.lib
+#endif // FF_POWER_SAVE
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkDebugHelper.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Utility class for matching network related enumerations to
+*                 descriptor.
+*
+*/
+
+
+#ifndef GSNETWORKDEBUGHELPER_H_
+#define GSNETWORKDEBUGHELPER_H_
+
+#include "GsNetworkPlugin.hrh"
+#include <e32base.h>
+#include <e32def.h>
+#include <NWHandlingEngine.h>
+#include <MPsetNetworkModeObs.h>
+#include <MPsetNetworkInfoObs.h>
+
+/**
+* Static helper class for transfering network enumerations into descriptors.
+* Pretty handy in printing debug traces from network events...
+*
+* Example (do not print in release mode!):
+* #ifdef _DEBUG
+*   TBuf<KGSNetworkModeDebugStrLen> myBuf;
+*   GSNetworkDebugHelper::XXXToDes( myEnum, aModeCaps );
+*   __GSLOGSTRING2( "%S", &aModeCaps, &myEnum );
+* #endif //_DEBUG
+*/
+class GSNetworkDebugHelper
+    {
+public:
+
+    /**
+    * Prints enum name into descriptor.
+    *
+    * @param aMode  Enumeration whose name should be used.
+    * @param buf    Descriptor indicating the enumeration name. Use
+    *               KGSNetworkModeDebugStrLen as length.
+    */
+    static void NwToDes( TGSNetworkModeItems aMode, TDes& buf );
+
+    /**
+    * Prints enum name into descriptor.
+    * From:
+    * enum RMmCustomAPI::TNetworkModeCaps
+    *    {
+    *    KCapsNetworkModeGsm = 0x01,
+    *    KCapsNetworkModeUmts = 0x02,
+    *    KCapsNetworkModeDual = 0x04
+    *    };
+    * AND KGSNetworkModeCapsNotUpdated
+    *
+    * Can be used for debugging purposes.
+    *
+    * @param aModeCaps  Enumeration whose name should be used.
+    * @param buf    Descriptor indicating the enumeration name. Use
+    *               KGSNetworkModeDebugStrLen as length.
+    */
+    static void NwCapsToDes(
+            TUint32 aModeCaps,
+            TDes& buf );
+
+    /**
+    * Prints enum name into descriptor.
+    *
+    * Example:
+    *   TBuf<KGSNetworkModeDebugStrLen> myBuf;
+    *   GSNetworkDebugHelper::NwCapsToDes( myEnum, aModeCaps );
+    *   __GSLOGSTRING2( "%S", &aModeCaps, &myEnum );
+    *
+    * @param aNetworkStatus  Enumeration whose name should be used.
+    * @param buf    Descriptor indicating the enumeration name. Use
+    *               KGSNetworkModeDebugStrLen as length.
+    *
+    */
+    static void NetworkStatusToDes(
+            TNWRegistrationStatus aNetworkStatus,
+            TDes& aDes );
+
+    /**
+    * Prints enum name into descriptor.
+    *
+    * @param aNetworkMessage  Enumeration whose name should be used.
+    * @param buf    Descriptor indicating the enumeration name. Use
+    *               KGSNetworkModeDebugStrLen as length.
+    */
+    static void NetworkMessageToDes(
+            MNWMessageObserver::TNWMessages aNetworkMessage,
+            TDes& aDes );
+
+    /**
+    * Prints enum name into descriptor.
+    *
+    * @param aNetworkOperation  Enumeration whose name should be used.
+    * @param buf    Descriptor indicating the enumeration name. Use
+    *               KGSNetworkModeDebugStrLen as length.
+    */
+    static void NetworkOperationToDes(
+            MNWMessageObserver::TNWOperation aNetworkOperation,
+            TDes& aDes );
+
+    /**
+    * Prints enum name into descriptor.
+    *
+    * @param aRequest  Enumeration whose name should be used.
+    * @param buf    Descriptor indicating the enumeration name. Use
+    *               KGSNetworkModeDebugStrLen as length.
+    */
+    static void NetworkModeRequestToDes(
+            MPsetNetworkModeObserver::TServiceRequest aRequest,
+            TDes& aDes );
+
+    /**
+    * Prints enum name into descriptor.
+    *
+    * @param aRequest  Enumeration whose name should be used.
+    * @param buf    Descriptor indicating the enumeration name. Use
+    *               KGSNetworkModeDebugStrLen as length.
+    */
+    static void NetworkInfoRequestToDes(
+            MPsetNetworkInfoObserver::TServiceRequest aRequest,
+            TDes& aDes );
+
+    };
+
+#endif /*GSNETWORKDEBUGHELPER_H_*/
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,519 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Network settings.
+*
+*/
+
+
+#ifndef GSNETWORKPLUGIN_H
+#define GSNETWORKPLUGIN_H
+
+// INCLUDES
+#include <aknsettingpage.h>
+#include <ConeResLoader.h>
+#include <gsplugininterface.h>
+#include <gsfwviewuids.h>
+#include <gsbaseview.h>
+#include <MSSSettingsRefreshObserver.h>
+#include <MPsetNetworkInfoObs.h>//for base class
+#include <etelmm.h>
+#include <msatrefreshobserver.h>
+//For listening BT SAP events
+#include <gspubsubslistener.h>
+#include <mgssettingpsobserver.h>
+#include <eikmenup.h>
+
+#include "GSPhoneSettingConstants.h"
+#include "GSNetworkPluginContainer.h"
+#include "GsNetworkPlugin.hrh"
+#include "MGsFWMSKLabelObserver.h"
+
+#include <etelmm.h>
+#include <e32base.h>
+
+#include <NWHandlingEngine.h>
+
+// CONSTANTS
+const TUid KGSNetworkPluginUid = { 0x102824A8 };
+// Resource file name
+_LIT( KGSNetworkPluginResourceFileName, "z:GSNetworkPluginRsc.rsc" );
+// Icon file name
+_LIT( KGSNetworkPluginIconDirAndName, "z:GSNetworkPlugin.mbm");
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD CLASS DECLARATION
+class CAknViewAppUi;
+class CGSNetworkPluginContainer;
+class CPsetNetwork;
+class CAknWaitDialog;
+class CPsetContainer;
+class CAknRadioButtonSettingPage;
+class CAknPopupList;
+class MSSSettingsRefreshObserver;
+class CPSetRefreshHandler;
+
+class CNWSession;
+class TNWInfo;
+class CGSParentPlugin;
+
+// CLASS DECLARATION
+/**
+*  CGSNetworkPlugin view class
+*
+*  Plugin implementation for Network settings
+*  @lib GSNetworkPlugin.lib
+*  @since Series 60_3.1
+*/
+#ifdef FF_POWER_SAVE
+    class CGSNetworkPluginAO;
+#endif // FF_POWER_SAVE
+
+class CGSNetworkPlugin : public CGSBaseView,
+                         public MPsetNetworkInfoObserver,
+                         public MSSSettingsRefreshObserver,
+                         public MGsFWMSKObserver,
+                         public MGSSettingPSObserver,
+                         public MNWMessageObserver
+    {
+    public: // Constructors and destructor
+
+        /** C++ Constructor */
+        CGSNetworkPlugin();
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS connection view.
+        */
+        static CGSNetworkPlugin* NewL( TAny* aInitParams );
+
+        static CGSNetworkPlugin* NewLC();
+
+        /**
+        * Destructor.
+        */
+        ~CGSNetworkPlugin();
+
+    public: // from base classes
+
+        /**
+        * Returns view id.
+        * @return TUid
+        */
+        TUid Id() const;
+
+        /**
+        * Handles commands.
+        * @param aCommand Command to be handled.
+        *
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * From MEikCommandObserver, handles the commands.
+        *
+        * @param aCommand identifies the command given.
+        */
+        void ProcessCommandL( TInt aCommand );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+         * @see CGSPluginInterface header file.
+         */
+         void GetValue( const TGSPluginValueKeys aKey,
+                        TDes& aValue );
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    public: //new
+
+        /**
+        * Get CGSNetworkPlugin's ccontainer.
+        */
+        CGSNetworkPluginContainer* Container();
+
+        /**
+        * Checks if the MSK label needs to be adjusted.
+        */
+        void CheckMiddleSoftkeyLabelL();
+
+                /**
+        * Remove command and label from MSK.
+        */
+        void RemoveCommandFromMSK( const TBool flag);
+
+        /**
+        * Adds given resource text as MSK to CBA.
+        *
+        * @param aResourceId middle softkey label.
+        * @param aCommandId command that should be performed when MSK
+        *        is pressed.
+        * @since S60 v3.1
+        */
+        void SetMiddleSoftKeyLabelL( const TInt aResourceId,const TInt aCommandId );
+
+        /**
+        * Shows a requested note.
+        * @param aResourceId reource ID for note text
+        * @param aType type of note
+        */
+        void ShowNoteL( TInt aResourceId, TInt aType );
+
+    public: // from base class MPsetNetworkInfoObserver
+
+        /**
+        * @@see MPsetNetworkInfoObserver::HandleNetworkInfoReceivedL
+        */
+        void HandleNetworkInfoReceivedL(
+            const CNetworkInfoArray* aInfoArray, const TInt aResult );
+
+        /**
+        * @@see MPsetNetworkInfoObserver::HandleCurrentNetworkInfoL - not used
+        */
+        inline void HandleCurrentNetworkInfoL(
+            const MPsetNetworkSelect::TCurrentNetworkInfo& /* aCurrentInfo */,
+            const TInt /* aResult */ ) {}
+
+        /**
+        * DEPRECATED in MPsetNetworkInfoObserver.
+        *
+        * @@see MPsetNetworkInfoObserver::HandleNetworkChangedL
+        */
+        void HandleNetworkChangedL(
+            const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo,
+            const MPsetNetworkSelect::TCurrentNetworkStatus aStatus,
+            const TInt aResult );
+
+        /**
+        * @@see MPsetNetworkInfoObserver::HandleNetworkChangedL
+        */
+        void HandleNetworkChangedL(
+            const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo,
+            const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus,
+            const TInt aResult );
+
+
+        /**
+        * @@see MPsetNetworkInfoObserver::HandleSearchingNetworksL
+        */
+        void HandleSearchingNetworksL( TServiceRequest aRequest );
+
+        /**
+        * @@see MPsetNetworkInfoObserver::HandleRequestingSelectedNetworkL
+        */
+        void HandleRequestingSelectedNetworkL( TBool aOngoing );
+
+        /**
+        * @@see MPsetNetworkInfoObserver::HandleCallActivatedL
+        */
+        void HandleCallActivatedL();
+
+        /**
+        * @@see MPsetNetworkInfoObserver::HandleNetworkErrorL
+        */
+        void HandleNetworkErrorL( const TServiceRequest aRequest,
+            const TInt aError );
+
+    public: //from base class MSSSettingsRefreshObserver
+        /**
+        * @@see MSSSettingsRefreshObserver::AllowRefresh
+        */
+        TBool AllowRefresh(
+            const TSatRefreshType aType,
+            const TSatElementaryFiles aFiles );
+
+        /**
+        * @@see MSSSettingsRefreshObserver::Refresh
+        */
+        void Refresh(
+            const TSatRefreshType aType,
+            const TSatElementaryFiles aFiles );
+
+    public: // From MNWMessageObserver
+
+        /**
+        * Offers message interface to the client
+        * @param aMessage
+        * This methods execute time must be short,since code
+        * starting to run from RunL.
+        *
+        * Function updates data into iNWInfo.
+        */
+        void HandleNetworkMessage( const TNWMessages aMessage );
+
+        /**
+        * Offers error message interface to the client
+        * @param aOperation operation which failed
+        * @param aErrorCode returned Symbian OS error code
+        *
+        */
+        void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode );
+
+        /**
+        * Updates network setting page in case it is visible. This is needed in
+        * case network mode is change while setting page is oppen.
+        */
+        void UpdateNetworkSettingPageL();
+    public:
+#ifdef FF_POWER_SAVE
+        /*
+         * Update network plugin view when PSM mode has changed
+         */
+        void UpdateOnPsmChanged();
+#endif
+        
+    protected: // From CAknView
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        void DoDeactivate();
+
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+/*        CGSNetworkPlugin();*/
+
+        /**
+        * Symbian OS default constructor.
+        *
+        */
+        void ConstructL();
+
+        void HandleClientRectChange();
+
+    private: // from CGSBaseView
+
+        void NewContainerL();
+        void HandleListBoxSelectionL();
+
+    private: // From MGSSettingPSObserver
+        /**
+        * Callback from MGSSettingPSObserver
+        */
+        void HandleNotifyPSL( const TUid aUid, const TInt& aKey,
+                              const TRequestStatus& aStatus );
+
+    private: //new methods
+
+        /**
+        * Check if calls are active. Show note if Nw-menu is tried to open.
+        * @param aItemId list item ID in network view
+        */
+        void CheckCallActiveL( TGSNetworkItemIds aItemId );
+
+        /**
+        * Provides the network operator list.
+        */
+        void NetworkListL();
+
+        /**
+        * Displays setting page for highlighted setting.
+        *
+        * @param aPage identifies the page that will be displayed.
+        */
+        void ShowSettingPageL( TGSNetworkItemIds aPage );
+
+        /**
+        * Sets title to a popup list.
+        * @param aList pointer to list
+        * @param aTitleID resource ID of the title
+        */
+        void SetTitleToPopupL( CAknPopupList& aList, TInt aTitleID );
+
+        /**
+        * Adds item to a list.
+        * @param aList pointer to a list
+        * @param aItem resource ID of the item to be added
+        */
+        void AppendItemL( CDesCArrayFlat& aList, TInt aItem );
+
+        /**
+        * Sets title to a settings page.
+        * @param aDlg setting page
+        * @param aTitleID resource ID of the title
+        */
+        void SetTitleToSettingsL( CAknRadioButtonSettingPage& aDlg,
+            TInt aTitleID );
+
+        /**
+        * Shows a note if GPRS is active, when MCN is turned on.
+        * @param aCurrentItem value of setting currently
+        */
+        void CheckGPRSConnectionL( TInt aCurrentItem );
+
+        /**
+        * Switches between shared data and setting page values (0 > 1, 1 > 0).
+        * @param aValue value to switch
+        */
+        void SwitchOnOffValue( TInt& aValue );
+
+        /**
+        * Makes a Network/MCN Ss operation.
+        * @param aIndex currently active list item.
+        * @param aPage which setting page is open
+        */
+        void CreateNetworkSsCallL( TInt aIndex, TGSNetworkItemIds aPage );
+
+        /**
+        * Creates a waiting note (member variable).
+        * @param aDelayOff is the note shown immediately or not
+        */
+        void CheckAndCreateDlgL( TBool aDelayOff );
+
+        /**
+        * Empties fetched network provider's list.
+        */
+        void PurgeNetworkList();
+
+        /**
+        * Updates listbox in container
+        */
+        void UpdateListBoxL( const TInt& aListItem, const TInt aValue = -1 );
+
+        /**
+        * Activate the Phone Idle view.
+        */
+        void PhoneIdle();
+
+        /**
+        * To verify if the phone is in the offline mode. (or mostly if mode is supported???)
+        */
+        TBool IsPhoneOfflineL() const;
+
+        /**
+        * Actually checks from telephone server cached data (iNWInfo) if phone
+        * is online.
+        *
+        * @return ETrue if phone is online.
+        */
+        TBool PhoneOnline();
+
+        /**
+        * Updates iNetworkText from the iNWInfo values.
+        */
+        void UpdateNetworkTextL();
+
+        /**
+        * Easy access to parent plugin. Casts view from AppUI.
+        */
+        CGSParentPlugin* Parent();
+
+        /**
+        *  Convert TInt to TGSNetworkModeItems.
+        *  Will panic in case TInt is of wrong value.
+        */
+        TGSNetworkModeItems CGSNetworkPlugin::IntToEnum( TInt aFeatureId );
+
+        /**
+        * Closes dialog (iSettingDlg) if it is open. 
+        */
+        void CloseDialog();
+        
+#ifdef FF_POWER_SAVE    
+        /**
+         *  Displays blocking note. Used if PSM is on.
+         */
+        void DisplayBlockNoteL();
+#endif // FF_POWER_SAVE
+        
+    public: //enumerations
+
+        enum TGSNetworkList
+            {
+            EAutomaticMode,
+            EManualMode
+            };
+
+    protected:
+
+        // for load wait dialog
+        CAknWaitDialog* iWaitDialog;
+
+    private:
+
+        //Requesting note
+        CAknWaitDialog*         iDlg;
+        //PhoneSettings container
+        CPsetContainer*         iSettingsContainer;
+        //PhoneSettings engine object
+        CPsetNetwork*           iPhoneSettingsEngine;
+        //Array of networks
+        CNetworkInfoArray*      iNetworkArray;
+        //Network selection list
+        CAknPopupList*          iNetworkPopupList;
+        //Setting page
+        CAknRadioButtonSettingPage* iSettingDlg;
+        //Value of MCN setting item
+        TInt                    iMCN;
+        //Has the user selected a valid network
+        TBool                   iApprovedNetwork;
+        //PhoneSettings refresh handler
+        CPSetRefreshHandler*    iPSRefreshHandler;
+        //Previous network selection state
+        TBool                   iPreviousState;
+        // check if which command MSK is set during destruction
+        TBool                   iMskCommandFlag;
+        //PubSub object for BT SAP state
+        CGSPubSubsListener*     iBtSapListener;
+        TBool                   iSearchForNetworksActive;
+
+        // Session to network handling engine. Owned.
+        CNWSession* iNWSession;
+
+        // Cached network info structure. Will be updated by iNWSession in a
+        // callback.
+        TNWInfo iNWInfo;
+
+        // Cached network text read by GetValue(). When network handling engine
+        // updates data, this buffer is re-created accordingly.
+        HBufC* iNetworkText;
+#ifdef FF_POWER_SAVE
+        // Active object for handling PSM realted CenRep events.
+        CGSNetworkPluginAO* iPsmActive;
+#endif // FF_POWER_SAVE
+
+    };
+
+#endif // GSNETWORKPLUGIN_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginAO.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Active object for handling PSM related CenRep changes.
+*
+*/
+
+
+#ifndef GSNETWORKPLUGINAO_H
+#define GSNETWORKPLUGINAO_H
+
+// INCLUDES
+#include <psmtypes.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD CLASS DECLARATION
+
+// CLASS DECLARATION
+
+/**
+*  CGSNetworkPluginAO. Acts as a CenRep observer for PSM related state 
+*  changes.
+*
+*  @lib GSNetworkPlugin.lib
+*  @since Series 60_5.1
+*/
+class CRepository;
+class CGSNetworkPlugin;
+
+class CGSNetworkPluginAO : public CActive
+    {
+    public:
+    
+        static CGSNetworkPluginAO* NewL();
+        ~CGSNetworkPluginAO();
+    
+        /**
+         * Set view which should be updated when PSM mode changes.
+         */
+        void SetView( CGSNetworkPlugin* aNetworkPluginView );
+        
+        /**
+         * @return PSM mode. See TPsmsrvMode.
+         */
+        TInt Mode() const;
+        
+    protected: // From CActive
+
+        void DoCancel();
+        void RunL();
+        TInt RunError( TInt aError );
+        
+    private:
+
+        CGSNetworkPluginAO();
+        void ConstructL();
+
+    private: // Data
+        
+        CRepository* iPsmRepository;
+        TInt iPsmMode;
+        CGSNetworkPlugin* iNetworkPluginView;
+    };
+
+
+#endif // GSNETWORKPLUGINAO_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Network sub-folder
+*
+*/
+
+
+#ifndef GSNETWORKPLUGINCONTAINER_H
+#define GSNETWORKPLUGINCONTAINER_H
+
+// INCLUDES
+#include "GSNetworkPluginModel.h"
+#include "GsNetworkPlugin.hrh"
+#include "GSPhoneSettingConstants.h"  //for GS & PS constants
+#include <bldvariant.hrh>
+#include <gsbasecontainer.h>
+#include <MPsetNetworkModeObs.h>
+#include "MGsFWMSKLabelObserver.h"
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CPsetNetwork;
+class MEikListBoxObserver;
+class CGSListBoxItemTextArray;
+class CGSRadioButtonSettingPageItemTextArray;
+class CPsetContainer;
+class CGSNetworkPluginModel;
+class CGSNetworkPlugin;
+
+// CLASS DECLARATION
+
+/**
+*  GSNetworkPluginContainer container class
+*
+*  container class for Device settings view
+*  @lib GSNetworkPlugin.lib
+*  @since Series 60_3.1
+*/
+class CGSNetworkPluginContainer : public CGSBaseContainer
+    {
+    public:
+        enum {
+            ENetFirstBit = 1,
+            ENetSecondBit = 2
+            };
+
+    public: // Constructors and destructor
+
+
+        /** C++ Constructor */
+        CGSNetworkPluginContainer( CGSNetworkPlugin* aPlugin );
+
+        /**
+        * Symbian OS constructor.
+        * @param aRect Listbox's rect.
+        *
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CGSNetworkPluginContainer();
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @since Series 60_3.1
+        * @param aItemId An item which is updated.
+        */
+        void UpdateListBoxL( TInt aItemId, TInt aValue );
+
+        /**
+        * Retrieves the currently selected listbox feature id
+        * @since Series 60_3.1
+        * @return feature id.
+        */
+
+        TInt CurrentFeatureId() const;
+       /**
+        * Gets currently active network selection mode.
+        * @return currently active network selection mode
+        */
+        TInt GetSelectionMode();
+
+        /**
+        *  Gets Mcn value from model.
+        *  @param aMcnValue MCN value read from shared data.
+        */
+        void GetMcnValue( TInt &aMcnValue );
+
+        /**
+        *  Sets MCN value to model.
+        *  @param aMcnValue MCN value written to shared data.
+        */
+        void SetMcnValue( TInt &aMcnValue );
+
+        /**
+        * Trims non-supported variable options from the array
+        * This array items are displayed as radio button setting page items
+        *
+        * @param aItemArray array contents to trim from
+        */
+        void CheckAndAlterContentsL( CGSRadioButtonSettingPageItemTextArray&
+                                    aItemArray );
+
+        /**
+        * return the model pointer
+        */
+        CGSNetworkPluginModel* NetPluginModel();
+
+        /**
+        * Defines observer for the middle softkey label changes.
+        * Can only be set once. Further attempts are ignored.
+        * @since S60 v3.1
+        */
+        void SetMiddleSoftkeyObserver( MGsFWMSKObserver* aObserver );
+
+        /**
+        * OfferKeyEvent to this Call Container class for updating the label
+        * Up and Down rocker keys are handled
+        * @since S60 v3.1
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                     TEventCode aType );
+
+        /**
+        * Callback from model.
+        */
+        void HandleNetworkModeChangeL();
+
+        /**
+        * Returns the current selection of network mode. Note! network
+        * selection can be unknow in case network is slow and actual data
+        * has not yet been received...
+        * @return current network selection.
+        */
+        TGSNetworkModeItems GetCurrentNetworkModeSelectionL();
+
+        /**
+        * Sets the current selection of network mode
+        * @param aNetworkMode current selection
+        */
+        void SetCurrentNetworkModeSelectionL(
+                TGSNetworkModeItems aNetworkModeLbxItem );
+
+    protected: // from CGSBaseContainer
+        /**
+        * Creates list box.
+        *
+        * @param aResLbxId is resource number to create
+        */
+        void ConstructListBoxL( TInt aResLbxId );
+
+        /**
+        * Required for help.
+        *
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+
+    private: //new
+
+        /**
+        * Creates list box items.
+        */
+        void CreateListBoxItemsL();
+
+        /**
+        * Creates Network list box item.
+        * @param aValue value of setting item.
+        */
+        void MakeNwItemL( TInt aValue = -1 );
+
+        /**
+        * Creates MCN list box item.
+        */
+        void MakeMcnItemL();
+
+        /**
+        * Creates Network mode UI list box item.
+        */
+        void MakeNwModeUiItemL();
+
+    private: // Member variables
+
+        // Resource based features
+        CGSListBoxItemTextArray* iListboxItemArray;
+
+        // CGSNetworkPluginModel is the model class of Network plugin.
+        CGSNetworkPluginModel*   iModel;
+
+        // Currently active network item in listbox.
+        TGSNetworkModeItems iSelectedNetworkModeLbxItem;
+
+        /**
+        * Middle softkey label observer.
+        * Own.
+        */
+        MGsFWMSKObserver* iMSKObserver;
+
+        /**
+        * Reference to container's owner. Not owned.
+        */
+        CGSNetworkPlugin* iPlugin;
+
+    };
+
+#endif //GSNETWORKPLUGINCONTAINER_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,280 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Network Settings model.
+*
+*/
+
+
+#ifndef GSNETWORKPLUGINMODEL_H
+#define GSNETWORKPLUGINMODEL_H
+
+#include <e32base.h>
+#include <e32property.h>
+#include <centralrepository.h>
+#include <PsetCSP.h>
+#include <MPsetNetworkModeObs.h>
+#include <PsetNetwork.h>
+
+#include "GSNetworkPluginContainer.h"
+#include "GsNetworkPlugin.hrh"
+
+// CONSTANTS
+
+const TUint32 KGSNetworkModeCapsNotUpdated = KMaxTUint32;
+
+// Used only for debugging. Init value for network mode debug strings.
+const TInt KGSNetworkModeDebugStrLen = 50;
+
+
+// Panic codes for used in this compilation unit
+enum TGSTelPluginModelPanicCodes
+    {
+    EGSTelPluinModelPanicNullPtr = 1
+    };
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class MPsetNetworkModeObserver;
+class CPsetContainer;
+class CGSNetworkPluginContainer;
+class CGSNetworkPlugin;
+
+// CLASS DEFINITION
+/**
+*  CGSNetworkPluginModel is the model class of GS network plugin.
+*  It provides functions to get and set setting values.
+*  @lib GSNetworkPlugin.lib
+*  @since Series 60_3.1
+
+*/
+class CGSNetworkPluginModel : public CBase,
+                              private MPsetNetworkModeObserver
+    {
+    public:  // Constructor and destructor
+
+        /**
+         * Overloaded constructor meant to be used from container
+         */
+        static CGSNetworkPluginModel* NewL(
+                CGSNetworkPluginContainer* aContainer,
+                CGSNetworkPlugin* aPlugin );
+
+        /**
+        * Destructor
+        */
+        ~CGSNetworkPluginModel();
+
+    public: // new ones
+        /**
+        * Gets CSP status
+        *
+        * @return ETrue: CSP is set
+        *         EFalse: CSP is not set
+        */
+        TBool GetCSPStatus();
+
+        /**
+        * Sets CSP Active
+        * @param aValue TBool
+        * @return ETrue: CSP is set
+        *         EFalse: CSP is not set
+        */
+        void SetCSPActiveL( TBool aValue );
+
+         /**
+        * Get the network mode status from Shared data. This value is used
+        * to display/hide the "network mode UI" list item under network
+        * folder. Currently, this value is ONLY read and not written.
+        * @return ETrue if the value is 1 in SD.
+        */
+        TBool IsNetworkModeVisible();
+
+        /**
+        * Returns if CSP setting is supported
+        * @param aSettingNumber TInt
+        * @return ETrue: CSP is supported
+        *         EFalse: CSP is not supported
+        */
+        TBool IsSettingSupported( TInt aSettingNumber );
+
+                /*
+        * Returns MCN value from shared data.
+        * @param aId value of shared data key
+        * @return ETrue: no errors
+        *         EFalse: an error has occurred
+        */
+        TBool GetMCNSettingValue( TInt& aId );
+
+        /*
+        * Sets MCN value to shared data.
+        * @param aId value of shared data key
+        * @return ETrue: no errors
+        *         EFalse: an error has occurred
+        */
+        TBool SetMCNSettingValue( TInt& aId );
+
+        /*
+        * Gets the supported network mode list from shared data.
+        * @return the bit-masked value from shared data
+        */
+        TInt GetSupportedNetworksL();
+
+        /**
+        * Check if graphical network list is supported.
+        * This is handled using GS local variation
+        * @return ETrue if supported.
+        */
+        TBool GraphicalNetworkListSupportedL();
+
+        /**
+        * Return local variation value for automatic network search
+        * support. Local key = EGSConfigNoAutoToAutoNetworkSearch
+        * See GeneralSettingsVariant.hrh for details
+        * @return local variation value
+        */
+        TBool AutomaticNetworkSearchSupportedL();
+
+
+        /**
+        *  Creates phone settings engine.
+        *  @param aContainer Container object as reference
+        */
+        void CreatePhoneSettingsEngineL();
+
+        /**
+        * StartAsynGetCurrentNetworkModeSelectionL 
+        */
+        void StartAsynGetCurrentNetworkModeSelectionL();     
+        
+        /**
+        * GetNetworkSelectionMode
+        */
+        MPsetNetworkSelect::TSelectMode GetNetworkSelectionMode();
+
+        /**
+        * See iNetworkMode.
+        * @return TUint32 Current network mode value,  RMmCustomAPI::KCapsNetworkModeUmts etc...
+        */
+        TUint32 GetNetworkMode();
+        
+        /**
+        * SetNetworkModeL 
+        */
+        void SetNetworkModeL( TUint32 aNetworkMode );
+
+        /**
+        * Prints model state to debug output in case of debug build.
+        */
+        void PrintState();
+
+        /**
+        * Used only in debug mode: verifies network state with the UI selection.
+        * For debugging purposes only.
+        */
+        void CheckState( TGSNetworkModeItems aMode );
+
+
+
+
+        TBool IsCallActive();
+
+    private: // Private constructors
+
+        /**
+        * Default C++ contructor
+        */
+        CGSNetworkPluginModel( CGSNetworkPluginContainer* aContainer,
+                               CGSNetworkPlugin* aPlugin );
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+
+        void ConstructBaseItemsL();
+
+        /**
+        * Initialize CenRep keys used in this class
+        */
+        void InitializeCentralRepositoryL();
+
+        /**
+        * Un-initialize CenRep keys used in this class
+        */
+        void UninitializeCentralRepository();
+
+    private: // from base class MPsetNetworkModeObserver
+
+        /**
+        * @@see MPsetNetworkModeObserver::HandleNetworkSystemModeEventsL.
+        * @since 2.6
+        */
+        void HandleNetworkSystemModeEventsL(
+            const MPsetNetworkModeObserver::TServiceRequest aRequest,
+            const TUint32 aNetworkModeCaps );
+
+
+        /**
+        * @@see MPsetNetworkModeObserver::HandleNetworkErrorL.
+        * @since 2.6
+        */
+        void HandleNetworkErrorL(
+            const MPsetNetworkModeObserver::TServiceRequest aRequest,
+            const TInt aError );
+
+    private:
+        // Central repository objects
+        CRepository* iNetworkRepository;
+        CRepository* iGSVariationRepository;
+  		CPsetCustomerServiceProfile* iCSP; //check if CSP is active
+  		TInt iLocalVariationValues; //local variated constants
+
+        // PhoneSettings engine object for network mode
+        CPsetNetwork* iPhoneSettingsEngine;
+        CPsetContainer* iSettingsContainer;
+
+        // Current network mode value from RMmCustomAPI::TNetworkModeCaps.
+        // enum RMmCustomAPI::TNetworkModeCaps
+        //    {
+        //    KkNetworkModeGsm = 0x01,
+        //    KCapsNetworkModeUmts = 0x02,
+        //    KCapsNetworkModeDual = 0x04
+        //    };
+        // and in addition: KGSNetworkModeCapsNotUpdated
+        //
+        // Stores value aNetworkModeCaps from:
+        // MPsetNetworkModeObserver::HandleNetworkSystemModeEventsL(..., TUint32 aNetworkModeCaps )
+        //
+        TUint32 iNetworkMode;
+        
+        // Temporarily value of the requested network mode. Stores requested 
+        // mode which is updated to iNetworkMode in case request succeeds and 
+        // HandleNetworkSystemModeEventsL is called.  
+        TUint32 iRequestedNetworkMode;
+
+        // Pointer for communicating with container. Not owned.
+        CGSNetworkPluginContainer* iContainer;
+
+        // Reference to network plugin. Not owned.
+        CGSNetworkPlugin* iPlugin;
+    };
+
+#endif //GSNETWORKPLUGINMODEL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GsNetworkPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains common definitions for menu id:s
+*
+*/
+
+
+#ifndef GSNETWORKPLUGIN_HRH
+#define GSNETWORKPLUGIN_HRH
+
+// commands
+// Network view's list items.
+enum TGSNetworkItemIds
+    {
+    EGSNetworkModeItemId,
+    EGSNetworkModeSelectionItemId,
+    EGSMCNItemId
+    };
+
+// Network mode selection setting page items
+enum TGSNetworkModeItems
+    {
+    EGSNetworkModeDualmode,
+    EGSNetworkModeUMTS,
+    EGSNetworkModeGSM
+    };
+
+// Network selection setting page items
+enum TGSNetworkSelectionModeItems
+    {
+    EGSAutomaticSelectMode,
+    EGSManualSelectMode
+    };
+
+// Cell Info Display setting page items
+enum TGSMcnModeItems
+    {
+    EGSMcnSetOn,
+    EGSMcnSetOff
+    };
+
+enum TGSTelNotes
+    {
+    ECWActivateNote = 1,
+    ECWCancelNote,
+    ECWNotActiveNote,
+    ERequestCancelledNote,
+    ERequestingNote,
+    EAlsDisabledNote,
+    EAlsEnabledNote,
+    ECBActiveNote,
+    EPasswordErrorNote,
+    EPasswordChangedNote,
+    ECBNotActiveNote,
+    ESearchingNote,
+    ENoNetworksFoundNote,
+    ECallInProgress,
+    EHomeNetworksSelectedNote,
+    ENetworkSelectedNote,
+    ENoNetworkAccessNote,
+    ENwRegistrationInterrupted,
+    ECugIndexErrorNote,
+    EImageLoadWaitNote
+    };
+
+enum TGSSoftKeys
+    {
+    EGSSoftkeyQuit = 1,
+    EGSSoftkeyEmpty
+    };
+
+enum TGSCustomerServiceGroups
+    {
+    EGSCSPCallForward = 1,
+    EGSCSPCallBarring,
+    EGSCSPCallWaiting,
+    EGSCSPAlternateLine,
+    EGSCSPManualNetworkSelection,
+    EGSCenRepSoftReject
+    };
+
+#endif //  GSNETWORKPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/MGsFWMSKLabelObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Indicates that MSK label might be in need of update.
+*
+*/
+
+
+#ifndef M_GSFWMSKLABELOBSERVER_H
+#define M_GSFWMSKLABELOBSERVER_H
+
+/**
+ *  Observer interface to enable observer to verify currently displayed
+ *  middle softkey label. The inherited method should be called when
+ *  the middle softkey label is in need of updating after a navigation
+ *  event has been detected.
+ *  @since S60 v3.1
+ */
+class MGsFWMSKObserver
+    {
+
+public:
+
+    /**
+     * Observer interface to verify currently displayed middle softkey label.
+     */
+    IMPORT_C virtual void CheckMiddleSoftkeyLabelL() = 0;
+
+    };
+
+
+#endif // M_GSFWMSKLABELOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef PSMNETWORKPLUGIN_H
+#define PSMNETWORKPLUGIN_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <psmpluginbase.h> //CPsmPluginBase
+
+class CGSNetworkPluginModel;
+
+/**
+*  PSMNetwork plugin stub
+*
+*  @lib ?library
+*  @since Series 60_5.1
+*/
+class CPSMNetworkPlugin : public CPsmPluginBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+		* @return The created object.
+        */
+        static CPSMNetworkPlugin* NewL( TPsmPluginCTorParams& initParams );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPSMNetworkPlugin();
+
+    public:
+
+        // From CPsmPluginBase
+        void NotifyModeChange( const TInt aMode );
+
+	private:
+
+	    CPSMNetworkPlugin( TPsmPluginCTorParams& aInitParams );
+	    void ConstructL();
+
+        /**
+        *  Internal leaving function calleb from non-leaving NotifyModeChange.
+        */
+        void DoModeChangeL( const TInt aMode );
+        
+        /**
+        * To verify if the phone is in the offline mode. (or mostly if mode is supported???)
+        */
+        TBool IsPhoneOfflineL() const;
+        
+    private: // data
+
+        CGSNetworkPluginModel *iModel;        //data model
+
+    };
+
+#endif // PSMNETWORKPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkDebugHelper.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,356 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Static utility class for transfering network enums to
+*                 descriptor.
+*
+*/
+
+
+#include "GSNetworkDebugHelper.h"
+#include "GSNetworkPluginModel.h"
+
+
+// ---------------------------------------------------------------------------
+// GSNetworkDebugHelper::NwToDes
+//
+// ---------------------------------------------------------------------------
+void GSNetworkDebugHelper::NwToDes( TGSNetworkModeItems aMode, TDes& aDes )
+    {
+    switch( aMode )
+        {
+        case EGSNetworkModeDualmode:
+            _LIT( KGSDesModeDual, "EGSNetworkModeDualmode (%d)");
+            aDes.Format( KGSDesModeDual, aMode );
+            break;
+        case EGSNetworkModeUMTS:
+            _LIT( KGSDesModeUMTS, "EGSNetworkModeUMTS (%d)");
+            aDes.Format( KGSDesModeUMTS, aMode );
+            break;
+        case EGSNetworkModeGSM:
+            _LIT( KGSDesModeGSM, "EGSNetworkModeGSM (%d)");
+            aDes.Format( KGSDesModeGSM, aMode );
+            break;
+        default:
+            _LIT( KGSDesCapsUnknown, "Unknown mode (%d)!!!");
+            aDes.Format( KGSDesCapsUnknown, aMode );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// GSNetworkDebugHelper::NwCapsToDes
+//
+// ---------------------------------------------------------------------------
+void GSNetworkDebugHelper::NwCapsToDes( TUint32 aMode, TDes& aDes )
+    {
+    switch( aMode )
+        {
+        case RMmCustomAPI::KCapsNetworkModeGsm:
+            _LIT( KGSDesCapsModeDual, "RMmCustomAPI::KCapsNetworkModeGsm (%d)");
+            aDes.Format( KGSDesCapsModeDual, aMode );
+            break;
+        case RMmCustomAPI::KCapsNetworkModeUmts:
+            _LIT( KGSDesCapsModeUMTS, "RMmCustomAPI::KCapsNetworkModeUmts (%d)");
+            aDes.Format( KGSDesCapsModeUMTS, aMode );
+            break;
+        case RMmCustomAPI::KCapsNetworkModeDual:
+            _LIT( KGSDesCapsModeGSM, "RMmCustomAPI::KCapsNetworkModeDual (%d)");
+            aDes.Format( KGSDesCapsModeGSM, aMode );
+            break;
+        case KGSNetworkModeCapsNotUpdated:
+            _LIT( KGSDesCapsModeNotUpdated, "KGSNetworkModeCapsNotUpdated (%d)");
+            aDes.Format( KGSDesCapsModeNotUpdated, aMode );
+            break;
+        default:
+            _LIT( KGSDesCapsUnknown, "Unknown mode (%d)!!!");
+            aDes.Format( KGSDesCapsUnknown, aMode );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// GSNetworkDebugHelper::NetworkStatusToDes
+//
+// ---------------------------------------------------------------------------
+void GSNetworkDebugHelper::NetworkStatusToDes(
+        TNWRegistrationStatus aNetworkStatus,
+        TDes& aDes )
+    {
+    switch( aNetworkStatus )
+        {
+        case ENWRegistrationUnknown:
+            _LIT( KGSDes1, "ENWRegistrationUnknown (%d)");
+            aDes.Format( KGSDes1, aNetworkStatus );
+            break;
+        case ENWNotRegisteredNoService:
+            _LIT( KGSDes2, "ENWNotRegisteredNoService (%d)");
+            aDes.Format( KGSDes2, aNetworkStatus );
+            break;
+        case ENWNotRegisteredEmergencyOnly:
+            _LIT( KGSDes3, "ENWNotRegisteredEmergencyOnly (%d)");
+            aDes.Format( KGSDes3, aNetworkStatus );
+            break;
+        case ENWNotRegisteredSearching:
+            _LIT( KGSDes4, "ENWNotRegisteredSearching (%d)");
+            aDes.Format( KGSDes4, aNetworkStatus );
+            break;
+        case ENWRegisteredBusy:
+            _LIT( KGSDes5, "ENWRegisteredBusy (%d)");
+            aDes.Format( KGSDes5, aNetworkStatus );
+            break;
+        case ENWRegisteredOnHomeNetwork:
+            _LIT( KGSDes6, "ENWRegisteredOnHomeNetwork (%d)");
+            aDes.Format( KGSDes6, aNetworkStatus );
+            break;
+        case ENWRegistrationDenied:
+            _LIT( KGSDes7, "ENWRegistrationDenied (%d)");
+            aDes.Format( KGSDes7, aNetworkStatus );
+            break;
+        case ENWRegisteredRoaming:
+            _LIT( KGSDes8, "ENWRegisteredRoaming (%d)");
+            aDes.Format( KGSDes8, aNetworkStatus );
+            break;
+
+        default:
+            _LIT( KGSDes, "Unknown status (%d)!!!");
+            aDes.Format( KGSDes, aNetworkStatus );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// GSNetworkDebugHelper::NetworkMessageToDes
+//
+// ---------------------------------------------------------------------------
+void GSNetworkDebugHelper::NetworkMessageToDes(
+        MNWMessageObserver::TNWMessages aNetworkMessage,
+        TDes& aDes )
+    {
+    switch( aNetworkMessage )
+        {
+        case MNWMessageObserver::ENWMessageNetworkInfoChange:
+            _LIT( KGSDes1, "ENWMessageNetworkInfoChange (%d)");
+            aDes.Format( KGSDes1, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageNetworkModeChange:
+            _LIT( KGSDes2, "ENWMessageNetworkModeChange (%d)");
+            aDes.Format( KGSDes2, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange:
+            _LIT( KGSDes3, "ENWMessageNetworkRegistrationStatusChange (%d)");
+            aDes.Format( KGSDes3, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageProgrammableOperatorInfoChange:
+            _LIT( KGSDes4, "ENWMessageProgrammableOperatorInfoChange (%d)");
+            aDes.Format( KGSDes4, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageNetworkProviderNameChange:
+            _LIT( KGSDes5, "ENWMessageNetworkProviderNameChange (%d)");
+            aDes.Format( KGSDes5, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageServiceProviderNameChange:
+            _LIT( KGSDes6, "ENWMessageServiceProviderNameChange (%d)");
+            aDes.Format( KGSDes6, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageProgrammableOperatorInfoUpdating:
+            _LIT( KGSDes7, "ENWMessageProgrammableOperatorInfoUpdating (%d)");
+            aDes.Format( KGSDes7, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageNetworkProviderNameUpdating:
+            _LIT( KGSDes8, "ENWMessageNetworkProviderNameUpdating (%d)");
+            aDes.Format( KGSDes8, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageServiceProviderNameUpdating:
+            _LIT( KGSDes9, "ENWMessageServiceProviderNameUpdating (%d)");
+            aDes.Format( KGSDes9, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageAllowRefresh:
+            _LIT( KGSDes10, "ENWMessageAllowRefresh (%d)");
+            aDes.Format( KGSDes10, aNetworkMessage );
+            break;
+#ifdef RD_PHONE_NG
+        case MNWMessageObserver::ENWMessageNetworkSelectionSettingChange:
+            _LIT( KGSDes11, "ENWMessageNetworkSelectionSettingChange (%d)");
+            aDes.Format( KGSDes11, aNetworkMessage );
+            break;
+#endif // RD_PHONE_NG
+        case MNWMessageObserver::ENWMessageNetworkCellReselection:
+            _LIT( KGSDes12, "ENWMessageNetworkCellReselection (%d)");
+            aDes.Format( KGSDes12, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageNetworkConnectionFailure:
+            _LIT( KGSDes13, "ENWMessageNetworkConnectionFailure (%d)");
+            aDes.Format( KGSDes13, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageCurrentCellInfoMessage:
+            _LIT( KGSDes14, "ENWMessageCurrentCellInfoMessage (%d)");
+            aDes.Format( KGSDes14, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageCurrentHomeZoneMessage:
+            _LIT( KGSDes15, "ENWMessageCurrentHomeZoneMessage (%d)");
+            aDes.Format( KGSDes15, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageNetworkIndicatorChange:
+            _LIT( KGSDes16, "ENWMessageNetworkIndicatorChange (%d)");
+            aDes.Format( KGSDes16, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageNetworkEmergencyMode:
+            _LIT( KGSDes17, "ENWMessageNetworkEmergencyMode (%d)");
+            aDes.Format( KGSDes17, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageStartSystemSearchRequestCompleteOk:
+            _LIT( KGSDes18, "ENWMessageStartSystemSearchRequestCompleteOk (%d)");
+            aDes.Format( KGSDes18, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageStartSystemSearchRequestCompleteFail:
+            _LIT( KGSDes19, "ENWMessageStartSystemSearchRequestCompleteFail (%d)");
+            aDes.Format( KGSDes19, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteOk:
+            _LIT( KGSDes20, "ENWMessageStopProtocolStackRequestCompleteOk (%d)");
+            aDes.Format( KGSDes20, aNetworkMessage );
+            break;
+        case MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteFail:
+            _LIT( KGSDes21, "ENWMessageStopProtocolStackRequestCompleteFail (%d)");
+            aDes.Format( KGSDes21, aNetworkMessage );
+            break;
+        default:
+            _LIT( KGSDes, "Unknown message (%d)!!!");
+            aDes.Format( KGSDes, aNetworkMessage );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// GSNetworkDebugHelper::NetworkOperationToDes
+//
+// ---------------------------------------------------------------------------
+void GSNetworkDebugHelper::NetworkOperationToDes(
+        MNWMessageObserver::TNWOperation aNetworkOperation,
+        TDes& aDes )
+    {
+    switch( aNetworkOperation )
+        {
+        case MNWMessageObserver::ENWNone:
+            _LIT( KGSDes1, "ENWNone (%d)");
+            aDes.Format( KGSDes1, aNetworkOperation );
+            break;
+
+        case MNWMessageObserver::ENWGetServiceProviderName:
+            _LIT( KGSDes2, "ENWGetServiceProviderName (%d)");
+            aDes.Format( KGSDes2, aNetworkOperation );
+            break;
+        case MNWMessageObserver::ENWGetNetworkProviderName:
+            _LIT( KGSDes3, "ENWGetNetworkProviderName (%d)");
+            aDes.Format( KGSDes3, aNetworkOperation );
+            break;
+        case MNWMessageObserver::ENWGetProgrammableOperatorName:
+            _LIT( KGSDes4, "ENWGetProgrammableOperatorName (%d)");
+            aDes.Format( KGSDes4, aNetworkOperation );
+            break;
+        default:
+            _LIT( KGSDes, "Unknown operation (%d)!!!");
+            aDes.Format( KGSDes, aNetworkOperation );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// GSNetworkDebugHelper::NetworkModeRequestToDes
+//
+// ---------------------------------------------------------------------------
+void GSNetworkDebugHelper::NetworkModeRequestToDes(
+        MPsetNetworkModeObserver::TServiceRequest aRequest,
+        TDes& aDes )
+    {
+    switch( aRequest )
+            {
+            case MPsetNetworkModeObserver::EServiceRequestNone:
+                _LIT( KGSDes1, "EServiceRequestNone (%d)");
+                aDes.Format( KGSDes1, aRequest );
+                break;
+
+            case MPsetNetworkModeObserver::EServiceRequestSetSelectedNetworkMode:
+                _LIT( KGSDes2, "EServiceRequestSetSelectedNetworkMode (%d)");
+                aDes.Format( KGSDes2, aRequest );
+                break;
+            case MPsetNetworkModeObserver::EServiceRequestGetCurrentNetworkMode:
+                _LIT( KGSDes3, "EServiceRequestGetCurrentNetworkMode (%d)");
+                aDes.Format( KGSDes3, aRequest );
+                break;
+            default:
+                _LIT( KGSDes, "Unknown request (%d)!!!");
+                aDes.Format( KGSDes, aRequest );
+                break;
+            }
+    }
+
+
+// ---------------------------------------------------------------------------
+// GSNetworkDebugHelper::NetworkInfoRequestToDes
+//
+// ---------------------------------------------------------------------------
+void GSNetworkDebugHelper::NetworkInfoRequestToDes(
+        MPsetNetworkInfoObserver::TServiceRequest aRequest,
+        TDes& aDes )
+    {
+    switch( aRequest )
+            {
+            case MPsetNetworkInfoObserver::EServiceRequestNone:
+                _LIT( KGSDes1, "EServiceRequestNone (%d)");
+                aDes.Format( KGSDes1, aRequest );
+                break;
+            case MPsetNetworkInfoObserver::EServiceRequestEnumerateNetworks:
+                _LIT( KGSDes2, "EServiceRequestEnumerateNetworks (%d)");
+                aDes.Format( KGSDes2, aRequest );
+                break;
+            case MPsetNetworkInfoObserver::EServiceRequestGetNetworkInfo:
+                _LIT( KGSDes3, "EServiceRequestGetNetworkInfo (%d)");
+                aDes.Format( KGSDes3, aRequest );
+                break;
+            case MPsetNetworkInfoObserver::EServiceRequestGetCurrentNetworkInfo:
+                _LIT( KGSDes4, "EServiceRequestGetCurrentNetworkInfo (%d)");
+                aDes.Format( KGSDes4, aRequest );
+                break;
+            case MPsetNetworkInfoObserver::EServiceRequestGetNetworkSearchMode:
+                _LIT( KGSDes5, "EServiceRequestGetNetworkSearchMode (%d)");
+                aDes.Format( KGSDes5, aRequest );
+                break;
+            case MPsetNetworkInfoObserver::EServiceRequestSetNetwork:
+                _LIT( KGSDes6, "EServiceRequestSetNetwork (%d)");
+                aDes.Format( KGSDes6, aRequest );
+                break;
+            case MPsetNetworkInfoObserver::EServiceRequestSetNetworkMode:
+                _LIT( KGSDes7, "EServiceRequestSetNetworkMode (%d)");
+                aDes.Format( KGSDes7, aRequest );
+                break;
+            case MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic:
+                _LIT( KGSDes8, "EServiceRequestSetNetworkAutomatic (%d)");
+                aDes.Format( KGSDes8, aRequest );
+                break;
+            default:
+                _LIT( KGSDes, "Unknown request (%d)!!!");
+                aDes.Format( KGSDes, aRequest );
+                break;
+            }
+    }
+
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1913 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Call submenu in General Settings.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSNetworkPlugin.h"         //for CGSCallPlugin
+#include "GSNetworkPluginContainer.h"    //for CGSCallPluginContainer
+#include "GsLogger.h"
+#include "GSNetworkPlugin.h"             //for pluginUID
+
+#include <coeaui.h>
+#include <hlplch.h>                     // For HlpLauncher
+
+//AVKON headers
+#include <aknnotewrappers.h>            //for Note Wrappers
+#include <aknPopup.h>                   //for Popup menus
+#include <aknradiobuttonsettingpage.h>  //for Radio Button Setting Pages
+#include <aknViewAppUi.h>               //for viewappui
+#include <AknWaitDialog.h>              //for CAknWaitDialog
+#include <AknIconArray.h>               //for AknIconArray
+#include <StringLoader.h>               //for StringLoader
+#include <apparc.h>
+
+#include <gscommon.hrh>
+
+//Phonesettings and TSY headers
+#include <PsetContainer.h>              //for CPsetContainer
+#include <PsetNetwork.h>                //for CPsetNetwork
+#include <PsetSAObserver.h>             //for CPsetSAObserver
+#include <gsmerror.h>                   //for GSM-specific error messages
+#include <exterror.h>
+#include <featmgr.h>
+#include <MSSSettingsRefreshObserver.h> //for SAT refresh
+#include <gslistbox.h>                  //for radiobutton class
+
+#include <e32property.h>
+#include <PSVariables.h>
+
+#include <GsNetworkPluginRsc.rsg>           //for resource IDs
+#include <gsfwviewuids.h>
+#include <gslistbox.h>                  //for CGSListBoxItemTextArray
+
+#include <e32property.h>
+#include <PSVariables.h>
+#include <gsprivatepluginproviderids.h>
+#include <gsnetworkplugin.mbg>
+#include <BTSapInternalPSKeys.h>
+#include <CoreApplicationUIsSDKCRKeys.h> // KCRUidCoreApplicationUIs, TCoreAppUIsNetworkConnectionAllowed
+#include <activeidle2domainpskeys.h>
+
+#include <CNWSession.h>
+#include <NetworkHandlingProxy.h>
+#include <gsparentplugin.h>
+#include "GSNetworkDebugHelper.h"
+
+#ifdef FF_POWER_SAVE
+    #include "GSNetworkPluginAO.h"
+#endif // FF_POWER_SAVE
+
+// LOCAL CONSTANTS
+_LIT( KGSNetWCDMAIcon, "0\t" );
+_LIT( KGSNetGSMIcon, "1\t" );
+_LIT( KEmptyStr, "" );
+
+// Warning disabled as this constant is used inside __ASSERT_DEBUG
+#pragma diag_suppress 177
+_LIT( KGSNetworkPluginAssertName, "CGSNetworkPlugin" );
+
+
+// Middle Softkey control ID.
+const TInt KGSMSKControlID = 3;
+
+const TInt KGSNetIconAdditionalChars = 5;
+
+
+// ========================= MEMBER FUNCTIONS ================================
+// ---------------------------------------------------------------------------
+//
+// Constructor.
+//
+// ---------------------------------------------------------------------------
+CGSNetworkPlugin::CGSNetworkPlugin()
+    :iMskCommandFlag( ETrue ) , iPsmActive( NULL )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two-phased constructor (second phase)
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::ConstructL()
+    {
+    __GSLOGSTRING("[CGSNetworkPlugin]--> CGSNetworkPlugin::ConstructL");
+    FeatureManager::InitializeLibL();
+    OpenLocalizedResourceFileL( KGSNetworkPluginResourceFileName,
+                                iResourceLoader );
+
+    //PS listener initialization
+    iBtSapListener = CGSPubSubsListener::NewL(
+                     KPSUidBluetoothSapConnectionState,
+                     KBTSapConnectionState, this );
+
+    BaseConstructL( R_GS_NET_VIEW );
+
+    iSettingsContainer = CPsetContainer::NewL();
+    iPSRefreshHandler = iSettingsContainer->CreateRefreshHandlerL();
+    iPSRefreshHandler->NotifyFileChangeL(
+            *this,
+            KCspEf,
+            EFileChangeNotification );
+    iPhoneSettingsEngine = iSettingsContainer->CreateNetworkObjectL( *this );
+    iApprovedNetwork = EFalse;
+    CheckAndCreateDlgL( EFalse );
+    iSearchForNetworksActive = EFalse;
+
+    iNetworkText = HBufC::NewL( KNWShortNameLength );
+    UpdateNetworkTextL();
+    
+#ifdef FF_POWER_SAVE    
+    iPsmActive = CGSNetworkPluginAO::NewL();
+    iPsmActive->SetView( this );
+#endif // FF_POWER_SAVE   
+
+    __GSLOGSTRING("[CGSNetworkPlugin] <--CGSNetworkPlugin::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two-phased constructor (first phase)
+//
+// ---------------------------------------------------------------------------
+CGSNetworkPlugin* CGSNetworkPlugin::NewLC()
+    {
+    CGSNetworkPlugin* self = new ( ELeave ) CGSNetworkPlugin;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSNetworkPlugin* CGSNetworkPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSNetworkPlugin* self = new ( ELeave ) CGSNetworkPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Destructor
+//
+// ---------------------------------------------------------------------------
+CGSNetworkPlugin::~CGSNetworkPlugin()
+    {
+    __GSLOGSTRING("[CGSNetworkPlugin] ~CGSNetworkPlugin()|->");
+    FeatureManager::UnInitializeLib();
+
+    if( iNWSession )
+        {
+        delete iNWSession;
+        iNWSession = NULL;
+        }
+    if ( iBtSapListener )
+        {
+        delete iBtSapListener;
+        iBtSapListener = NULL;
+        }
+
+    if ( iPhoneSettingsEngine )
+        {
+        if( iSearchForNetworksActive )
+            {
+            //Reset back to previously used network
+            iPhoneSettingsEngine->ResetNetworkSearch();
+            }
+        delete iPhoneSettingsEngine;
+        iPhoneSettingsEngine = NULL;
+        }
+
+    if ( iNetworkArray )
+        {
+        iNetworkArray->Reset();
+        delete iNetworkArray;
+        iNetworkArray = NULL;
+        }
+
+    if ( iDlg )
+        {
+        delete iDlg;
+        iDlg = NULL;
+        }
+    if ( iNetworkPopupList )
+        {
+        iNetworkPopupList->CancelPopup();
+        }
+
+    CloseDialog();
+    
+    //Cancel any outstanding SAT notifications
+    if ( iPSRefreshHandler )
+        {
+        iPSRefreshHandler->CancelNotify();
+        delete iPSRefreshHandler;
+        iPSRefreshHandler = NULL;
+        }
+
+    if( iSettingsContainer )
+        {
+        delete iSettingsContainer;
+        iSettingsContainer = NULL;
+        }
+
+    delete iNetworkText;
+    iNetworkText = NULL;
+    
+#ifdef FF_POWER_SAVE
+    delete iPsmActive;
+    iPsmActive = NULL;
+#endif // FF_POWER_SAVE
+
+    __GSLOGSTRING("[CGSNetworkPlugin] ~CGSNetworkPlugin()-|");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Returns Id of the Network submenu
+//
+// ---------------------------------------------------------------------------
+TUid CGSNetworkPlugin::Id() const
+    {
+    return KGSNetworkPluginUid;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPlugin::Visible
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSNetworkPlugin::Visible() const
+    {
+    TBool result( EFalse );
+    TInt value = 0;
+    iBtSapListener->Get( value );
+    if ( value == EBTSapNotConnected || value == EBTSapConnecting )
+        {
+        result = ETrue;
+        }
+    else
+        {
+        result = EFalse;
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Handles network info
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleNetworkInfoReceivedL(
+        const CNetworkInfoArray* aInfoArray, const TInt /* aResult */ )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleNetworkInfoReceivedL");
+    const TInt itemsCount = aInfoArray->Count();
+
+    //first delete old ones
+    iNetworkArray->Delete( 0, iNetworkArray->Count() );
+
+    //then insert found networks
+    for ( TInt i = 0; i < itemsCount; i++ )
+        {
+        MPsetNetworkSelect::TNetworkInfo info = aInfoArray->At( i );
+        iNetworkArray->InsertL( i, info );
+        }
+    NetworkListL(); //after search complete, show results
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleNetworkInfoReceivedL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates list of Network providers
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::NetworkListL()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::NetworkListL");
+
+    //check if the graphical list is needed... set in local variation
+    TBool showGraphicalList =
+        Container()->NetPluginModel()->GraphicalNetworkListSupportedL();
+    __GSLOGSTRING1("[GS]    NetworkListL: showGraphicalList: %d", showGraphicalList);
+
+    //if no net items were found, do not show list
+    if ( iNetworkArray->Count() > 0 )
+        {
+        while ( !iApprovedNetwork )
+            {
+            AknPopupListEmpty<CEikFormattedCellListBox>* list;
+            if ( showGraphicalList &&
+                 FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) )
+                {
+                list = new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox;
+                }
+            else
+                {
+                list = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
+                }
+
+            CleanupStack::PushL( list );
+            if ( iNetworkPopupList )
+                {
+                iNetworkPopupList->CancelPopup();
+                iNetworkPopupList = NULL;
+                }
+            iNetworkPopupList =
+                CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL );
+
+            list->ConstructL( iNetworkPopupList,
+                              CEikListBox::ELeftDownInViewRect );
+            list->CreateScrollBarFrameL( ETrue );
+            list->ScrollBarFrame()->SetScrollBarVisibilityL(
+                CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+
+            //Fill in the list texts
+            CDesCArrayFlat* items =
+                new ( ELeave ) CDesCArrayFlat( KGSNetPopupMenuItems );
+            CleanupStack::PushL( items );
+            const TInt itemsCount = iNetworkArray->Count();
+            __GSLOGSTRING1("[GS]    NetworkListL: itemsCount: %d", itemsCount);
+
+            for ( TInt loop = 0; loop < itemsCount; loop++ )
+                {
+                HBufC* insertString =
+                    HBufC::NewLC(
+                        KGSNwLongNameLength + KGSNetIconAdditionalChars );
+                MPsetNetworkSelect::TNetworkInfo info =
+                    iNetworkArray->At( loop );
+
+                if ( info.iLongName.Length() <= 0 ||
+                     info.iLongName.Length() > KGSNwLongNameLength )
+                    {
+                    //no names received, use IDs
+                    if ( info.iShortName.Length() <= 0 ||
+                        info.iShortName.Length() > KGSNwShortNameLength )
+                        {
+                        TNetworkID ids;
+                        TNetworkID networkCode;
+                        ids = info.iId.iCountryCode;
+                        ids.Append( KGSEmptySpace );
+                        networkCode = info.iId.iNetworkCode;
+                        ids.Append( networkCode );
+                        insertString->Des().Append( ids );
+                        __GSLOGSTRING1("[GS]    NetworkListL: Network ID: %S", insertString);
+                        }
+                    //short name received
+                    else
+                        {
+                        insertString->Des().Append( info.iShortName );
+                        __GSLOGSTRING1("[GS]    NetworkListL: Network Shortname: %S", insertString);
+                        }
+                    }
+                //long name received
+                else
+                    {
+                    insertString->Des().Append( info.iLongName );
+                    __GSLOGSTRING1("[GS]    NetworkListL: Network Longname: %S", insertString);
+                    }
+
+                //set icon for network
+                if ( showGraphicalList )
+                    {
+                    if ( FeatureManager::FeatureSupported(
+                                                  KFeatureIdProtocolWcdma ) )
+                        {
+                        if ( info.iAccess !=
+                             MPsetNetworkSelect::ENetNetworkGSM )
+                            {
+                            insertString->Des().Insert( 0, KGSNetWCDMAIcon );
+                            }
+                        else
+                            {
+                            insertString->Des().Insert( 0, KGSNetGSMIcon );
+                            }
+                        }
+                    }
+                items->AppendL( *insertString );
+                CleanupStack::PopAndDestroy();
+                }
+
+            // For Testing purpuses ONLY
+            for ( TInt k=0; k<items->Count(); k++ )
+                {
+                TPtrC itemText( (*items)[k] );
+                __GSLOGSTRING2("[GS]    NetworkListL: POS: %d, VALUE: %S", k, &itemText);
+                }
+
+            CTextListBoxModel* model = list->Model();
+            model->SetItemTextArray( items );
+            model->SetOwnershipType( ELbmOwnsItemArray );
+            CleanupStack::Pop( items ); //listbox model now owns this
+
+            //Set title for list
+            SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS );
+
+            // Setup graphic items list for dual mode nw selection listbox
+            // based on the local variation
+            if ( showGraphicalList )
+                {
+                CAknIconArray* iconList = new (ELeave) CAknIconArray( 10 );
+                CleanupStack::PushL( iconList );
+                iconList->ConstructFromResourceL( R_NET_DUALMODE_ICONS );
+                list->ItemDrawer()->ColumnData()->SetIconArray( iconList );
+                CleanupStack::Pop( iconList ); //listbox model now owns this
+                }
+
+            TInt res = 0;
+            if( items->Count() )
+                {
+                res = iNetworkPopupList->ExecuteLD();
+                }
+            iNetworkPopupList = NULL;
+
+            iApprovedNetwork = ETrue; //not perhaps, but user might want to quit
+            TInt selection = list->CurrentItemIndex();
+            __GSLOGSTRING1("[GS]    NetworkListL: selection: %d", selection);
+
+            CleanupStack::PopAndDestroy( list );
+
+            if ( res )
+                {
+                MPsetNetworkSelect::TNetworkInfo info =
+                    iNetworkArray->At( selection );
+                info.iMode = MPsetNetworkSelect::ENetSelectModeManual;
+                iPhoneSettingsEngine->SelectNetworkL( info );
+                }
+            else // user selected "Cancel"
+                {
+                //Reset back to previously used network
+                iPhoneSettingsEngine->ResetNetworkSearch();
+                //After list has been used, clear it.
+                PurgeNetworkList();
+                if ( iPhoneSettingsEngine->IsCallActive() !=
+                     CPsetSAObserver::EPSetCallActive )
+                    {
+                    ShowSettingPageL( EGSNetworkModeSelectionItemId );
+                    }
+                }
+            }
+        }
+    iApprovedNetwork = EFalse; //initialize before new search
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::NetworkListL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Handles requests to change network
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleNetworkChangedL(
+    const MPsetNetworkSelect::TNetworkInfo& /*aCurrentInfo*/,
+    const MPsetNetworkSelect::TCurrentNetworkStatus /*aStatus*/,
+    const TInt /*aResult*/ )
+    {
+    //DEPRECATED
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Handles requests to change network
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleNetworkChangedL(
+    const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo,
+    const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus,
+    const TInt /* aResult */ )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleNetworkChangedL");
+    switch ( aStatus )
+        {
+        case RMobilePhone::ERegisteredOnHomeNetwork:
+            ShowNoteL( R_HOME_NETWORK_SELECTED, KGSConfirmationNote );
+            PurgeNetworkList();
+            break;
+        case RMobilePhone::ERegisteredRoaming:
+            {
+            HBufC* stringholder;
+            if ( aCurrentInfo.iLongName.Length() > 0 &&
+                aCurrentInfo.iLongName.Length() <=
+                MPsetNetworkSelect::ENetLongNameSize )
+                {
+                stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED,
+                                                     aCurrentInfo.iLongName );
+                }
+            else if (aCurrentInfo.iShortName.Length() > 0 &&
+                aCurrentInfo.iShortName.Length() <=
+                MPsetNetworkSelect::ENetShortNameSize )
+                {
+                stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED,
+                                                     aCurrentInfo.iShortName );
+                }
+            else //network returned only ids
+                {
+                // construct whole "id-string"
+                // e.g. for Finland Nokia's test network "244 7"
+                TNetworkID ids;
+                TNetworkID networkCode;
+                ids = aCurrentInfo.iId.iCountryCode;
+                __GSLOGSTRING1("[GS]    HandleNetworkChangedL: iCountryCode: %S", &aCurrentInfo.iId.iCountryCode);
+
+                ids.Append( KGSEmptySpace );
+                networkCode = aCurrentInfo.iId.iNetworkCode;
+                __GSLOGSTRING1("[GS]    HandleNetworkChangedL: iNetworkCode: %S", &aCurrentInfo.iId.iNetworkCode);
+
+                ids.Append( networkCode );
+                stringholder =
+                    StringLoader::LoadLC( R_NETSL_NETWORKSELECTED, ids );
+                }
+            CAknConfirmationNote* note = new ( ELeave ) CAknConfirmationNote( ETrue );
+            note->ExecuteLD( *stringholder );
+            CleanupStack::PopAndDestroy( stringholder );
+            //After list has been used, clear it.
+            PurgeNetworkList();
+            break;
+            }
+        case RMobilePhone::ERegistrationUnknown:
+        case RMobilePhone::ENotRegisteredNoService:
+        case RMobilePhone::ENotRegisteredEmergencyOnly:
+        case RMobilePhone::ENotRegisteredSearching:
+        case RMobilePhone::ERegisteredBusy:
+        case RMobilePhone::ERegistrationDenied:
+        default:
+            break;
+        }
+    PhoneIdle();
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleNetworkChangedL");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Handles user inputs in Options menu
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleCommandL( TInt aCommand )
+    {
+    __GSLOGSTRING1("[CGSNetworkPlugin] HandleCommandL(%d)|->", aCommand );
+    switch ( aCommand )
+        {
+        case EGSMSKCmdAppChange:
+             HandleListBoxSelectionL();
+             break;
+        case EGSCmdAppChange:
+            {
+            const TInt currentFeatureId = Container()->CurrentFeatureId();
+
+            if ( currentFeatureId == EGSMCNItemId )
+                {
+                ShowSettingPageL( EGSMCNItemId );
+                }
+            else if ( currentFeatureId == EGSNetworkModeItemId )
+                {
+                CheckCallActiveL( EGSNetworkModeItemId );
+                }
+            else
+                {
+                HandleListBoxEventL( NULL, EEventEnterKeyPressed );
+                }
+            }
+            break;
+        case EAknSoftkeyBack:
+            {
+            if (!iPhoneSettingsEngine->IsActive())
+                {
+                iAppUi->ActivateLocalViewL( KGSConPluginUid /*KGSTelPluginUid*/ );                
+                }
+            break;
+            }
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    __GSLOGSTRING("[CGSNetworkPlugin] HandleCommandL()-|");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Handles user inputs in Options menu
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::ProcessCommandL( TInt aCommand )
+    {
+    // Network base class
+    CAknView::ProcessCommandL( aCommand );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// While request to find networks is processed
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleSearchingNetworksL(
+                         MPsetNetworkInfoObserver::TServiceRequest aRequest )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleSearchingNetworksL");
+    if ( !iNetworkArray )
+        {
+        iNetworkArray = new ( ELeave )
+            CNetworkInfoArray( KGSNetworkInfoArrayGranularity );
+        }
+
+    if ( aRequest != MPsetNetworkInfoObserver::EServiceRequestNone )
+        {
+        CheckAndCreateDlgL( EFalse );
+        if ( aRequest ==
+             MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic )
+            {
+            UpdateListBoxL( EGSNetworkModeSelectionItemId,
+                            EGSAutomaticSelectMode );
+            }
+        else
+            {
+            UpdateListBoxL( EGSNetworkModeSelectionItemId,
+                            EGSManualSelectMode );
+            }
+
+        iSearchForNetworksActive = ETrue;
+        TInt res = iDlg->ExecuteLD( R_SEARCHING_NOTE );
+
+        if ( res == EGSSoftkeyQuit )
+            {
+            iPhoneSettingsEngine->CancelProcess();
+            
+            ShowSettingPageL( EGSNetworkModeSelectionItemId );
+            }
+        else
+            {
+            if ( aRequest ==
+                 MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic )
+                {
+                PhoneIdle();
+                iAppUi->HandleCommandL( EEikCmdExit );
+                }
+            }
+        }
+    else
+        {
+        delete iDlg;
+        iDlg = NULL;
+        }
+
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleSearchingNetworksL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// While request to change network is processed, a note is shown
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleRequestingSelectedNetworkL( TBool aOngoing )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleRequestingSelectedNetworkL");
+    if ( aOngoing )
+        {
+        CheckAndCreateDlgL( ETrue );
+
+        if ( iDlg->ExecuteLD( R_REQUESTING_NOTE ) == EGSSoftkeyQuit )
+            {
+            iPhoneSettingsEngine->CancelProcess();
+
+            CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog(
+                CAknNoteDialog::EConfirmationTone,
+                CAknNoteDialog::EShortTimeout );
+            dlg->ExecuteLD( R_REGISTRATION_INTERRUPTED );
+            iApprovedNetwork = EFalse;
+            }
+        }
+    else
+        {
+        delete iDlg;
+        iDlg = NULL;
+        }
+
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleRequestingSelectedNetworkL");
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Activates the view
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::DoActivateL( const TVwsViewId&  aPrevViewId ,
+                                       TUid  aCustomMessageId,
+                                       const TDesC8&  aCustomMessage  )
+    {
+    __GSLOGSTRING( "[CGSNetworkPlugin] DoActivateL()|->" );
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+    Container()->SetMiddleSoftkeyObserver( this );
+    SetMiddleSoftKeyLabelL( R_CALL_MSK_CHANGE, EGSMSKCmdAppChange );
+    // This way we set which command is set for MSK
+    iMskCommandFlag = ETrue;
+    iContainer->iListBox->SetTopItemIndex( iTopItemIndex );
+
+    if ( iCurrentItem >= 0 &&
+         iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() )
+        {
+        iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem );
+        }
+    if ( aCustomMessageId == TUid::Uid( KGSCustomActivateNetView ) )
+       {
+       UpdateListBoxL( EGSNetworkModeSelectionItemId, EGSManualSelectMode );
+       iSearchForNetworksActive = ETrue;
+       iPhoneSettingsEngine->GetAvailableNetworksL();
+       }
+    CheckMiddleSoftkeyLabelL();
+    __GSLOGSTRING( "[CGSNetworkPlugin] DoActivateL()-|" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Deactivates the view
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING("[CGSNetworkPlugin]--> DoDeactivate");
+    if ( Container() )
+        {
+        if ( Container()->iListBox && iContainer->iListBox->View() )
+            {
+            iTopItemIndex = iContainer->iListBox->TopItemIndex();
+            iCurrentItem = iContainer->iListBox->CurrentItemIndex();
+            }
+        iAppUi->RemoveFromViewStack( *this, Container() );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    __GSLOGSTRING("[CGSNetworkPlugin] <--DoDeactivate");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Shows setting page - for ON/OFF setting items
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::ShowSettingPageL( TGSNetworkItemIds aPage )
+    {
+    __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL]" );
+    TInt resourceId = 0;
+    TInt currentItem = KGSSettingOff;
+    HBufC* settingPageTitle = NULL;
+
+    switch( aPage )
+        {
+        case EGSNetworkModeSelectionItemId:
+            resourceId = R_NETSL_NETSELECTMODE_LBX;
+            settingPageTitle = StringLoader::LoadLC( R_NETSL_NETSELECTMODE );
+            currentItem = Container()->GetSelectionMode();
+            break;
+        case EGSMCNItemId:
+            resourceId = R_MCN_CELL_INFO_DISP_MODE_LBX;
+            settingPageTitle = StringLoader::LoadLC( R_MCN_CELL_INFO_DISP_MODE );
+            Container()->GetMcnValue( iMCN );
+            //for MCN, values need to be switched since Off = 0 in shared data, 1 on screen
+            SwitchOnOffValue( iMCN );
+            currentItem = iMCN;
+            break;
+        case EGSNetworkModeItemId:
+            resourceId = R_NET_NETWORK_MODE_LBX;
+            settingPageTitle = StringLoader::LoadLC( R_NET_NETWORK_MODE );
+            currentItem = Container()->GetCurrentNetworkModeSelectionL();
+            break;
+        default:
+            break;
+        }
+
+    
+
+    //Checking if the phone is in offline mode
+    const TBool iOfflineMode = IsPhoneOfflineL();
+
+    // If it is in offline mode, then we dont launch the NW mode setting page at all
+    if (  iOfflineMode /*&& aPage == EGSNetworkModeItemId*/ )
+        {
+        HBufC* string = StringLoader::LoadLC( R_OFFLINE_MODE );
+        CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue );
+        note->ExecuteLD( *string );
+        CleanupStack::PopAndDestroy( string );
+        }
+    else // if not offline mode we show the setting page
+        {
+        
+        CGSRadioButtonSettingPageItemTextArray* itemArray =
+                CGSRadioButtonSettingPageItemTextArray::NewL( resourceId, *iCoeEnv, NULL );
+
+        // network mode requires special handling as items in the settings page
+        // are variated. The method below checks which items to display & hide.
+        if ( aPage == EGSNetworkModeItemId )
+            {
+            Container()->CheckAndAlterContentsL( *itemArray );
+            }
+
+        CleanupStack::PushL( itemArray );
+
+        TInt currentIndex = itemArray->IndexForFeatureIdL( currentItem );
+
+        // no editor resource given
+        iSettingDlg = new ( ELeave ) CAknRadioButtonSettingPage(
+                settingPageTitle, EAknSettingPageNoOrdinalDisplayed, 0, 0,
+                R_SETTING_PAGE, currentIndex, itemArray );
+        itemArray->SetRadioButtonSettingPage( *iSettingDlg );
+
+        const TInt prevSelection = currentIndex;
+
+        iSettingDlg->SetSettingTextL( *settingPageTitle );
+
+        //Start listening if call occurs
+        iPhoneSettingsEngine->SetNetSAObserver( *this );
+        
+        __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL] Executing dialog" );
+        const TInt res =
+            iSettingDlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+        __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL] Dialog closed" );
+        iSettingDlg = NULL;
+        // Get the feature id corresponding to array index
+        const TGSNetworkModeItems currentFeature = IntToEnum( currentIndex );
+
+        if ( res )
+            {
+            //not required for network mode UI item.
+            //other items require calling this method.
+            if ( aPage != EGSNetworkModeItemId )
+                {
+                CreateNetworkSsCallL( currentFeature, aPage );
+                }
+            else if ( prevSelection != currentIndex )
+                {
+                // Show the confirmation query. Uses TGSNetworkModeItems.
+                Container()->SetCurrentNetworkModeSelectionL( currentFeature );
+                }
+            }
+        CleanupStack::PopAndDestroy( itemArray );
+        }
+    //We'll update listbox for Network Mode when we're sure that phone is not
+    //in Offline mode
+    if ( aPage != EGSNetworkModeItemId )
+        {
+        UpdateListBoxL( aPage );
+        }
+
+    CleanupStack::PopAndDestroy( settingPageTitle );
+
+    __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL] End" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// utility for converting TInt to TGSNetworkModes enum.
+//
+// ---------------------------------------------------------------------------
+TGSNetworkModeItems CGSNetworkPlugin::IntToEnum( TInt aFeatureId )
+    {
+    TGSNetworkModeItems mode = EGSNetworkModeDualmode;
+    TInt supportedNetworks = Container()->NetPluginModel()->GetSupportedNetworksL();
+    TInt value = 0;
+    
+    switch( aFeatureId )
+        {
+        case EGSNetworkModeDualmode:
+            mode = EGSNetworkModeDualmode;
+            break;
+        case EGSNetworkModeUMTS:
+            value = supportedNetworks & CGSNetworkPluginContainer::ENetFirstBit;           
+            if ( value ) 
+                 {
+                 mode = EGSNetworkModeUMTS;
+                 }
+             else
+            //assume that only dual mode and gsm are possible.
+                 {
+                 mode = EGSNetworkModeGSM;
+                 }
+            break;
+        case EGSNetworkModeGSM:
+            mode = EGSNetworkModeGSM;
+            break;
+        default:
+            // This should not happen as items should always have matching id.
+            __ASSERT_DEBUG( EFalse, User::Panic( KGSNetworkPluginAssertName, KErrArgument ) );
+        }
+    return mode;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// If calls are started when in Network Setting Page, it is closed.
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleCallActivatedL()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleCallActivatedL");
+
+    CGSNetworkPluginContainer* container = Container();
+    if ( container )
+        {
+        const TInt currentFeatureId = container->CurrentFeatureId();
+
+		    if ( currentFeatureId != EGSNetworkModeSelectionItemId )
+		        {
+		        iPhoneSettingsEngine->CancelProcess();
+		        return;
+		        }
+		    iPhoneSettingsEngine->CancelProcess();
+		    //Close requesting notes
+		    if ( iDlg )
+		        {
+		        HandleSearchingNetworksL( MPsetNetworkInfoObserver::EServiceRequestNone );
+		        HandleRequestingSelectedNetworkL( EFalse );
+		        }
+
+		    //Close available network's list
+		    if ( iNetworkPopupList )
+		        {
+		        iNetworkPopupList->CancelPopup();
+		        iNetworkPopupList = NULL;
+		        }
+		    
+		    CloseDialog();
+		    
+        }
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleCallActivatedL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Handles errors.
+// From MPsetNetworkInfoObserver.
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleNetworkErrorL(
+    const MPsetNetworkInfoObserver::TServiceRequest aRequest,
+    const TInt aError )
+    {
+
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> requestBuf;
+    GSNetworkDebugHelper::NetworkInfoRequestToDes( aRequest, requestBuf );
+    __GSLOGSTRING2( "[CGSNetworkPlugin::HandleNetworkErrorL] %S error:%d",
+                    &requestBuf, aError );
+#endif // _DEBUG
+
+    TInt resourceTxt = KErrNone;
+    switch ( aRequest )
+        {
+        case MPsetNetworkInfoObserver::EServiceRequestGetNetworkInfo:
+            iPhoneSettingsEngine->CancelProcess();
+            iApprovedNetwork = EFalse;
+            break;
+        case MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic:
+        case MPsetNetworkInfoObserver::EServiceRequestSetNetwork:
+        default:
+            break;
+        }
+
+    TBool ignore = EFalse;
+
+    switch ( aError )
+        {
+        case KErrGsmNetCauseCallActive:
+            ignore = ETrue; //do not show an error
+            break;
+        case KErrGsm0707NoNetworkService:
+            resourceTxt = R_NO_NETWORK_FOUND;
+            break;
+        case KErrGsmOfflineOpNotAllowed:
+            resourceTxt = R_OFFLINE_MODE;
+            break;
+        default:
+            resourceTxt = R_NO_NETWORK_ACCESS;
+            break;
+        }
+    if ( !ignore )
+        {
+        ShowNoteL( resourceTxt, KGSErrorNote );
+        iApprovedNetwork = EFalse;
+        }
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleNetworkErrorL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Check if calls are active and show note if Nw-menu is tried to be opened
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::CheckCallActiveL( TGSNetworkItemIds aItemId )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::CheckCallActiveL");
+    if ( iPhoneSettingsEngine->IsCallActive() == CPsetSAObserver::EPSetCallActive )
+        {
+        ShowNoteL( R_ONGOING_CALL, KGSErrorNote );
+        return;
+        }
+
+    // Show network mode selection only if the mode value is already available!
+    if ( aItemId == EGSNetworkModeItemId && !iSettingDlg
+         && Container()->NetPluginModel()->GetNetworkMode()
+         != KGSNetworkModeCapsNotUpdated
+         )
+        {
+#ifdef FF_POWER_SAVE            
+            if ( iPsmActive->Mode() == EPsmsrvModePowerSave )
+                {
+                // If PSM is on, block setting:
+                DisplayBlockNoteL();
+                }
+            else
+                {
+#endif // FF_POWER_SAVE                    
+                ShowSettingPageL( EGSNetworkModeItemId );
+#ifdef FF_POWER_SAVE
+                }
+#endif // FF_POWER_SAVE 
+        }
+    else if( !iSettingDlg         
+    	    //&& Container()->NetPluginModel()->GetNetworkMode()
+            /*!= KGSNetworkModeCapsNotUpdated*/ )
+        {
+        ShowSettingPageL( EGSNetworkModeSelectionItemId );
+        }
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::CheckCallActiveL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Sets a title to a given popup list.
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::SetTitleToPopupL( CAknPopupList& aList, TInt aTitleID )
+    {
+    HBufC* text = StringLoader::LoadLC( aTitleID );
+    aList.SetTitleL( *text );
+    CleanupStack::PopAndDestroy( text );
+    text = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Sets a title to a settings page.
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::SetTitleToSettingsL( CAknRadioButtonSettingPage& aDlg,
+                                              TInt aTitleID )
+    {
+    HBufC* title = StringLoader::LoadLC( aTitleID );
+    aDlg.SetSettingTextL( *title );
+    CleanupStack::PopAndDestroy( title );
+    title = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Appends given item to given list
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::AppendItemL( CDesCArrayFlat& aList, TInt aItem )
+    {
+    HBufC* string = StringLoader::LoadLC( aItem );
+    aList.AppendL( *string );
+    CleanupStack::PopAndDestroy( string );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Shows a note if GPRS is active, when MCN is turned on.
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::CheckGPRSConnectionL( TInt aCurrentItem )
+    {
+    if ( ( iPhoneSettingsEngine->IsGPRSConnected() ==
+                     CPsetSAObserver::EPSetGPRSConnectionActive )
+        && ( aCurrentItem == KGSSettingOff ) ) //if trying to set On...
+        {
+        ShowNoteL( R_ACTIVE_GPRS_CONN_NOTE, KGSInformationNote );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Set MCN value: off => on, on => off.
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::SwitchOnOffValue( TInt& aValue )
+    {
+    if ( aValue == EGSMcnSetOn )
+        {
+        aValue = EGSMcnSetOff;
+        }
+    else
+        {
+        aValue = EGSMcnSetOn;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Create new Net container.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::NewContainerL()
+    {
+    iContainer = new ( ELeave ) CGSNetworkPluginContainer( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPlugin::HandleListBoxSelectionL
+//
+// Handle user selection in the listbox to perform an associated action
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::HandleListBoxSelectionL()
+    {
+    CEikMenuBar* menuBar = this->MenuBar();
+
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+
+    switch ( currentFeatureId )
+        {
+         case EGSNetworkModeSelectionItemId:
+            CheckCallActiveL( EGSNetworkModeSelectionItemId );
+            return;
+        case EGSMCNItemId:
+            if ( IsPhoneOfflineL() )
+                {
+                HBufC* string = StringLoader::LoadLC( R_OFFLINE_MODE );
+                CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue );
+                note->ExecuteLD( *string );
+                CleanupStack::PopAndDestroy( string );
+                }
+            else
+                {
+                Container()->GetMcnValue( iMCN );
+                CheckGPRSConnectionL( iMCN );
+                SwitchOnOffValue( iMCN );
+                Container()->SetMcnValue( iMCN );
+                }
+            break;
+        case EGSNetworkModeItemId:
+            CheckCallActiveL( EGSNetworkModeItemId );
+            return;
+        default:
+            break;
+        }
+
+    UpdateListBoxL( currentFeatureId );
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Makes a Network/MCN Ss operation.
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPlugin::CreateNetworkSsCallL( TInt aIndex,
+                                             TGSNetworkItemIds aPage  )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::CreateNetworkSsCallL");
+    if ( aPage == EGSNetworkModeSelectionItemId )
+        {
+        if ( aIndex == CGSNetworkPlugin::EAutomaticMode )
+            {
+            MPsetNetworkSelect::TNetworkInfo info;
+            MPsetNetworkSelect::TSelectMode mode =
+                MPsetNetworkSelect::ENetSelectModeAutomatic;
+            iSearchForNetworksActive = ETrue;
+            iPhoneSettingsEngine->GetNetworkSelectMode( mode );
+            if ( mode == MPsetNetworkSelect::ENetSelectModeAutomatic )
+                {
+                iPreviousState = ETrue;
+                }
+
+            //get the local variation status for auto-auto net search support
+            //the flag is negative... so 1 means "no search allowed".
+            TBool autoNetSearchOff =
+             Container()->NetPluginModel()->AutomaticNetworkSearchSupportedL();
+
+            //autoNetSearch is defaulted to 0
+            if ( iPreviousState && autoNetSearchOff )
+                {
+                PhoneIdle();
+                }
+            else
+                {
+                info.iMode = MPsetNetworkSelect::ENetSelectModeAutomatic;
+                iSearchForNetworksActive = ETrue;
+                iPhoneSettingsEngine->SelectNetworkL( info );
+                }
+            }
+        else //manual mode
+            {
+            iSearchForNetworksActive = ETrue;
+            iPhoneSettingsEngine->GetAvailableNetworksL();
+            }
+        }
+    else // MCN Setting page
+        {
+        iMCN = aIndex;
+        CheckGPRSConnectionL( iMCN );
+        SwitchOnOffValue( iMCN );
+        Container()->SetMcnValue( iMCN );
+        }
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::CreateNetworkSsCallL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Shows note.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::ShowNoteL( TInt aResourceId, TInt aType )
+    {
+    HBufC* string = StringLoader::LoadLC( aResourceId );
+    switch ( aType )
+        {
+        case KGSErrorNote:
+            {
+            CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue );
+            note->ExecuteLD( *string );
+            break;
+            }
+        case KGSConfirmationNote:
+            {
+            CAknConfirmationNote* note =
+                new ( ELeave ) CAknConfirmationNote( ETrue );
+            note->ExecuteLD( *string );
+            break;
+            }
+        case KGSInformationNote:
+            {
+            CAknInformationNote* note =
+                new ( ELeave ) CAknInformationNote( ETrue );
+            note->ExecuteLD( *string );
+            break;
+            }
+        default:
+            break;
+        }
+    CleanupStack::PopAndDestroy( string );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates dialog, if it is does not exist yet.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::CheckAndCreateDlgL( TBool aDelayOff )
+    {
+    if ( !iDlg )
+        {
+        iDlg = new ( ELeave ) CAknWaitDialog(
+            reinterpret_cast<CEikDialog**> ( &iDlg ), aDelayOff );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Empties fetched network provider's list
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::PurgeNetworkList()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::PurgeNetworkList");
+    if ( iNetworkArray )
+        {
+        iNetworkArray->Reset();
+        delete iNetworkArray;
+        iNetworkArray = NULL;
+        }
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::PurgeNetworkList");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPlugin::Container
+//
+// Returns Network container item
+// ---------------------------------------------------------------------------
+//
+CGSNetworkPluginContainer* CGSNetworkPlugin::Container()
+    {
+    return static_cast <CGSNetworkPluginContainer*> ( iContainer );
+    }
+
+// ---------------------------------------------------------------------------
+// @@see MSSSettingsRefreshObserver::AllowRefresh
+//
+// Notification to allow refresh from SAT
+// ---------------------------------------------------------------------------
+//
+TBool CGSNetworkPlugin::AllowRefresh(
+                const TSatRefreshType aType,
+                const TSatElementaryFiles aFiles )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::AllowRefresh");
+    TBool allowRefresh = ETrue;
+    if ( iPhoneSettingsEngine->IsCallActive() == CPsetSAObserver::EPSetCallActive )
+        {
+        allowRefresh = EFalse;
+        }
+
+    //check that aFiles has a value before issuing a refresh command
+    //no need to check for a specific file...
+    if ( ( aType != EFileChangeNotification ) ||
+         ( aType == EFileChangeNotification ) &&
+         ( aFiles & KCsp1Ef ||  aFiles & KCsp2Ef ) )
+        {
+        if ( iNetworkPopupList )
+            {
+            allowRefresh = EFalse;
+            }
+        }
+
+    __GSLOGSTRING1("[GS]    AllowRefresh: allowRefresh: %d", allowRefresh);
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::AllowRefresh");
+    return allowRefresh;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// @@see MSSSettingsRefreshObserver::Refresh
+//
+// Do the actual refresh of the UI for CSP file updation
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::Refresh(
+                const TSatRefreshType aType,
+                const TSatElementaryFiles aFiles )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPlugin::Refresh");
+    // for a file change notification to be handled, aFiles must always
+    // contain a value
+    if ( ( aType != EFileChangeNotification ) ||
+         ( aType == EFileChangeNotification ) &&
+         ( aFiles & KCsp1Ef ||  aFiles & KCsp2Ef  ) )
+        {
+        //check if this check is required, as it is visible in the UI
+        if ( iNetworkPopupList )
+            {
+            iNetworkPopupList->CancelPopup();
+            iNetworkPopupList = NULL;
+            }
+
+        //Change the network mode to Automatic.
+        MPsetNetworkSelect::TNetworkInfo info;
+        info.iMode = MPsetNetworkSelect::ENetSelectModeAutomatic;
+        iSearchForNetworksActive = ETrue;
+        TRAP_IGNORE( iPhoneSettingsEngine->SelectNetworkL( info ) );
+        __GSLOGSTRING("[GS]    Refresh: before Updating the listbox");
+        TRAP_IGNORE( UpdateListBoxL( EGSNetworkModeSelectionItemId ) );
+        __GSLOGSTRING("[GS]    Refresh: after Updating the listbox");
+        }
+
+    __GSLOGSTRING("[GS] <--CGSNetworkPlugin::Refresh");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPlugin::PhoneIdle
+//
+// Switch to Phone Idle view. GS is running at the background.
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::PhoneIdle()
+    {
+    // Fetching the current Idle id
+    TInt idleApp;
+    RProperty::Get( KPSUidAiInformation, KActiveIdleUid, idleApp );
+    TUid idleAppUid = { idleApp } ;
+    TApaTaskList taskList( iEikonEnv->WsSession() );
+    TApaTask task = taskList.FindApp( idleAppUid );
+
+    // Expecting that idle application is open always
+    // if not we dont do anything
+    if( task.Exists() )  // App open
+    	{
+        task.BringToForeground();
+        }
+
+    //No need to reset network search on exit
+    iSearchForNetworksActive = EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// When this method is called, view checks based on highlight focus, if the MSK
+// label is correct.
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::CheckMiddleSoftkeyLabelL()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// Remove unnecessary commands from Middle softkey.
+// @flag = ETrue means presently MSK value is "Change" so we remove that
+// @flag = EFalse means presently MSK value is "Context Options" so we remove that
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::RemoveCommandFromMSK(const TBool flag )
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        if ( flag )
+            {
+            cbaGroup->RemoveCommandFromStack(
+                                KGSMSKControlID, EGSMSKCmdAppChange );
+            }
+        else
+            {
+            cbaGroup->RemoveCommandFromStack(
+                                KGSMSKControlID, EAknSoftkeyContextOptions );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets middle softkey label.
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::SetMiddleSoftKeyLabelL(
+    const TInt aResourceId, const TInt aCommandId )
+    {
+    CEikButtonGroupContainer* cbaGroup = Cba();
+    if ( cbaGroup )
+        {
+        HBufC* middleSKText = StringLoader::LoadLC( aResourceId );
+        TPtr mskPtr = middleSKText->Des();
+        cbaGroup->AddCommandToStackL(
+            KGSMSKControlID,
+            aCommandId,
+            mskPtr );
+        CleanupStack::PopAndDestroy( middleSKText );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::HandleClientRectChange
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ========================= From CGSPluginInterface ==================
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::GetCaptionL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    HBufC* result = StringLoader::LoadL( R_GS_NET_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::PluginProviderCategory
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSNetworkPlugin::PluginProviderCategory() const
+    {
+    //This plugin is created by 3rd party.
+    return KGSPluginProviderInternal;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Updates specific value to container.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::UpdateListBoxL( const TInt& aListItem,
+                                       const TInt aNewValue )
+    {
+    if ( iContainer && iContainer->iListBox )
+        {
+        Container()->UpdateListBoxL( aListItem, aNewValue );
+        }
+    CheckMiddleSoftkeyLabelL();
+    }
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSNetworkPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSNetworkPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem && PhoneOnline() )
+        {
+        icon = AknsUtils::CreateGulIconL(
+            AknsUtils::SkinInstance(),
+            KAknsIIDQgnPropSetNetworkSub,
+            fp->FullName(),
+            EMbmGsnetworkpluginQgn_prop_set_network_sub,
+            EMbmGsnetworkpluginQgn_prop_set_network_sub_mask );
+        }
+    else if( aIconType == KGSIconTypeLbxItem /*->phone offline*/ )
+        {
+        icon = AknsUtils::CreateGulIconL(
+            AknsUtils::SkinInstance(),
+            KAknsIIDQgnPropSetNetworkSub,
+            fp->FullName(),
+            EMbmGsnetworkpluginQgn_prop_set_network_sub_offline,
+            EMbmGsnetworkpluginQgn_prop_set_network_sub_offline_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+    CleanupStack::PopAndDestroy( fp );
+    return icon;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPlugin::HandleNotifyPSL
+//
+// Handling PS keys change
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey,
+                                        const TRequestStatus& /* aStatus */ )
+    {
+    if ( aUid == KPSUidBluetoothSapConnectionState &&
+         aKey == KBTSapConnectionState )
+        {
+        Visible();
+        }
+    }
+
+// ---------------------------------------------------------
+// CGSNetworkPlugin::IsPhoneOfflineL
+//
+// Checks if phone is in offline mode or not.
+// Return ETrue if phone is in offline mode.
+// Return EFalse if phone is not in offline mode.
+// ---------------------------------------------------------
+//
+TBool CGSNetworkPlugin::IsPhoneOfflineL() const
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) )
+        {
+        CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs );
+        TInt connAllowed = 1;
+        repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed );
+        CleanupStack::PopAndDestroy();  // repository
+        if ( !connAllowed )
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPlugin::DynInitMenuPaneL()
+//
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSNetworkPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                         CEikMenuPane* aMenuPane )
+    {
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+
+//Disabling warning caused by err variable used inside macros
+#pragma diag_suppress 550
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::GetValue()
+//
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::GetValue( const TGSPluginValueKeys aKey,
+                                 TDes& aValue )
+    {
+    switch( aKey )
+        {
+        case EGSPluginKeySettingsItemValueString:
+            // Operator name is async function but GetValue is synchronous.
+            // As a result the first GetValue call might not contain updated
+            // operator name. A callback will however ask to update parent plugin
+            // which will then call GetValue a second time and the operator name
+            // will then be updated.
+            if( !iNWSession )
+                {
+                __GSLOGSTRING(" [CGSNetworkPlugin::GetValue] Opening iNWSession..." );
+
+                // Create network handling engine session.
+                // Question: is this callback one-shot or constant observer?
+                TRAPD( err, iNWSession = CreateL( *this, iNWInfo ) );
+                __GSLOGSTRING1(" [CGSNetworkPlugin::GetValue] Done. Err:%d", err );
+                }
+            aValue.Copy( iNetworkText->Des() );
+            break;
+        default:
+            aValue.Append( KEmptyStr );
+            break;
+        }
+    }
+
+//Enabling warnings
+#pragma diag_default 550
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::GetNetworkValues()
+// Get network status
+// qtn.cp.detail.cellular.operational / qtn.cp.detail.cellular.offline
+// qtn_cp_detail_cellular_operational / qtn_cp_detail_cellular_offline
+// and operator name.
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::UpdateNetworkTextL()
+    {
+    // On default text is 'off-line', if online status is received use,
+    // 'operational'.
+    TInt networkStatusRscId = R_CELLULAR_OFFLINE;
+
+    if( iNetworkText )
+        {
+        delete iNetworkText;
+        iNetworkText = NULL;
+        }
+
+    if( PhoneOnline() )
+        {
+        __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading operational-text" );
+        iNetworkText = iNWInfo.iLongName.AllocL();      
+        }
+    else
+        {
+        __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading offline-text" );
+        networkStatusRscId = R_CELLULAR_OFFLINE;
+        iNetworkText = StringLoader::LoadL( networkStatusRscId );
+        }
+    __GSLOGSTRING1( "[CGSNetworkPlugin::UpdateNetworkTextL] iNetworkText:%S ", iNetworkText );
+    }
+
+
+//Disabling warning caused by err variable used inside macros
+#pragma diag_suppress 550
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::HandleNetworkMessage
+// From MNWMessageObserver.
+//
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::HandleNetworkMessage( const TNWMessages aMessage )
+    {
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> messageBuf;
+    GSNetworkDebugHelper::NetworkMessageToDes( aMessage, messageBuf );
+    __GSLOGSTRING1( "[CGSNetworkPlugin::HandleNetworkMessage] %S",
+                    &messageBuf );
+#endif // _DEBUG
+
+    switch( aMessage )
+        {
+        case ENWMessageNetworkInfoChange:
+            TRAPD
+                (
+                err,
+                UpdateNetworkTextL();
+                )
+            __GSLOGSTRING1(
+                    "[CGSNetworkPlugin::HandleNetworkMessage] Update network text error:%d.",
+                    err );
+            TRAPD
+                (
+                err2,
+                UpdateNetworkSettingPageL();
+                )
+            __GSLOGSTRING1(
+                    "[CGSNetworkPlugin::HandleNetworkMessage] Update network setting page error:%d.",
+                    err2 );
+            Parent()->UpdateView();
+            break;
+        default:
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::UpdateNetworkSettingPageL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::UpdateNetworkSettingPageL()
+    {
+    // If network mode setting page is open, close it and open
+    // again so it will update the selected value correctly.
+    // Whoopee! Who said setting dialogs are dumb?
+    if( iSettingDlg && Container()->CurrentFeatureId() ==  EGSNetworkModeItemId )
+        {
+        __GSLOGSTRING( "[CGSNetworkPlugin::UpdateNetworkSettingPageL] Closing and reopening dialog..." );
+        CloseDialog();
+        ShowSettingPageL( EGSNetworkModeItemId );
+        }
+    }
+
+//Enabling warnings
+#pragma diag_default 550
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::HandleNetworkError
+// From MNWMessageObserver.
+//
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::HandleNetworkError( const TNWOperation aOperation,
+                                           TInt aErrorCode )
+    {
+    // Probably no need to do anything as default assumption is off-line unless
+    // iNWInfo.iRegistrationStatus defines otherwise. Question is, does
+    // iNWSession update iNWInfo values to anything sensible in case of error.
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> operationBuf;
+    GSNetworkDebugHelper::NetworkOperationToDes( aOperation, operationBuf );
+    __GSLOGSTRING2( "[CGSNetworkPlugin::HandleNetworkError] %S error:%d",
+                    &operationBuf, aErrorCode );
+#endif // _DEBUG
+
+    // Later network operator name seems to be updated after HandleNetworkError
+    // so we probably want to update the name also in UI as soon as possible.
+    TRAP_IGNORE( UpdateNetworkTextL(); );
+
+    // CGSParentPlugin::DoDeactivate() will delete it's container so calling
+    // CGSParentPlugin::UpdateView() should not cause unnecessary container
+    // updates.
+    Parent()->UpdateView();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::Parent
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGSParentPlugin* CGSNetworkPlugin::Parent()
+    {
+    CGSParentPlugin* parent = static_cast<CGSParentPlugin*>(
+            AppUi()->View( KGSConPluginUid ) );
+    return parent;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::PhoneOnline
+//
+//
+// -----------------------------------------------------------------------------
+//
+TBool CGSNetworkPlugin::PhoneOnline()
+    {
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> statusBuf;
+    GSNetworkDebugHelper::NetworkStatusToDes( iNWInfo.iRegistrationStatus, statusBuf );
+    __GSLOGSTRING1( "[CGSNetworkPlugin::PhoneOnline] %S", &statusBuf );
+#endif // _DEBUG
+
+    TBool online = EFalse;
+    switch( iNWInfo.iRegistrationStatus )
+        {
+        case ENWRegisteredOnHomeNetwork: // Same functionality as below
+        case ENWRegisteredRoaming:
+            {
+            online = ETrue;
+            break;
+            }
+        default:
+            {
+            online = EFalse;
+            break;
+            }
+        }
+    return online;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSNetworkPlugin::CloseDialog
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSNetworkPlugin::CloseDialog()
+    {
+    //Send ESC key sequence to setting dialog, so that it closes itself.
+    if ( iSettingDlg )
+        {
+        TKeyEvent event;
+        event.iCode = EKeyEscape;
+        event.iScanCode = EStdKeyEscape;
+        event.iRepeats = 0;
+        TRAP_IGNORE( iCoeEnv->SimulateKeyEventL( event, EEventKeyDown );
+                     iCoeEnv->SimulateKeyEventL( event, EEventKey );
+                     iCoeEnv->SimulateKeyEventL( event, EEventKeyUp ); );
+        }
+    }
+
+#ifdef FF_POWER_SAVE
+// ----------------------------------------------------------------------------------
+// CGSDisplayPlugin::DisplayBlockNoteL()
+// ----------------------------------------------------------------------------------
+void CGSNetworkPlugin::DisplayBlockNoteL()
+    {
+    HBufC* prompt = iCoeEnv->AllocReadResourceLC(
+            R_GS_POWER_SAVING_PROTECTED_SETTINGS_INFONOTE );
+    CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue );
+    note->ExecuteLD( *prompt );
+    CleanupStack::PopAndDestroy( prompt );
+    }
+
+// ----------------------------------------------------------------------------------
+// CGSDisplayPlugin::UpdateOnPsmChanged()
+// ----------------------------------------------------------------------------------
+void CGSNetworkPlugin::UpdateOnPsmChanged() 
+    {
+    __GSLOGSTRING( "[CGSNetworkPlugin::UpdateOnPsmChanged]" );
+    
+    if ( Container() && Container()->NetPluginModel() )
+        {
+        Container()->NetPluginModel()->StartAsynGetCurrentNetworkModeSelectionL();
+        }
+    }
+
+#endif // FF_POWER_SAVE
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginAO.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSNetworkPlugin.h"
+#include "GSNetworkPluginAO.h"
+#include "GsLogger.h"
+#include <psmsrvdomaincrkeys.h>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::CGSNetworkPluginAO
+// ----------------------------------------------------------------------------------
+CGSNetworkPluginAO::CGSNetworkPluginAO() :
+    CActive( EPriorityStandard ),
+    iPsmRepository( NULL ),
+    iPsmMode( -1 ),
+    iNetworkPluginView( NULL )
+
+    {
+    
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::~CGSNetworkPluginAO
+// ----------------------------------------------------------------------------------
+CGSNetworkPluginAO::~CGSNetworkPluginAO()
+    {
+    Cancel();
+    delete iPsmRepository;
+    iPsmRepository = NULL;
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::DoCancel
+// ----------------------------------------------------------------------------------
+void CGSNetworkPluginAO::DoCancel()
+    {
+    iPsmRepository->NotifyCancel( KPsmCurrentMode );
+    }
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::RunL
+// ----------------------------------------------------------------------------------
+void CGSNetworkPluginAO::RunL()
+    {
+    // Request complete, notify request again and get new value
+    iPsmRepository->Get( KPsmCurrentMode, iPsmMode );
+    iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus );
+    
+    SetActive();
+    
+    __GSLOGSTRING1( "[CGSNetworkPluginAO::RunL] iPsmMode:%d", iPsmMode );
+
+    // Update network plugin view when PSM mode has changed
+    if ( iNetworkPluginView )
+        {
+        iNetworkPluginView->UpdateOnPsmChanged();
+        }
+    }
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::RunError
+// ----------------------------------------------------------------------------------
+TInt CGSNetworkPluginAO::RunError( TInt /*aError*/ )
+    {
+    return KErrNone;
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::NewL
+// ----------------------------------------------------------------------------------
+CGSNetworkPluginAO* CGSNetworkPluginAO::NewL()
+    {
+    CGSNetworkPluginAO* self = new( ELeave ) CGSNetworkPluginAO();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::ConstructL
+// ----------------------------------------------------------------------------------
+void CGSNetworkPluginAO::ConstructL()
+    {
+    CActiveScheduler::Add ( this );
+    iPsmRepository = CRepository::NewL( KCRUidPowerSaveMode );
+    // Read from CenRep so iPsmMode gets correct init value
+    iPsmRepository->Get( KPsmCurrentMode, iPsmMode );
+    iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus );
+    
+    SetActive();
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::SetView
+// ----------------------------------------------------------------------------------
+void CGSNetworkPluginAO::SetView( CGSNetworkPlugin* aNetworkPluginView )
+    {
+    iNetworkPluginView = aNetworkPluginView;
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CGSNetworkPluginAO::Mode
+// ----------------------------------------------------------------------------------
+TInt CGSNetworkPluginAO::Mode() const
+    {
+    return iPsmMode;
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,604 @@
+/*
+* Copyright (c) 2003 - 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Network folder in GSTelPlugin.
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSNetworkPluginModel.h"       //for CGSModel
+#include "gssettingid.h"            //for view IDs
+#include "GSNetworkPluginContainer.h" //for CGSNetworkPluginContainer
+#include "GsLogger.h"
+
+
+#include <aknlists.h>               //for CAknSettingStyleListBox
+#include <aknnotewrappers.h>        //for AknErrorNote
+#include <aknappui.h>               //for iAvkonAppUi
+#include <StringLoader.h>           //for StringLoader
+#include <GsNetworkPluginRsc.rsg>       //for resource IDs
+#include <PsetContainer.h>          //for CPsetContainer
+#include <PsetNetwork.h>            //for CPsetNetwork
+#include <gslistbox.h>              //for listbox classes
+#include <csxhelp/cp.hlp.hrh>
+#include <gsfwviewuids.h>           // for KUidGS
+#include <MPsetNetworkModeObs.h>    //for network mode values
+#include <gsmerror.h>               //for GSM-specific error messages
+#include <featmgr.h>                //Feature Manager
+#include <MPsetNetworkModeObs.h>
+#include "GSNetworkDebugHelper.h"
+
+#ifndef RD_STARTUP_CHANGE
+    #include <sysstartup.h>             //Startup reasons
+#else
+    #include <starterclient.h>          // Startup reasons
+#endif // RD_STARTUP_CHANGE
+
+
+// LOCAL CONSTANTS
+_LIT( KNameOfClass, "CGSNetworkPluginContainer" );
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// C++ Constructor. Needed for initializing iPlugin.
+// ---------------------------------------------------------------------------
+CGSNetworkPluginContainer::CGSNetworkPluginContainer( CGSNetworkPlugin* aPlugin )
+    :iPlugin( aPlugin )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Symbian OS two phased constructor with pointer to Network object
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginContainer::ConstructL( const TRect& aRect )
+    {
+    iListBox = new ( ELeave ) CAknSettingStyleListBox;
+
+    //model construction
+    iModel = CGSNetworkPluginModel::NewL( this, iPlugin );
+
+    BaseConstructL( aRect,
+                    R_GS_NET_VIEW_TITLE,
+                    R_NET_LBX );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Destructor
+//
+// ---------------------------------------------------------------------------
+CGSNetworkPluginContainer::~CGSNetworkPluginContainer()
+    {
+    if ( iListboxItemArray )
+        {
+        delete iListboxItemArray;
+        iListboxItemArray = NULL;
+        }
+
+    if( iModel )
+        {
+        delete iModel;
+        iModel = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates list box
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::ConstructListBoxL");
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
+        *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    CreateListBoxItemsL();
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::ConstructListBoxL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates list box items
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginContainer::CreateListBoxItemsL()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::CreateListBoxItemsL");
+// do not get check CSP if not using WINS
+#ifndef __WINS__
+    //Set CSP on, if it is not already
+    if ( !iModel->GetCSPStatus() )
+        {
+        iModel->SetCSPActiveL( ETrue );
+        }
+#endif
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) )
+        {
+        if ( iModel->IsNetworkModeVisible() )
+            {
+            MakeNwModeUiItemL();
+            }
+        }
+
+    MakeNwItemL();
+    MakeMcnItemL();
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::CreateListBoxItemsL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Updates changed list box item
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginContainer::UpdateListBoxL( TInt aFeatureId, TInt aValue )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::UpdateListBoxL");
+    switch ( aFeatureId )
+        {
+        case EGSNetworkModeItemId:
+            if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) )
+                {
+                if ( iModel->IsNetworkModeVisible() )
+                    {
+                    MakeNwModeUiItemL();
+                    }
+                }
+            break;
+        case EGSNetworkModeSelectionItemId:
+            MakeNwItemL( aValue );
+            break;
+        case EGSMCNItemId:
+            MakeMcnItemL();
+            break;
+        default:
+            Panic( KNameOfClass, EInvalidIndex );
+            break;
+        }
+    iListBox->HandleItemAdditionL();
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::UpdateListBoxL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates new Network list box item
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginContainer::MakeNwItemL( TInt aValue )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeNwItemL");
+    HBufC* dynamicText = NULL;
+    TInt currentValue = KErrNone;
+
+    if ( aValue != KErrNotFound )
+        {
+        currentValue = aValue;
+        }
+    else
+        {
+    //use bogus values for WINS to avoid jamming the emulator
+#ifdef __WINS__
+    currentValue = EGSManualSelectMode;
+#else
+    currentValue = GetSelectionMode();
+#endif // __WINS__
+        }
+
+    TUint32 resourceId = R_NETSL_NETSELECTMODE_LBX;
+    TInt featureId = EGSAutomaticSelectMode;
+
+    if ( currentValue == EGSManualSelectMode )
+        {
+        featureId = EGSManualSelectMode;
+        }
+
+    dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC(
+                                                 resourceId,
+                                                 featureId,
+                                                 *iCoeEnv );
+
+#ifndef __WINS__
+    //Create network mode setting item
+    if ( iModel->IsSettingSupported( EGSCSPManualNetworkSelection ) )
+        {
+#endif
+        // Finally, set the dynamic text
+        iListboxItemArray->SetDynamicTextL( EGSNetworkModeSelectionItemId,
+            *dynamicText );
+
+        // And add to listbox
+        iListboxItemArray->SetItemVisibilityL( EGSNetworkModeSelectionItemId,
+            CGSListBoxItemTextArray::EVisible );
+
+#ifndef __WINS__
+        }
+#endif
+
+    CleanupStack::PopAndDestroy( dynamicText );
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeNwItemL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Gets the currently active selection mode.
+//
+// ---------------------------------------------------------------------------
+TInt CGSNetworkPluginContainer::GetSelectionMode()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::GetSelectionMode");
+    MPsetNetworkSelect::TSelectMode mode =
+        iModel->GetNetworkSelectionMode();
+
+    if ( mode == MPsetNetworkSelect::ENetSelectModeManual )
+        {
+        __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::GetSelectionMode");
+        return EGSManualSelectMode;
+        }
+    else
+        {
+        __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::GetSelectionMode");
+        return EGSAutomaticSelectMode;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Creates new MCN list box item
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginContainer::MakeMcnItemL()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeMcnItemL");
+    HBufC* dynamicText = NULL;
+    TInt readValue = 0;
+
+    GetMcnValue( readValue );
+    TUint32 resourceId = R_MCN_CELL_INFO_DISP_MODE_LBX;
+    TInt featureId = EGSMcnSetOn;
+
+    switch ( readValue ) //resource manipulation
+        {
+        case 0: // Off should be displayed in UI
+            featureId = EGSMcnSetOff;
+            break;
+        case 1: // On should be displayed in UI
+            featureId = EGSMcnSetOn;
+            break;
+        default:
+            break;
+        }
+
+    dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC(
+                                                 resourceId,
+                                                 featureId,
+                                                 *iCoeEnv );
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSMCNItemId, *dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSMCNItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    CleanupStack::PopAndDestroy( dynamicText );
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeMcnItemL");
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Gets MCN value from model.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginContainer::GetMcnValue( TInt &aMcnValue )
+    {
+    iModel->GetMCNSettingValue( aMcnValue );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// Sets MCN value from model.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginContainer::SetMcnValue( TInt &aMcnValue )
+    {
+    iModel->SetMCNSettingValue( aMcnValue );
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Creates network mode ui list box item
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginContainer::MakeNwModeUiItemL()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeNwModeUiItemL");
+    HBufC* dynamicText = NULL;
+
+    // In here KGSNetworkModeCapsNotUpdated means mode is not updated yet
+    if( iModel->GetNetworkMode() != KGSNetworkModeCapsNotUpdated )
+        {
+        // Allocate value to dynamicText from the resource item
+        TUint32 resourceId= R_NET_NETWORK_MODE_LBX;
+        dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC(
+            resourceId, GetCurrentNetworkModeSelectionL(), *iCoeEnv );
+        }
+    else
+        {
+        _LIT( KEmpty, " ");
+        dynamicText = KEmpty().AllocLC ( );
+        }
+
+    // Finally, set the dynamic text
+    iListboxItemArray->SetDynamicTextL( EGSNetworkModeItemId, *dynamicText );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( EGSNetworkModeItemId,
+        CGSListBoxItemTextArray::EVisible );
+
+    // this variable needs to be removed from cleanup stack
+    CleanupStack::PopAndDestroy( dynamicText );
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeNwModeUiItemL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginContainer::CheckAndAlterContentsL
+//
+// Trims non-supported variable options from the array.
+// This array items are displayed as radio button setting page items
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginContainer::CheckAndAlterContentsL(
+                         CGSRadioButtonSettingPageItemTextArray& aItemArray )
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::CheckAndAlterContentsL");
+    TInt value = 0;
+    TInt supportedNetworks = iModel->GetSupportedNetworksL();
+    __GSLOGSTRING1("[GS]    CheckAndAlterContentsL: supportedNetworks: %d", supportedNetworks);
+
+    // The 0th item corresponds to DualMode. This is always available in the
+    // setting page, so no actions required, just make it visible.
+    aItemArray.SetItemVisibilityL( EGSNetworkModeDualmode,
+                                   CGSListBoxItemTextArray::EVisible );
+
+    // the first bit corresponds to UMTS
+    value = supportedNetworks & ENetFirstBit;
+    __GSLOGSTRING1("[GS]    CheckAndAlterContentsL: (UMTS)value: %d", value);
+
+    if ( value == EGSNetworkModeUMTS )
+        {
+        aItemArray.SetItemVisibilityL( EGSNetworkModeUMTS,
+                                       CGSListBoxItemTextArray::EVisible );
+        }
+    else
+        {
+        aItemArray.SetItemVisibilityL( EGSNetworkModeUMTS,
+                                       CGSListBoxItemTextArray::EInvisible );
+        }
+
+    // Get the zeroeth value (GSM) from the list
+    value = supportedNetworks & ENetSecondBit;
+    __GSLOGSTRING1("[GS]    CheckAndAlterContentsL: (GSM)value: %d", value);
+
+    if ( value == EGSNetworkModeGSM )
+        {
+        aItemArray.SetItemVisibilityL( EGSNetworkModeGSM,
+                                       CGSListBoxItemTextArray::EVisible );
+        }
+    else
+        {
+        aItemArray.SetItemVisibilityL( EGSNetworkModeGSM,
+                                       CGSListBoxItemTextArray::EInvisible );
+        }
+
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::CheckAndAlterContentsL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const
+// Gets Help
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_NETWORK;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSettListCallContainer::CurrentFeatureId()
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSNetworkPluginContainer::CurrentFeatureId( ) const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+
+void CGSNetworkPluginContainer::HandleNetworkModeChangeL()
+    {
+    UpdateListBoxL( EGSNetworkModeItemId, GetCurrentNetworkModeSelectionL() );
+
+     //updating value
+     CGSRadioButtonSettingPageItemTextArray* nwModeArray =
+            CGSRadioButtonSettingPageItemTextArray::NewL(
+            R_NET_NETWORK_MODE_LBX,
+            *iCoeEnv,
+            NULL );
+     // For showing updated network mode value???
+    CleanupStack::PushL( nwModeArray );
+    CheckAndAlterContentsL( *nwModeArray );
+    TInt currentIndex = nwModeArray->IndexForFeatureIdL(
+        GetCurrentNetworkModeSelectionL() );
+    HBufC* buf = StringLoader::LoadL(
+             R_CONFIRM_NOTE_NWMODE_STRING,
+             nwModeArray->MdcaPoint( currentIndex ),
+             iEikonEnv );
+    CleanupStack::PushL( buf );
+    CAknConfirmationNote* note = new( ELeave ) CAknConfirmationNote( ETrue );
+    note->ExecuteLD( *buf );
+    CleanupStack::PopAndDestroy( buf );
+    CleanupStack::PopAndDestroy( nwModeArray );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginContainer::TelPluginModel
+//
+// Return the model pointer for use in view class
+// ---------------------------------------------------------------------------
+//
+CGSNetworkPluginModel* CGSNetworkPluginContainer::NetPluginModel()
+    {
+    return iModel;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets observer for MSK label updations.
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginContainer::SetMiddleSoftkeyObserver(
+    MGsFWMSKObserver* aObserver )
+    {
+    if ( !iMSKObserver && aObserver )
+        {
+        iMSKObserver = aObserver;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginContainer::OfferKeyEventL
+// Called when a key is pressed.
+// ---------------------------------------------------------------------------
+TKeyResponse CGSNetworkPluginContainer::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyUpArrow:
+        case EKeyDownArrow:
+            {
+            TKeyResponse listboxResp =
+                iListBox->OfferKeyEventL( aKeyEvent, aType );
+            if ( iMSKObserver )
+                {
+                iMSKObserver->CheckMiddleSoftkeyLabelL();
+                }
+            return listboxResp;
+            }
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+            // Listbox takes all events even if it doesn't use them
+            return EKeyWasNotConsumed;
+        default:
+            break;
+        }
+
+    return iListBox->OfferKeyEventL( aKeyEvent, aType );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL
+//
+// Returns the current listbox selection of network mode.
+// ---------------------------------------------------------------------------
+//
+TGSNetworkModeItems CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL()
+    {
+    TGSNetworkModeItems featureId = EGSNetworkModeDualmode;
+
+    switch( iModel->GetNetworkMode() )
+        {
+        case RMmCustomAPI::KCapsNetworkModeGsm:
+            featureId = EGSNetworkModeGSM;
+            break;
+
+        case RMmCustomAPI::KCapsNetworkModeUmts:
+            featureId = EGSNetworkModeUMTS;
+            break;
+
+        case RMmCustomAPI::KCapsNetworkModeDual:
+            featureId = EGSNetworkModeDualmode;
+            break;
+        default:
+            // Mode might not be updated yet, in which case default is dual.
+            // Not a perfect solution but have to have an item selected in 
+            // options box
+            featureId = EGSNetworkModeDualmode;
+            break;
+        }
+
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> selectedModeBuf;
+    GSNetworkDebugHelper::NwToDes( featureId, selectedModeBuf );
+    __GSLOGSTRING1( "[CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL] %S ",
+                    &selectedModeBuf );
+#endif // _DEBUG
+
+    iModel->CheckState( featureId );
+    return featureId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL(
+        TGSNetworkModeItems aNetworkModeLbxItem )
+    {
+    __GSLOGSTRING1( "[CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL] Mode:%d", aNetworkModeLbxItem );
+    TUint32 networkMode;
+    switch ( aNetworkModeLbxItem )
+        {
+        case EGSNetworkModeGSM: //just using the index
+            networkMode = RMmCustomAPI::KCapsNetworkModeGsm;
+            break;
+        case EGSNetworkModeUMTS:
+            networkMode = RMmCustomAPI::KCapsNetworkModeUmts;
+            break;
+        case EGSNetworkModeDualmode:
+        default:
+            networkMode = RMmCustomAPI::KCapsNetworkModeDual;
+            break;
+        }
+    // Don't change the network mode if there is ongoing phone call
+    // since this will disconnect it
+    if ( !iModel->IsCallActive() )
+        {
+        iModel->SetNetworkModeL( networkMode );
+        iSelectedNetworkModeLbxItem = aNetworkModeLbxItem;
+        }
+    __GSLOGSTRING( "[CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL] End]" );
+    }
+
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSNetworkPlugin.h"
+
+#ifdef FF_POWER_SAVE
+    #include "PSMNetworkPlugin.h"
+#endif // FF_POWER_SAVE
+
+// Constants
+const TImplementationProxy KGSNetworkPluginImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x102824A8,	CGSNetworkPlugin::NewL )
+#ifdef FF_POWER_SAVE
+    ,
+    IMPLEMENTATION_PROXY_ENTRY( 0x2000B594, CPSMNetworkPlugin::NewL )
+#endif // FF_POWER_SAVE 
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+//
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSNetworkPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+	return KGSNetworkPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,667 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*        Model/Engine for Network Settings Plugin
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSNetworkPluginModel.h"
+#include "GSNetworkPlugin.h"
+#include "GsNetworkPlugin.hrh"
+#include "GsLogger.h"      //for logging traces
+#include <featmgr.h>
+#include <barsc.h>
+#include <barsread.h>
+#include <coecntrl.h>
+#include <f32file.h>
+#include <AknQueryDialog.h>
+#include <s32file.h>
+#include <featmgr.h>
+#include <PsetCSP.h>
+#include <generalsettingsvariant.hrh>
+#include <PSVariables.h>  //PubSub
+#include <settingsinternalcrkeys.h>
+#include "SettingsPrivateCRKeys.h"
+#include <LogsDomainCRKeys.h>
+#include <PsetContainer.h>
+#include <PsetSAObserver.h>  //ongoing call check
+#include "GSNetworkDebugHelper.h"
+#include <GsNetworkPluginRsc.rsg>           //for resource IDs
+
+//CONSTANTS
+// default value for autolock period
+// default value for Sat operations
+
+
+_LIT( KGSNameOfClass, "CGSNetworkPluginModel" );
+
+// Warning disabled as this constant is used inside __ASSERT_DEBUG
+#pragma diag_suppress 177
+_LIT( KGSNetworkPluginModelAssertName, "CGSNetworkPluginModel::CheckState" );
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::NewL
+//
+// Symbian OS two-phased constructor, overloaded version
+// ----------------------------------------------------------------------------
+//
+CGSNetworkPluginModel* CGSNetworkPluginModel::NewL(
+        CGSNetworkPluginContainer* aContainer,
+        CGSNetworkPlugin* aPlugin )
+    {
+    CGSNetworkPluginModel* self = new( ELeave ) CGSNetworkPluginModel(
+            aContainer,
+            aPlugin );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::CGSNetworkPluginModel
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CGSNetworkPluginModel::CGSNetworkPluginModel(
+        CGSNetworkPluginContainer* aContainer,
+        CGSNetworkPlugin* aPlugin )
+    : iNetworkMode( KGSNetworkModeCapsNotUpdated ),
+      iContainer( aContainer ), 
+      iPlugin( aPlugin ) 
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::ConstructL
+//
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::ConstructL()
+    {
+    ConstructBaseItemsL();
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::ConstructBaseItemsL
+//
+// Constructing base items
+// ----------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::ConstructBaseItemsL()
+    {
+    FeatureManager::InitializeLibL();
+    InitializeCentralRepositoryL();
+    SetCSPActiveL( ETrue );
+    iSettingsContainer = CPsetContainer::NewL();
+    User::LeaveIfError( iGSVariationRepository->Get(
+            KSettingsVariationFlags, iLocalVariationValues ) );
+#ifndef __WINS__
+    //This is currently not supported by emulator
+    CreatePhoneSettingsEngineL();
+#endif //__WINS__
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::~CGSNetworkPluginModel
+//
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSNetworkPluginModel::~CGSNetworkPluginModel()
+    {
+    UninitializeCentralRepository();
+
+    if ( GetCSPStatus() )
+        {
+        TRAP_IGNORE( SetCSPActiveL( EFalse ) );
+        }
+
+    if ( iPhoneSettingsEngine )
+        {
+        delete iPhoneSettingsEngine;
+        }
+
+    if( iSettingsContainer )
+        {
+        delete iSettingsContainer;
+        }
+
+    FeatureManager::UnInitializeLib();
+
+    if ( iContainer )
+        {
+        iContainer = NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::InitializeCentralRepositoryL
+//
+// Creating and setting keys for the Central Repository
+// ----------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::InitializeCentralRepositoryL()
+    {
+    iNetworkRepository = CRepository::NewL( KCRUidNetworkSettings );
+    iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::UninitializeCentralRepositoryL
+//
+// Removes Central Repository objects
+// ----------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::UninitializeCentralRepository()
+    {
+    if ( iNetworkRepository )
+        {
+        delete iNetworkRepository;
+        iNetworkRepository = NULL;
+        }
+    if ( iGSVariationRepository )
+        {
+        delete iGSVariationRepository;
+        iGSVariationRepository = NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::GetCSPStatus
+//
+// Get Customer Service Profile status
+// ----------------------------------------------------------------------------
+//
+TBool CGSNetworkPluginModel::GetCSPStatus()
+    {
+    if ( iCSP )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::SetCSPActiveL
+//
+// Set Customer Service Profile active
+// ----------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::SetCSPActiveL( TBool aValue )
+    {
+    if ( aValue )
+        {
+        iCSP = CPsetCustomerServiceProfile::NewL();
+        User::LeaveIfError( iCSP->OpenCSProfileL() );
+        }
+    else
+        {
+        delete iCSP;
+        iCSP = NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::IsNetworkModeVisible
+//
+// Get network mode status value from shared data.
+// ----------------------------------------------------------------------------
+//
+TBool CGSNetworkPluginModel::IsNetworkModeVisible()
+    {
+    TBool nwModeAvailable = EFalse;
+    TInt value;
+
+    iNetworkRepository->Get( KSettingsNetworkMode, value );
+
+    switch ( value )
+        {
+        case 1:
+            nwModeAvailable = ETrue;
+            break;
+        case 0:
+            nwModeAvailable = EFalse;
+            break;
+        default:
+            break;
+        }
+
+    return nwModeAvailable;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::IsSettingSupported
+//
+// Check if a given setting is supported
+// ----------------------------------------------------------------------------
+//
+TBool CGSNetworkPluginModel::IsSettingSupported( TInt aSettingNumber )
+    {
+    __ASSERT_ALWAYS( iCSP != NULL, User::Panic( KGSNameOfClass,
+                                   EGSTelPluinModelPanicNullPtr ) );
+    TBool settingSupported = EFalse;
+    TInt retVal = KErrNone;
+    switch ( aSettingNumber )
+        {
+        case EGSCSPCallForward:
+            retVal = iCSP->IsCFSupported( settingSupported );
+            break;
+        case EGSCSPCallBarring:
+            retVal = iCSP->IsCBSupported( settingSupported );
+            break;
+        case EGSCSPCallWaiting:
+            retVal = iCSP->IsCWSupported( settingSupported );
+            break;
+        case EGSCSPAlternateLine:
+            retVal = iCSP->IsALSSupported( settingSupported );
+            break;
+        case EGSCSPManualNetworkSelection:
+            retVal = iCSP->IsNetworkSelectionSupported( settingSupported );
+            break;
+        default:
+            break;
+        }
+
+    if ( retVal != KErrNone )
+        {
+        //if a CSP error occurs, by default service is available
+        settingSupported = ETrue;
+        }
+
+    return settingSupported;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::GetMCNSettingValue
+// Gets MCN setting value
+//
+// ----------------------------------------------------------------------------
+//
+TBool CGSNetworkPluginModel::GetMCNSettingValue( TInt& aId )
+    {
+    TInt ret = KErrNone;
+    ret = iNetworkRepository->Get( KSettingsMcnDisplay, aId );
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::SetMCNSettingValue
+// Sets MCN setting value
+//
+// ----------------------------------------------------------------------------
+//
+TBool CGSNetworkPluginModel::SetMCNSettingValue( TInt& aId )
+    {
+    TInt ret = KErrNone;
+    ret = iNetworkRepository->Set( KSettingsMcnDisplay, aId );
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSNetworkPluginModel::GetSupportedNetworksL
+//
+// Get supported network mode list
+// ----------------------------------------------------------------------------
+//
+TInt CGSNetworkPluginModel::GetSupportedNetworksL()
+    {
+    TInt supportedNetworks = KGSSettingOff;
+    User::LeaveIfError( iNetworkRepository->
+                Get( KSettingsNetworkModeList, supportedNetworks ) );
+
+    return supportedNetworks;
+    }
+
+// ---------------------------------------------------------
+// CGSNetworkPluginModel::GraphicalNetworkListSupportedL
+//
+// Check if graphical network list is supported.
+// ---------------------------------------------------------
+//
+TBool CGSNetworkPluginModel::GraphicalNetworkListSupportedL()
+    {
+    TBool supported = EFalse;
+
+    if ( iLocalVariationValues & EGSConfig2G3GNetworkIcon )
+        {
+        supported = ETrue;
+        }
+
+    return supported;
+    }
+
+// ---------------------------------------------------------
+// CGSTelPluginModel::AutomaticNetworkSearchSupportedL
+//
+// Check if automatic to automatic network search is supported.
+// ---------------------------------------------------------
+//
+TBool CGSNetworkPluginModel::AutomaticNetworkSearchSupportedL()
+    {
+    TBool supported = EFalse;
+
+    if ( iLocalVariationValues & EGSConfigNoAutoToAutoNetworkSearch )
+        {
+        supported = ETrue;
+        }
+    return supported;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// Sets network mode to member variable.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::CreatePhoneSettingsEngineL()
+    {
+    __GSLOGSTRING("[GS]--> CGSNetworkPluginModel::CreatePhoneSettingsEngineL");
+    //initialize the phone settings object for network mode
+    if ( !iPhoneSettingsEngine )
+        {
+        iPhoneSettingsEngine = iSettingsContainer->CreateNetworkModeObjectL( *this );
+        }
+    iPhoneSettingsEngine->SetNetworkModeObserver( *this );
+    // get the current net mode asynchronously
+    StartAsynGetCurrentNetworkModeSelectionL();
+    
+    __GSLOGSTRING("[GS] <--CGSNetworkPluginModel::CreatePhoneSettingsEngineL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginModel::HandleNetworkSystemModeEventsL
+//
+// Handles Network system mode list fetching from CustomAPI.
+// Handles Network system mode setting to CustomAPI.
+// Handles current network system mode fetching from CustomAPI.
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::HandleNetworkSystemModeEventsL(
+            const MPsetNetworkModeObserver::TServiceRequest aRequest,
+            const TUint32 aNetworkModeCaps )
+    {
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> requestBuf;
+    GSNetworkDebugHelper::NetworkModeRequestToDes( aRequest, requestBuf );
+    __GSLOGSTRING1( "[CGSNetworkPluginModel::HandleNetworkSystemModeEventsL] %S ",
+                    &requestBuf );
+#endif // _DEBUG
+
+    PrintState();
+
+    switch ( aRequest )
+        {
+        case MPsetNetworkModeObserver::EServiceRequestGetCurrentNetworkMode:
+            {
+            TBool networkModeChanged = EFalse;
+            if( iNetworkMode != aNetworkModeCaps )
+                {
+                networkModeChanged = ETrue;
+                iNetworkMode = aNetworkModeCaps;
+                }
+            if( networkModeChanged )
+                {
+                if ( iContainer )
+                    {
+                    iContainer->UpdateListBoxL( EGSNetworkModeItemId, 0 );
+                    }
+                // Will update nw setting page in case it is open.
+                if ( iPlugin )
+                    {
+                    iPlugin->UpdateNetworkSettingPageL();
+                    }
+                }
+            }
+            break;
+        case MPsetNetworkModeObserver::EServiceRequestSetSelectedNetworkMode:
+            {
+
+            /**
+             * Setting network mode succeeded: update actual mode:
+             */
+            iNetworkMode = iRequestedNetworkMode;
+            
+            /**
+             * iNetworkMode should not be updated in case of error.
+             * ->update only in this success case.
+             *
+             * Problem: Currently unclear if aNetworkModeCaps contains 
+             * valid cata in this EServiceRequestSetSelectedNetworkMode case.
+             * So, cannot update iNetworkMode from aNetworkModeCaps here.
+             * Instead use iRequestedNetworkMode manually.
+             */
+
+            if( iContainer )
+                {
+                iContainer->HandleNetworkModeChangeL();
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    PrintState();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginModel::HandleNetworkErrorL
+//
+// From MPsetNetworkModeObserver. This is called if 
+// EServiceRequestSetSelectedNetworkMode fails. No need to handle other cases.
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::HandleNetworkErrorL(
+            const MPsetNetworkModeObserver::TServiceRequest aRequest,
+            const TInt aError )
+    {
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> requestBuf;
+    GSNetworkDebugHelper::NetworkModeRequestToDes( aRequest, requestBuf );
+    __GSLOGSTRING2( "[CGSNetworkPluginModel::HandleNetworkErrorL] %S error:%d",
+                    &requestBuf, aError );
+#endif // _DEBUG
+
+    /**
+     * Handles failing when setting network mode.
+     * Requested mode is stored into a member and actual network mode is updated only
+     * when success is reported in HandleNetworkSystemModeEventsL/
+     * EServiceRequestSetSelectedNetworkMode.
+     */
+    switch( aRequest )
+        {
+        case MPsetNetworkModeObserver::EServiceRequestGetCurrentNetworkMode:
+            break;
+        case MPsetNetworkModeObserver::EServiceRequestSetSelectedNetworkMode:
+            // Hould display error note, iNetworkMode value is still correct as
+            // it is not updated in case request failed.
+            if ( iPlugin )
+                {
+                iPlugin->ShowNoteL( R_NO_NETWORK_ACCESS, KGSErrorNote );   
+                }
+            break;
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginModel::GetNetworkSelectionMode
+//
+// Gets network selection mode (automatic/manual)
+// ---------------------------------------------------------------------------
+//
+MPsetNetworkSelect::TSelectMode CGSNetworkPluginModel::GetNetworkSelectionMode()
+    {
+    MPsetNetworkSelect::TSelectMode mode =
+            MPsetNetworkSelect::ENetSelectModeAutomatic;
+#ifndef __WINS__
+    iPhoneSettingsEngine->GetNetworkSelectMode( mode );
+#endif //__WINS__
+
+    return mode;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginModel::StartAsynGetCurrentNetworkModeSelectionL
+//
+// ---------------------------------------------------------------------------
+//
+void CGSNetworkPluginModel::StartAsynGetCurrentNetworkModeSelectionL()
+    {
+    if ( iPhoneSettingsEngine )
+        {
+        iPhoneSettingsEngine->GetCurrentNetworkModeSelectionL();   
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginModel::GetNetworkMode
+//
+// ---------------------------------------------------------------------------
+//
+TUint32 CGSNetworkPluginModel::GetNetworkMode()
+    {
+    /*
+     * This does not actually ask for the mode from phone engine as
+     * iPhoneSettingsEngine->GetCurrentNetworkModeSelectionL();
+     * Has allready been called in constructor and afterwards we will receive
+     * notifications if mode changes.
+     */
+    return iNetworkMode;
+    }
+
+
+void CGSNetworkPluginModel::SetNetworkModeL( TUint32 aNetworkMode )
+    {
+    __GSLOGSTRING1( "[GS]--> [CGSNetworkPluginModel::SetNetworkModeL]:%d", aNetworkMode );
+    
+    // Store requested mode but iNetworkMode should not updated unless request
+    // succeeds.
+    iRequestedNetworkMode = aNetworkMode;
+    if( iPhoneSettingsEngine )
+        {
+        // Cancel the ongoing operation, otherwise, the set network mode operation will
+        // leave with error code: KErrInUse. 
+        if ( iPhoneSettingsEngine->IsActive() )
+            {
+            iPhoneSettingsEngine->Cancel();
+            }
+        iPhoneSettingsEngine->SetNetworkModeSelectionL( aNetworkMode );
+        }
+    
+    __GSLOGSTRING1( "[GS]<-- [CGSNetworkPluginModel::SetNetworkModeL]:%d", aNetworkMode );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginModel::PrintState
+//
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginModel::PrintState()
+    {
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> networkModeCaps;
+    GSNetworkDebugHelper::NwCapsToDes( iNetworkMode, networkModeCaps );
+    __GSLOGSTRING1( "[CGSNetworkPluginModel::PrintState] iNetworkMode:  %S ",
+                    &networkModeCaps );
+#endif // _DEBUG
+    }
+
+// ---------------------------------------------------------------------------
+// CGSNetworkPluginModel::CheckState
+// For debugging
+// ---------------------------------------------------------------------------
+void CGSNetworkPluginModel::CheckState( TGSNetworkModeItems aMode )
+    {
+#ifdef _DEBUG
+    TBuf<KGSNetworkModeDebugStrLen> networkModeCaps;
+    GSNetworkDebugHelper::NwCapsToDes( iNetworkMode, networkModeCaps );
+    TBuf<KGSNetworkModeDebugStrLen> networkMode;
+    GSNetworkDebugHelper::NwToDes( aMode, networkMode );
+
+    __GSLOGSTRING2( "[CGSNetworkPluginModel::CheckState] %S <-> %S",
+                    &networkModeCaps, &networkMode );
+
+    switch ( iNetworkMode )
+        {
+        case RMmCustomAPI::KCapsNetworkModeDual:
+            __ASSERT_DEBUG(
+                aMode == EGSNetworkModeDualmode,
+                User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) );
+            break;
+        case RMmCustomAPI::KCapsNetworkModeUmts:
+            __ASSERT_DEBUG(
+                aMode == EGSNetworkModeUMTS,
+                User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) );
+            break;
+        case RMmCustomAPI::KCapsNetworkModeGsm:
+            __ASSERT_DEBUG(
+                aMode == EGSNetworkModeGSM,
+                User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) );
+            break;
+        case KGSNetworkModeCapsNotUpdated:
+            // Not updated yet so cannot check state.
+            break;
+        default:
+            __ASSERT_DEBUG(
+                EFalse,
+                User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) );
+            break;
+        }
+
+#endif // _DEBUG
+    }
+
+
+
+TBool CGSNetworkPluginModel::IsCallActive()
+    {
+    TBool callActive = EFalse;
+
+#ifndef __WINS__
+//This is currently not supported by emulator
+    
+    if ( iPhoneSettingsEngine->IsCallActive() != CPsetSAObserver::EPSetNoCallsActive )
+        {
+        callActive = ETrue;
+        }
+    
+#endif //__WINS__
+    
+    return callActive;
+    }
+
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Stub imlementation
+*
+*/
+
+
+// INCLUDE FILES
+#include <psmsettingsprovider.h>
+#include <psmsrvdomaincrkeys.h>
+#include <featmgr.h>
+#include <CoreApplicationUIsSDKCRKeys.h> // KCRUidCoreApplicationUIs, TCoreAppUIsNetworkConnectionAllowed
+#include "PSMNetworkPlugin.h"
+#include "GSNetworkPluginModel.h"
+#include "GsLogger.h"
+
+// CONSTANT DEFINITIONS
+const TUint32 KPSMNetworkPluginStorageId = 0x2000B593;
+
+enum TPSMNetworkPluginKeys
+    {
+    ENetworkMode = 1,
+    };
+
+//
+// ----------------------------------------------------------------------------------
+// CPSMNetworkPlugin::CPSMNetworkPlugin()
+// ----------------------------------------------------------------------------------
+//
+CPSMNetworkPlugin::CPSMNetworkPlugin( TPsmPluginCTorParams& aInitParams ) :
+    CPsmPluginBase( aInitParams )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CPSMNetworkPlugin::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPSMNetworkPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[GS]-->[CPSMNetworkPlugin::ConstructL]" );
+    
+    iModel = CGSNetworkPluginModel::NewL( NULL,NULL );
+    
+    __GSLOGSTRING( "[GS]<--[CPSMNetworkPlugin::ConstructL]" );
+    }
+
+//
+// ----------------------------------------------------------------------------------
+// CPSMNetworkPlugin::NewL()
+// ----------------------------------------------------------------------------------
+//
+// Two-phased constructor.
+CPSMNetworkPlugin* CPSMNetworkPlugin::NewL( TPsmPluginCTorParams& aInitParams )
+	{
+	CPSMNetworkPlugin* self = new ( ELeave ) CPSMNetworkPlugin( aInitParams );
+
+	CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+	}
+
+// ----------------------------------------------------------------------------------
+// CPSMNetworkPlugin::~CPSMNetworkPlugin()
+// ----------------------------------------------------------------------------------
+//
+// Destructor.
+CPSMNetworkPlugin::~CPSMNetworkPlugin()
+	{
+    __GSLOGSTRING( "[CPSMNetworkPlugin::~CPSMNetworkPlugin]" );
+    delete iModel;
+    iModel = NULL;
+	}
+
+// ---------------------------------------------------------
+// CPSMNetworkPlugin::IsPhoneOfflineL
+//
+// Checks if phone is in offline mode or not.
+// Return ETrue if phone is in offline mode.
+// Return EFalse if phone is not in offline mode.
+// ---------------------------------------------------------
+//
+TBool CPSMNetworkPlugin::IsPhoneOfflineL() const
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) )
+        {
+        CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs );
+        TInt connAllowed = 1;
+        repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed );
+        CleanupStack::PopAndDestroy();  // repository
+        if ( !connAllowed )
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+// ----------------------------------------------------------------------------------
+// CPSMNetworkPlugin::NotifyModeChange()
+// ----------------------------------------------------------------------------------
+//
+void CPSMNetworkPlugin::NotifyModeChange( const TInt aMode )
+    {
+    TInt err = KErrNone;
+    TRAP( err, DoModeChangeL( aMode ) );
+    if ( KErrNone != err)
+        {}
+    __GSLOGSTRING2( "[CPSMNetworkPlugin::NotifyModeChange]: Mode:%d Err:%d", aMode, err );
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CPSMNetworkPlugin::NotifyModeChange()
+// ----------------------------------------------------------------------------------
+//
+void CPSMNetworkPlugin::DoModeChangeL( const TInt aMode )
+    {
+    if ( !IsPhoneOfflineL() && 
+         FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) &&
+         iModel->IsNetworkModeVisible() )
+        {
+        RConfigInfoArray infoArray;
+    
+        TPsmsrvConfigInfo info1;
+        info1.iConfigId = ENetworkMode;
+        info1.iConfigType = EConfigTypeInt;
+        info1.iIntValue = iModel->GetNetworkMode();
+        infoArray.Append( info1 );
+    
+        __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL] Switching to mode:%d", aMode );
+    
+        __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL]: oldValue info1: %d", infoArray[0].iIntValue );
+    
+        iSettingsProvider.BackupAndGetSettingsL( infoArray, KPSMNetworkPluginStorageId );
+        
+        __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL]: newValue info1: %d", infoArray[0].iIntValue );
+    
+        // Don't change the network mode if there is ongoing phone call
+        // since this will disconnect it
+        if ( !iModel->IsCallActive() )
+            {
+            iModel->SetNetworkModeL ( infoArray[0].iIntValue  );
+            }
+        
+        infoArray.Reset();       
+        }
+    }
+
+//End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSNetworkPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSNetworkPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsnetworkplugin.iby )
+../rom/GSNetworkPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsnetworkpluginresources.iby )
+loc/GsNetworkPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsnetworkplugin.loc )
+
+#ifdef FF_POWER_SAVE
+	// PSM Config files for emulator use
+	Data/2000B593.xml  /epoc32/release/winscw/urel/z/private/2000b187/2000b593.xml
+	Data/2000B593.xml  /epoc32/release/winscw/udeb/z/private/2000b187/2000b593.xml
+
+	// PSM Config files for HW use
+	Data/2000B593.xml  /epoc32/data/z/private/2000b187/2000b593.xml
+#endif // FF_POWER_SAVE
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsnetworkplugin.mif
+  OPTION HEADERFILE gsnetworkplugin.mbg
+  OPTION SOURCES \
+    -c8,8 qgn_prop_set_network_sub -c8,8 qgn_prop_set_network_sub_offline -c8,8 qgn_prop_set_network_tab4 \
+		-c8,1 qgn_prop_network_3g -c8,1 qgn_prop_network_2g
+END
+
+
+PRJ_MMPFILES
+GSNetworkPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSNetworkPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSNetworkPlugin/loc/GsNetworkPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSNetworkPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d: title for call settings folder
+//l: list_single_large_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_folder_network "Network"
+
+//CELLULAR NETWORK FOLDER
+//d: title to network settings folder in gs folder
+//l: title_pane_t2/opt9
+//
+#define qtn_set_title_settings_network "GSM network settings"
+
+//d: first item in network settings folder
+//l: list_setting_pane_t1
+//
+#define qtn_netsl_netselect "Network selection"
+
+//d: network selection setting page option "manual"
+//l: list_set_graphic_pane_t1
+//
+#define qtn_netsl_manual "Manual"
+
+//d: network selection setting page option "automatic"
+//l: list_set_graphic_pane_t1
+//
+#define qtn_netsl_automatic "Automatic"
+
+//d: network selection setting page heading
+//l: list_setting_pane_t1
+//
+#define qtn_netsl_netselectmode "Network selection mode:"
+
+//d: heading when networks are retrieved
+//l: heading_pane_t1
+//
+#define qtn_netsl_foundoperators "Found operators:"
+
+//d: mcn display settings item turned on
+//l: list_set_graphic_pane_t1
+//
+#define qtn_mcn_sett_off "Off"
+
+//d: mcn display settings item turned on
+//l: list_set_graphic_pane_t1
+//
+#define qtn_mcn_sett_on "On"
+
+//d: wait note text when searching for networks
+//l: popup_note_wait_window
+//
+#define text_searching "Searching..."
+
+//d: error note text when networks were searched, but nothing was found
+//l: popup_note_window
+//
+#define text_no_networks_found "No network found"
+
+//d: error note text when user is about to change network mode but there
+//d: is an ongoing call
+//l: popup_note_window
+//
+#define text_call_in_progress "Call in progress"
+
+//d: error note text when user has changed MCN on and there's a GPRS
+//d: connection active
+//l: popup_note_window
+//
+#define qtn_mcn_info_not_received "Cell info may not always be shown while packet data connection is active"
+
+//d: mcn display settings item heading
+//l: list_setting_pane_t1
+//
+#define qtn_mcn_control "Cell info display "
+
+//d: first item in network settings folder
+//l: list_setting_pane_t1
+//
+#define qtn_set_network_mode "Network Mode"
+
+//d: network mode ui setting page option "GSM"
+//l: list_set_graphic_pane_t1
+//
+#define qtn_network_mode_gsm "GSM"
+
+//d: network mode ui setting page option "UMTS"
+//l: list_set_graphic_pane_t1
+//
+#define qtn_network_mode_umts "UMTS"
+
+//d: network mode ui setting page option "Dual mode"
+//l: list_set_graphic_pane_t1
+//
+#define qtn_network_mode_dual "Dual mode"
+
+//d:Text of a list item in Network setting list view's list
+// d: Confirmation for Network mode selection operation.
+// l: popup_note_window
+//w:
+//r: 3.1
+#define qtn_network_mode_note "Network mode %U selected."
+
+//SERVICE REQUEST STUFF
+
+//d: text to confirmation note when roaming network selected
+//d: %U is the name of the network
+//l: popup_note_window
+//
+#define qtn_netsl_networkselected "Selected network: %U"
+
+//d: text to error note when error encountered
+//d: when trying to register into network
+//l: popup_note_window
+//
+#define text_no_access "No access"
+
+//d: text to confirmation note when home network selected
+//l: popup_note_window
+//
+#define text_hplmn_selected "Home network selected"
+
+//d: text to confirmation note registration to network cancelled
+//l: popup_note_window
+//
+#define qtn_netsl_registration_interrup "Registration interrupted"
+
+//d: Network operational and operator name text in lbx item 2nd row.
+//d: U% is the name of the operator.
+//l: list_double_large_graphic_pane_t2
+//
+//#define qtn_cp_detail_cellular_operational "Operational, %U"
+
+//d: Network off-line text in lbx item 2nd row.
+//l: list_double_large_graphic_pane_t2
+//
+#define qtn_cp_detail_cellular_offline "Off-line"
+
+//CONTROL PANEL
+
+//d:Text when settings item is blocked.
+//l:popup_note_window
+//w: 
+//r:5.1
+//
+#define qtn_power_saving_protected_settings_infonote "Power saving is active. Unable to edit."
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/1028331A.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Optical Joystick Settings Plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x1028331A;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x1028331B;
+                    version_no          = 1;
+                    display_name        = "Optical Joystick Settings Plugin";
+                    default_data        = "0x10283317";// Parent UID
+                    opaque_data         = "15";//Order number
+                    }
+                };
+            }
+        };
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/GSOpticalJoystickPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for Optical Joystick
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    OptJ // 4 letter ID
+
+//  INCLUDES
+#include    "GSOpticalJoystickPlugin.hrh"
+#include    <gsopticaljoystickplugin.loc>
+
+#include    <gs.loc>
+#include    <gscommon.rh>
+#include    <appinfo.rh>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <AvkonIcons.hrh>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+
+RESOURCE TBUF
+    {
+    buf="OptJ";
+    }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+
+//----------------------------------------------------
+//  r_gs_opticaljoystick_view_caption
+//
+// Data call view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_opticaljoystick_view_caption
+    {
+    buf = qtn_set_optical_joystick;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_csd_view_title
+//    Data call view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_opticaljoystick_view_title
+    {
+    txt = qtn_set_optical_joystick;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_dcall_view
+//    Data call view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_opticaljoystick_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_dcall_lbx
+//    Data call view's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_opticaljoystick_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_set_optical_joystick"\t\t";
+            item = KGSSettIdOptJoyst;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_opticaljoystick_setting_page
+//    Optical joystick setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_opticaljoystick_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_optical_joystick;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_opticaljoystick_setting_page_lbx
+//    Optical joystick setting page's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_opticaljoystick_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_optical_joystick_off;
+            },
+        LBUF
+            {
+            txt = qtn_set_optical_joystick_on;
+            }
+        };
+    }
+    
+RESOURCE TBUF r_optical_joystick_on
+    {
+    buf = qtn_set_optical_joystick_on;
+    }
+    
+RESOURCE TBUF r_optical_joystick_off
+    {
+    buf = qtn_set_optical_joystick_off;
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/GSOpticalJoystickPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file.
+*
+*/
+
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+// To get the MW_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsopticaljoystickplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x1028331A
+VENDORID            VID_DEFAULT
+
+
+SOURCEPATH  Src
+SOURCE      GSOpticalJoystickPluginImplementationTable.cpp
+SOURCE      GSOpticalJoystickPluginContainer.cpp
+SOURCE      GSOpticalJoystickPlugin.cpp
+
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Logger
+USERINCLUDE     ../Data // For GSCommonResources.rss
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  1028331A.rss
+TARGET          gsopticaljoystickplugin.rsc
+END
+
+START RESOURCE  GSOpticalJoystickPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   cone.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   egul.lib
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   commdb.lib
+LIBRARY   centralrepository.lib
+
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   flogger.lib // For GSLogger
+LIBRARY   gsecomplugin.lib
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for GSOpticalJoystickPlugin
+*
+*/
+
+#ifndef GSOPTICALJOYSTICKPLUGIN_H
+#define GSOPTICALJOYSTICKPLUGIN_H
+
+// INCLUDES
+#include <aknsettingpage.h>
+#include <gsbaseview.h>
+#include <ConeResLoader.h>
+#include <gsplugininterface.h>
+
+
+//CONSTANTS
+const TUid KGSOpticalJoystickPluginUid = { 0x1028331B };
+_LIT( KGSOpticalJoystickPluginIconDirAndName, "z:GSOpticalJoystickPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CAknViewAppUi;
+class CGSOpticalJoystickPluginContainer;
+class CGSOpticalJoystickPluginModel;
+
+// CLASS DEFINITION
+/**
+*  CGSOpticalJoystickPlugin view class for data call settings
+*  @since Series 60_3.1
+*
+*/
+class CGSOpticalJoystickPlugin : public CGSBaseView,
+                                 public MAknSettingPageObserver
+    {
+    public:
+        enum TGSSettingIds
+            {
+            KGSOpticalJoystickSettingId
+            };
+
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS connection view.
+        */
+        static CGSOpticalJoystickPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor
+        */
+        ~CGSOpticalJoystickPlugin();
+
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    public: // from MAknSettingPageObserver
+
+        /**
+        * Handle setting page events
+        */
+        virtual void HandleSettingPageEventL( CAknSettingPage* aSettingPage,
+                                            TAknSettingPageEvent aEventType );
+
+    public: // from base classes
+
+        /**
+        * Returns view id.
+        * @return TUid
+        */
+        TUid Id() const;
+
+        /**
+        * Handles commands.
+        * @param aCommand Command to be handled.
+        *
+        */
+        void HandleCommandL( TInt aCommand );
+
+    public: // new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aItemId An item which is updated.
+        *
+        */
+        void UpdateListBoxL( TInt aItemId );
+
+        /**
+        * Get CGSOpticalJoystickPlugin's ccontainer.
+        */
+        CGSOpticalJoystickPluginContainer* Container();
+
+    protected: // From CAknView
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        void DoDeactivate();
+    
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CGSOpticalJoystickPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        *
+        */
+        void ConstructL();
+
+        void HandleClientRectChange();
+
+    private: // from CGSBaseView
+
+        void NewContainerL();
+        void HandleListBoxSelectionL();
+
+    private: // new methods
+
+        /**
+        * Display dialup auto disconnect setting page.
+        */
+        void ShowSettingPageL();
+
+    private:
+        // resource loader
+        RConeResourceLoader iResourceLoader;
+
+    };
+
+#endif //GSOPTICALJOYSTICKPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains common definitions for menu id:s
+*
+*/
+
+
+#ifndef GSOPTICALJOYSTICKPLUGIN_HRH
+#define GSOPTICALJOYSTICKPLUGIN_HRH
+
+// commands
+enum TGSOpticalJoystickMenuCommands
+    {
+    EAppCmdChange = 1
+    };
+    
+    
+enum TSettingId
+    {
+    KGSSettIdOptJoyst
+    };
+
+#endif //  GSOPTICALJOYSTICKPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Optical Joystick
+*
+*/
+
+
+#ifndef GSOPTICALJOYSTICKPLUGINCONTAINER_H
+#define GSOPTICALJOYSTICKPLUGINCONTAINER_H
+
+// INCLUDES
+#include <bldvariant.hrh>
+#include <gsbasecontainer.h>
+
+#include "gssettingid.h"
+
+// FORWARD DECLARATION
+class CGSListBoxItemTextArray;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  CGSOpticalJoystickPluginContainer container class
+*  @since Series 60_3.1
+* 
+*/
+class CGSOpticalJoystickPluginContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS constructor.
+        * @param aRect Listbox's rect.
+        * 
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CGSOpticalJoystickPluginContainer();
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aFeatureId An item which is updated.
+        * 
+        */
+        void UpdateListBoxL( TInt aFeatureId );
+
+        /**
+        * Retrieves the currently selected listbox feature id
+        * @return feature id.
+        */
+        TInt CurrentFeatureId() const;
+        
+        /**
+        * Set the status of optical joystick
+        * @param aStatus Status of the optical joystick.
+        */
+        void GetOpticalJoystickStatus(TInt& aStatus);
+
+        /**
+        * Set the status of optical joystick
+        * @param aStatus Status of the optical joystick to be set to.
+        */
+        void SetOpticalJoystickStatusL(TInt aStatus);
+
+    protected: // from CGSBaseContainer
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private: // new
+        void CreateListBoxItemsL();
+        void MakeFocusedItemContentL();
+    
+    private:
+        /**
+        * Required for help.
+        * 
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+    
+    private: // data
+        //Auto disconnect list item
+        CDesCArrayFlat* iAutodisconValue;
+        //Listbox item array model
+        CGSListBoxItemTextArray* iListboxItemArray;
+        //Repository to access optical joystick status
+        CRepository* iPersonalizationRepository;
+    };
+
+#endif //GSOPTICALJOYSTICKPLUGINCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,416 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Optical joystick
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSOpticalJoystickPlugin.h"
+#include "GSOpticalJoystickPluginContainer.h"
+#include "GSOpticalJoystickPlugin.hrh"
+#include "GsLogger.h"
+#include <gsopticaljoystickplugin.mbg> // Icons
+#include <GSOpticalJoystickPluginRsc.rsg>
+#include <gsfwviewuids.h>
+#include <gsprivatepluginproviderids.h>
+
+#include <AknQueryDialog.h>
+#include <aknradiobuttonsettingpage.h>
+#include <aknViewAppUi.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <bautils.h>
+#include <coeaui.h>
+#include <e32svr.h>
+#include <eikfrlbd.h>
+#include <gulicon.h>
+#include <hlplch.h>             // For HlpLauncher
+
+#include <gscommon.hrh>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+_LIT( KGSOpticalJoystickPluginResourceFileName, "z:GSOpticalJoystickPluginRsc.rsc" );
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::CGSOpticalJoystickPlugin()
+//
+// Constructor
+// ----------------------------------------------------------------------------
+//
+CGSOpticalJoystickPlugin::CGSOpticalJoystickPlugin()
+  : iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::NewL()
+//
+// Symbian OS default constructor
+// ---------------------------------------------------------------------------
+CGSOpticalJoystickPlugin* CGSOpticalJoystickPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSOpticalJoystickPlugin* self = new( ELeave ) CGSOpticalJoystickPlugin ();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::ConstructL()
+//
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------------------------
+void CGSOpticalJoystickPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    // Find the resource file
+    TParse parse;
+    parse.Set( KGSOpticalJoystickPluginResourceFileName,
+               &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+
+    // Open resource file
+    iResourceLoader.OpenL( fileName );
+
+    BaseConstructL( R_GS_OPTICALJOYSTICK_VIEW );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::~CGSOpticalJoystickPlugin
+//
+// Destructor
+// ----------------------------------------------------------------------------
+CGSOpticalJoystickPlugin::~CGSOpticalJoystickPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    iResourceLoader.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSOpticalJoystickPlugin::Id()
+//
+// Returns view's ID.
+// ---------------------------------------------------------------------------
+TUid CGSOpticalJoystickPlugin::Id() const
+    {
+    return KGSOpticalJoystickPluginUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::GetCaption
+//
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_OPTICALJOYSTICK_VIEW_CAPTION );
+
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::PluginProviderCategory
+//
+// A means to identify the location of this plug-in in the framework.
+// ----------------------------------------------------------------------------
+//
+TInt CGSOpticalJoystickPlugin::PluginProviderCategory() const
+    {
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::Visible
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSOpticalJoystickPlugin::Visible() const
+    {
+    if( FeatureManager::FeatureSupported( 193 /* KFeatureIdFfOfnFeature */) )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::HandleCommandL(TInt aCommand)
+//
+// Handles commands directed to this class.
+// ---------------------------------------------------------------------------
+void CGSOpticalJoystickPlugin::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EGSMSKCmdAppChange:
+        case EGSCmdAppChange:
+            HandleListBoxSelectionL();
+            break;
+        case EAknSoftkeyBack:
+            iAppUi->ActivateLocalViewL( KGSDeviceManagementPluginUid );
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::UpdateListBoxL
+//
+// Updates listbox items.
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::UpdateListBoxL( TInt aItemId )
+    {
+    if( Container() )
+        {
+        Container()->UpdateListBoxL( aItemId );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::Container
+//
+// Return handle to container class.
+// ----------------------------------------------------------------------------
+//
+CGSOpticalJoystickPluginContainer* CGSOpticalJoystickPlugin::Container()
+    {
+    return static_cast<CGSOpticalJoystickPluginContainer*>( iContainer );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::NewContainerL()
+//
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::NewContainerL()
+    {
+    iContainer = new( ELeave ) CGSOpticalJoystickPluginContainer;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::DoActivateL
+//
+// First method called by the Avkon framwork to invoke a view.
+// ----------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                     TUid aCustomMessageId,
+                                     const TDesC8& aCustomMessage )
+    {
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::DoDeactivate
+//
+// Called by the Avkon view framework when closing.
+// ----------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::DoDeactivate()
+    {
+    CGSBaseView::DoDeactivate();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::HandleListBoxSelectionL()
+//
+// Handles events raised through a rocker key.
+// ---------------------------------------------------------------------------
+void CGSOpticalJoystickPlugin::HandleListBoxSelectionL()
+    {
+    const TInt currentFeatureId = Container()->CurrentFeatureId();
+
+    switch ( currentFeatureId )
+        {
+        case KGSSettIdOptJoyst:
+            ShowSettingPageL();
+            break;
+       default:
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::HandleSettingPageEventL
+//
+// Handle any setting page related events
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::HandleSettingPageEventL( CAknSettingPage* /*aSettingPage*/,
+                                              TAknSettingPageEvent /*aEventType*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::ShowDialupAutodisconSettingPageL
+//
+// Display dialup auto disconnect setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::ShowSettingPageL()
+    {
+    TInt currentValue; // This value should be got from Hardware
+    TInt err = 0;
+    
+    Container()->GetOpticalJoystickStatus( currentValue );
+    
+    __GSLOGSTRING1("[CGSOpticalJoystickPlugin]--> ShowSettingPageL(), value: %d", currentValue );
+
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+                                     R_OPTICALJOYSTICK_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage(
+                                      R_OPTICALJOYSTICK_SETTING_PAGE,
+                                      currentValue, items );
+
+    dlg->SetSettingId( KGSOpticalJoystickSettingId );
+    dlg->SetSettingPageObserver( this );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        Container()->SetOpticalJoystickStatusL( currentValue );
+
+        __GSLOGSTRING1("[CGSOpticalJoystickPlugin]--> ShowSettingPageL(), value: %d", currentValue);
+
+        UpdateListBoxL( KGSSettIdOptJoyst );
+        }
+
+    CleanupStack::PopAndDestroy( items );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSOpticalJoystickPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSOpticalJoystickPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpOptiJoystick,
+        fp->FullName(),
+        EMbmGsopticaljoystickpluginQgn_prop_cp_opti_joystick,
+        EMbmGsopticaljoystickpluginQgn_prop_cp_opti_joystick_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSOpticalJoystickPlugin::DynInitMenuPaneL()
+//
+// dynamically handle help item if not supported
+// -----------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPlugin::DynInitMenuPaneL( TInt aResourceId, 
+                                          CEikMenuPane* aMenuPane )
+    {   
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+        
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ))
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,226 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for GSOpticalJoystickPlugin
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSOpticalJoystickPluginContainer.h"
+#include "GSOpticalJoystickPlugin.hrh"
+#include "GsLogger.h"
+#include <bldvariant.hrh>
+#include <GSOpticalJoystickPluginRsc.rsg>
+#include <centralrepository.h>
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <AknUtils.h>
+#include <csxhelp/cp.hlp.hrh>
+#include <gsfwviewuids.h>
+#include <gslistbox.h>
+#include <settingsinternalcrkeys.h>
+
+// These enumations could be found in ofn_hal_groups.h
+/**
+ * The OFN HAL group
+*/
+enum
+    {
+    EHalGroupOFN = 28
+    };
+
+/**
+ * Supported HAL functions
+ *
+*/
+enum TOFNHalFunction
+    {
+    EOFNSetPowerON,     // OFN Powering (ON/OFF)
+    EOFNGetPowerState   // For reading power state
+    };
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::ConstructL()
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::ConstructL( const TRect& aRect )
+    {
+    iPersonalizationRepository = CRepository::NewL( KCRUidPersonalizationSettings );
+
+    iListBox = new( ELeave ) CAknSettingStyleListBox;
+
+    BaseConstructL( aRect, R_GS_OPTICALJOYSTICK_VIEW_TITLE, R_OPTICALJOYSTICK_LBX );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::~CGSOpticalJoystickPluginContainer()
+// 
+// Destructor 
+// ---------------------------------------------------------------------------
+//
+CGSOpticalJoystickPluginContainer::~CGSOpticalJoystickPluginContainer()
+    {
+    delete iAutodisconValue;
+    delete iListboxItemArray;
+    if ( iPersonalizationRepository )
+        {
+        delete iPersonalizationRepository;
+        iPersonalizationRepository = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::ConstructListBoxL()
+// 
+// Construct the listbox from resource array.
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, 
+                                                 *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    CreateListBoxItemsL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::CreateListBoxItemsL()
+// 
+// Create listbox items.
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::CreateListBoxItemsL()
+    {
+    MakeFocusedItemContentL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::UpdateListBoxL()
+// 
+// Update listbox item.
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::UpdateListBoxL( TInt aFeatureId )
+    {
+    switch( aFeatureId )
+        {
+        case KGSSettIdOptJoyst:
+            MakeFocusedItemContentL();
+            break;
+        default:
+            break;
+        }
+
+    iListBox->HandleItemAdditionL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::MakeAutodisconItemL()
+// 
+// Create auto disconnect list item 
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::MakeFocusedItemContentL()
+    {
+    TInt currentStatus = 0;
+    GetOpticalJoystickStatus( currentStatus);
+    __GSLOGSTRING1("[CGSOpticalJoystickPluginContainer]--> MakeFocusedItemContentL(),  value: %d", currentStatus);
+
+    HBufC* buf = NULL;
+    switch( currentStatus )
+        {
+        case 1:
+            buf = iEikonEnv->AllocReadResourceL( R_OPTICAL_JOYSTICK_ON );
+            break;
+        case 0:
+            buf = iEikonEnv->AllocReadResourceL( R_OPTICAL_JOYSTICK_OFF );
+            break;
+        default:
+            buf = iEikonEnv->AllocReadResourceL( R_OPTICAL_JOYSTICK_OFF );
+            break;
+        }
+
+    TPtr bufPtr( buf->Des() );
+    iListboxItemArray->SetDynamicTextL( KGSSettIdOptJoyst, bufPtr );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( KGSSettIdOptJoyst, CGSListBoxItemTextArray::EVisible );
+
+    delete buf;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::GetHelpContext() const
+//  
+// Gets Help 
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_DEVICE_MANAGEMENT;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::CurrentFeatureId()
+//
+// Return the feature id of selected listitem  
+// ---------------------------------------------------------------------------
+//
+TInt CGSOpticalJoystickPluginContainer::CurrentFeatureId( ) const
+    {
+    return iListboxItemArray->CurrentFeature( );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::GetOpticalJoystickStatus()
+//
+// Get the status of optical joystick
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::GetOpticalJoystickStatus(TInt& aStatus)
+    {
+    TInt err = UserSvr::HalFunction( EHalGroupOFN, EOFNGetPowerState,
+                            &aStatus, reinterpret_cast<TAny*>( ETrue ) );
+    __GSLOGSTRING2( "[CGSOpticalJoystickPluginContainer::GetOpticalJoystickStatusL] err: %d, status: %d", err, aStatus );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSOpticalJoystickPluginContainer::SetOpticalJoystickStatus()
+//
+// Set the status of optical joystick
+// ---------------------------------------------------------------------------
+//
+void CGSOpticalJoystickPluginContainer::SetOpticalJoystickStatusL(TInt aStatus)
+    {
+    TInt err = UserSvr::HalFunction( EHalGroupOFN, EOFNSetPowerON, 
+                            reinterpret_cast<TAny*>( aStatus ), 
+                            reinterpret_cast<TAny*>( aStatus ) );
+    __GSLOGSTRING2( "[CGSOpticalJoystickPluginContainer::SetOpticalJoystickStatusL] err: %d, status: %d", err, aStatus );
+    User::LeaveIfError( iPersonalizationRepository->Set( KSettingsOpticalJoystickStatus, aStatus ) );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSOpticalJoystickPlugin
+*
+*/
+
+
+// INCLUDES
+#include "GSOpticalJoystickPlugin.h"
+
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// CONSTANTS
+const TImplementationProxy KGSOpticalJoystickPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x1028331B,	CGSOpticalJoystickPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSOpticalJoystickPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSOpticalJoystickPluginImplementationTable;
+	}
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*					GSOpticalJoystickPlugin.
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSOpticalJoystickPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsopticaljoystickplugin.iby )
+../rom/GSOpticalJoystickPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsopticaljoystickpluginresources.iby )
+loc/GSOpticalJoystickPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsopticaljoystickplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsopticaljoystickplugin.mif
+  OPTION HEADERFILE gsopticaljoystickplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_opti_joystick
+END
+
+PRJ_MMPFILES
+GSOpticalJoystickPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSOpticalJoystickPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/loc/GSOpticalJoystickPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSOpticalJoystickPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// NEW
+
+// **Optical Joystick VIEW
+
+//d:Text in title pane
+//d:Optical joystick setting list view
+//l:title_pane_t2/opt9
+//w:
+//r: 3.1
+//
+#define qtn_set_optical_joystick "Optical joystick"
+
+//d:Text of a list item in Optical joystick setting list view's list
+//d:Item opens Autodisconnect time setting page
+//l:list_setting_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_optical_joystick_on "On"
+
+
+// AUTODISCONNECT TIME
+
+//d:Item in Autodisconnect time setting page's list
+//d:Setting value User defined
+//l:list_set_graphic_pane_t1
+//w:
+//r: 3.1
+//
+#define qtn_set_optical_joystick_off "Off" 
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/GSPDataAccessPointPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for GSPDataAccessPointPlugin.
+*
+*/
+
+#include  <data_caging_paths.hrh>    //this is needed for RESOURCE_FILES_DIR
+#include  <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gspdataaccesspointplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10282DC5
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSPDataAccessPointModel.cpp
+SOURCE              GSPDataAccessPointPlugin.cpp
+SOURCE              GSPDataAccessPointPluginImplementationTable.cpp
+
+USERINCLUDE         ../Logger
+USERINCLUDE         data
+USERINCLUDE         ../Data
+USERINCLUDE         inc
+USERINCLUDE         loc
+
+// System Includes
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+//ECOM resource definition
+START RESOURCE      10282DC5.rss
+TARGET              gspdataaccesspointplugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END                 //  ECOM resource definition
+
+//PDataAccessPoint resources
+START RESOURCE      GSPDataAccessPointPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // PDataAccessPoint resources
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             centralrepository.lib
+LIBRARY             commdb.lib
+LIBRARY             commonengine.lib // RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             etel.lib // RPhone
+LIBRARY             etelpckt.lib // RPacketService
+LIBRARY             euser.lib
+LIBRARY             featmgr.lib // FeatureManager
+LIBRARY             flogger.lib // RFileLogger
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib // Base classes
+LIBRARY             gslistbox.lib // CGSListBoxItemTextArray
+LIBRARY             hlplch.lib // HlpLauncher
+LIBRARY             apgrfx.lib
+LIBRARY             centralrepository.lib
+
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10282DC5.rss
+DOCUMENT            GSPDataAccessPointPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information required for building GSPDataAccessPointPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSPDataAccessPointPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdataaccesspointplugin.iby )
+../rom/GSPDataAccessPointPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdataaccesspointpluginresources.iby )
+loc/GSPDataAccessPointPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdataaccesspointplugin.loc )
+
+PRJ_MMPFILES
+GSPDataAccessPointPlugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSPDataAccessPointPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/data/10282DC5.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSPDataAccessPointPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10282DC5;
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10282DC6;
+					version_no          = 1;
+					display_name        = "Packet Data Access Point";
+					default_data        = "0x1020724E"; // Parent UID
+					opaque_data         = "20"; // Order number
+					}
+				};
+			}
+		};
+	}
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/data/GSPDataAccessPointPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSPDataAccessPointPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        PDAP // 4 letter ID
+
+// INCLUDES
+#include    <gspdataaccesspointplugin.loc> // PDataAccessPoint localized strings
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+   
+//----------------------------------------------------
+//
+//    r_gs_PDataAccessPoint_view
+//    Active idle view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_pdataaccesspoint_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+
+
+// DIAL-UP ACCESS POINT NAME
+
+//----------------------------------------------------
+//
+//    r_dialup_ap_name_none
+//    Text resource for Dial-up access point name setting.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_dialup_ap_name_none
+    {
+    buf = qtn_selec_sett_val_field_none;
+    }
+
+//----------------------------------------------------
+//
+//    r_dialup_ap_name_setting_page
+//
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_dialup_ap_name_setting_page
+    {
+    label= qtn_set_dial_up_ap_gprs;
+    type = EEikCtEdwin;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    editor_resource_id = r_dialup_ap_name_edwin;
+    }
+
+//----------------------------------------------------
+//
+//    r_dialup_ap_name_edwin
+//    Dialup acces point name editor.
+//
+//----------------------------------------------------
+//
+RESOURCE EDWIN r_dialup_ap_name_edwin
+    {
+    width = 9;
+    lines = 5;
+    maxlength = 100;
+    numeric_keymap = EAknEditorStandardNumberModeKeymap;
+    allowed_input_modes = EAknEditorTextInputMode |EAknEditorNumericInputMode;
+    default_case = EAknEditorLowerCase;
+    avkon_flags = EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly;
+    flags = EEikEdwinNoLineOrParaBreaks;
+    }
+ 
+ //----------------------------------------------------
+//
+//    r_gs_pdataaccesspoint_plugin_caption
+//    Packet Data Accesspoint Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_pdataaccesspoint_plugin_caption
+    {
+    buf = qtn_set_dial_up_ap_gprs;
+    }
+    
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataAccessPointPlugin model.
+*
+*/
+
+#ifndef  GSPDATAACCESSPOINTMODEL_H
+#define  GSPDATAACCESSPOINTMODEL_H
+
+// INCLUDES
+// INCLUDES
+#include    <cdblen.h>
+#include    <centralrepository.h>
+#include    <e32property.h>
+#include    <etel.h>
+#include    <etelpckt.h>
+#include    <mmtsy_names.h>
+
+// CONSTANTS
+
+const TInt KAttachSettingWhenNeeded = 0;
+const TInt KAttachSettingWhenAvailable = 1;
+const TInt KGSMaxDAPName = KCommsDbSvrMaxFieldLength; 
+
+// CLASS DEFINITIONS
+
+class CRfsHandler;
+class CCommsDatabase;
+class CCommsDbTableView;
+
+/**
+*  CGSPDataAccessPointModel is the model class of GS app.
+*  It provides functions to get and set setting values.
+*/
+class   CGSPDataAccessPointModel : public CBase
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CGSPDataAccessPointModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSPDataAccessPointModel();
+
+    public: //new
+        /**
+        * Gets dialup access point name from commdb.
+        * @param aName Descriptor which will contain the dialup access point name.
+        *              Max length is KGSMaxDAPName.
+        * @return Error code.
+        */
+        TInt GetDialupAPNameL( TDes& aName );
+
+        /**
+        * Stores dialup access point name to commdb.
+        * @param aName Descriptor which contains the dialup access point name.
+        *              Max length is KGSMaxDAPName.
+        */
+        void SetDialupAPNameL( const TDesC& aName );
+
+    private: // Private constructors
+        /**
+        * Default C++ contructor
+        */
+        CGSPDataAccessPointModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Handle to Comms database.
+        CCommsDatabase* iCommsDb;
+        
+        // Handle to packet service.
+        RPacketService iPktService;
+        
+        // Handle to phone.
+        RPhone iPhone;
+        
+        // Handle to tel server.
+        RTelServer iTelServer;
+        
+        // Networking repository
+        CRepository* iNetworkRepository;
+
+    };
+
+
+#endif // GSPDATAACCESSPOINTMODEL_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataAccessPointPlugin implementation.
+*
+*/
+
+#ifndef GSPDATAACCESSPOINTPLUGIN_H
+#define GSPDATAACCESSPOINTPLUGIN_H
+
+// User includes
+
+// System includes
+#include <gsplugininterface.h>
+#include <aknview.h>
+#include <ConeResLoader.h>
+#include <eikclb.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class CGSPDataAccessPointModel;
+
+
+// Constants
+const TUid KGSPDataAccessPointPluginUID   = { 0x10282DC6 };
+_LIT( KPDataAccessPointResourceFileName, "z:GSPDataAccessPointPluginRsc.rsc" );
+
+// CLASS DECLARATION
+
+/**
+*  CGSPDataAccessPointPlugin view class.
+*
+* This class handles state and application logic of PDataAccessPoint settings.
+* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will
+* call HandleSelection() instead of DoActivate().
+*
+*/
+class CGSPDataAccessPointPlugin : public CGSPluginInterface
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSPDataAccessPointPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPDataAccessPointPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * See base class.
+        */
+        TGSListboxItemTypes ItemType();
+
+        /**
+        * See base class.
+        */
+        void GetValue( const TGSPluginValueKeys aKey,
+                       TDes& aValue );
+
+        /**
+        * See base class.
+        */
+        void HandleSelection( const TGSSelectionTypes aSelectionType );
+
+        /**
+        * See base class.
+        */
+        TGSMenuActivationItems MenuActivationItem();
+        
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSPDataAccessPointPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    protected: // From CAknView
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    private: // New
+
+        /**
+        * Show Access point setting page.
+        * 
+        */
+        void ShowAccessPointSettingPageL();
+
+        /**
+        * Opens localized resource file.
+        */
+        void OpenLocalizedResourceFileL(
+                        const TDesC& aResourceFileName,
+                        RConeResourceLoader& aResourceLoader );
+        
+        /**
+        * Leaving version of GetValue()
+        */
+        void GetValueL( TDes& aValue );
+        
+    protected: // Data
+
+        // PDataAccessPoint model.
+        CGSPDataAccessPointModel* iModel;
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+    };
+
+#endif // GSPDATAACCESSPOINTPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/loc/GSPDataAccessPointPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSPDataAccessPointPlugin.
+*
+*/
+
+//  LOCALISATION STRINGS
+
+//d:Text of a list item in Packet data setting list view's list
+//d:Item opens Dial-up access point name setting page
+//l:list_setting_pane_t1
+//w:
+//r:4.0
+//
+#define qtn_set_dial_up_ap_gprs "Access point"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for GSPDataAccessPointPlugin.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "GSPDataAccessPointModel.h"
+#include    "GsLogger.h"
+
+#include    <commdb.h>
+#include    <featmgr.h>
+#include    <commdb.h>
+#include    <settingsinternalcrkeys.h>
+
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataAccessPointModel::NewL
+//
+// EPOC two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSPDataAccessPointModel* CGSPDataAccessPointModel::NewL()
+    {
+    CGSPDataAccessPointModel* self = new( ELeave ) CGSPDataAccessPointModel;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataAccessPointModel::CGSPDataAccessPointModel
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CGSPDataAccessPointModel::CGSPDataAccessPointModel()
+    {
+    __GSLOGSTRING( "[CGSPDataAccessPointModel] CGSPDataAccessPointModel()" );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataAccessPointModel::ConstructL
+//
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointModel::ConstructL()
+    {
+    iCommsDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    iNetworkRepository = 
+        CRepository::NewL( KCRUidNetworkSettings );
+    if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) )
+        {
+        User::LeaveIfError( iTelServer.Connect() );
+        User::LeaveIfError( iPhone.Open( iTelServer, KMmTsyPhoneName ) );
+        User::LeaveIfError( iPktService.Open( iPhone ) );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataAccessPointModel::~CGSPDataAccessPointModel
+//
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSPDataAccessPointModel::~CGSPDataAccessPointModel()
+    {
+    if ( iNetworkRepository )
+        {
+        delete iNetworkRepository;
+        }
+    delete iCommsDb;
+    if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) )
+        {
+        iPktService.Close();
+        iPhone.Close();
+        iTelServer.Close();
+        }
+    __GSLOGSTRING( "[CGSPDataConnectionModel] Handles closed." );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataModel::GetDialupAPNameL
+//
+// Gets dial-up acces point name.
+// ----------------------------------------------------------------------------
+//
+TInt CGSPDataAccessPointModel::GetDialupAPNameL( TDes& aName )
+    {
+    CCommsDbTableView* table = iCommsDb->OpenTableLC( TPtrC( DEFAULT_GPRS ) );
+    table->GotoFirstRecord();
+
+    //If dialup AP name is not initialized, ReadTextL will leave
+    TRAPD( error, table->ReadTextL( TPtrC( GPRS_APN), aName ) );
+    CleanupStack::PopAndDestroy( table );
+    return error;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataModel::SetDialupAPNameL
+//
+// Sets dial-up acces point name.
+// ----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointModel::SetDialupAPNameL( const TDesC& aName )
+    {
+    CCommsDbTableView* table = iCommsDb->OpenTableLC( TPtrC( DEFAULT_GPRS ) );
+    table->GotoFirstRecord();
+    User::LeaveIfError( table->UpdateRecord() );
+    table->WriteTextL( TPtrC( GPRS_APN ),aName );
+    User::LeaveIfError( table->PutRecordChanges() );
+    CleanupStack::PopAndDestroy( table );
+
+    if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) )
+        {
+        TRequestStatus status;
+        RPacketContext::TContextConfigGPRS params;
+        TPckg< RPacketContext::TContextConfigGPRS > paramsBuf( params );
+
+        if ( aName.Length() <= params.iAccessPointName.MaxLength() )
+            {
+            params.iAccessPointName.Copy( aName );
+            iPktService.SetDefaultContextParams( status, paramsBuf );
+            User::WaitForRequest( status );
+            }
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,308 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataAccessPointPlugin implementation.
+*
+*/
+
+
+// User includes
+#include    "GSPDataAccessPointPlugin.h"
+#include    "GSPDataAccessPointModel.h"
+#include    <gsparentplugin.h>
+#include    <gscommon.hrh>
+#include    <GSPDataAccessPointPluginRsc.rsg> // GUI Resource
+#include    <gsprivatepluginproviderids.h>
+#include    <gsfwviewuids.h>
+
+// System includes
+#include    <aknnotewrappers.h>
+#include    <aknradiobuttonsettingpage.h>
+#include    <akntextsettingpage.h>
+#include    <aknViewAppUi.h>
+#include    <bautils.h>
+#include    <featmgr.h>
+#include    <hlplch.h> // HlpLauncher
+#include    <StringLoader.h>
+#include    <telephonydomainpskeys.h>
+#include    <apgtask.h>
+
+// Constants
+const TInt KGSBufSize128 = 128;
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::CGSPDataAccessPointPlugin()
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataAccessPointPlugin::CGSPDataAccessPointPlugin()
+    : iResources( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::~CGSPDataAccessPointPlugin()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataAccessPointPlugin::~CGSPDataAccessPointPlugin()
+    {
+    iResources.Close();
+
+    if( iModel )
+        {
+        delete iModel;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::ConstructL()
+    {
+    iModel = CGSPDataAccessPointModel::NewL();
+    OpenLocalizedResourceFileL( KPDataAccessPointResourceFileName, iResources );
+    BaseConstructL( R_GS_PDATAACCESSPOINT_VIEW );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataAccessPointPlugin* CGSPDataAccessPointPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSPDataAccessPointPlugin* self = new( ELeave ) CGSPDataAccessPointPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::Id
+//
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSPDataAccessPointPlugin::Id() const
+    {
+    return KGSPDataAccessPointPluginUID;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::DoActivateL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                  TUid /*aCustomMessageId*/,
+                                  const TDesC8& /*aCustomMessage*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::DoDeactivate
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::DoDeactivate()
+    {
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::GetCaptionL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    HBufC* result = StringLoader::LoadL( R_GS_PDATAACCESSPOINT_PLUGIN_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::PluginProviderCategory
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSPDataAccessPointPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::ItemType()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSListboxItemTypes CGSPDataAccessPointPlugin::ItemType()
+    {
+    return EGSItemTypeSettingDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::GetValue()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::GetValue( const TGSPluginValueKeys aKey,
+                                    TDes& aValue )
+    {
+    TRAPD( err, GetValueL( aValue ) );
+    if ( err != KErrNone )
+        {
+        CGSPluginInterface::GetValue( aKey, aValue );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::GetValueL()
+//
+// Leaving version of GetValue()
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::GetValueL( TDes& aValue )
+    {
+    HBufC* name = HBufC::NewLC( KGSBufSize128 );
+    TPtr ptrBuffer ( name->Des() );
+    HBufC* dynamicText = name;
+    if ( iModel->GetDialupAPNameL( ptrBuffer ) != KErrNone
+         || ptrBuffer.Length() == 0 )
+        {
+        dynamicText = iEikonEnv->AllocReadResourceL( R_DIALUP_AP_NAME_NONE );
+        }
+    TPtr bufPtr( dynamicText->Des() );
+		aValue.Copy( *dynamicText );
+    CleanupStack::PopAndDestroy( name );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::HandleSelection()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::HandleSelection(
+    const TGSSelectionTypes aSelectionType )
+    {
+    switch( aSelectionType )
+        {
+        case EGSSelectionBySelectionKey:
+        case EGSSelectionByMenu:
+            TRAP_IGNORE( ShowAccessPointSettingPageL() );
+            break;
+        }
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::ShowAccessPointSettingPageL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::ShowAccessPointSettingPageL()
+    {
+		TBuf<KGSMaxDAPName> name;
+    //returns error code, no need to check the value
+    //(it doesn't matter if 'name' is empty)
+    iModel->GetDialupAPNameL( name );
+
+    CAknTextSettingPage* dlg = new( ELeave ) CAknTextSettingPage(
+        R_DIALUP_AP_NAME_SETTING_PAGE,
+        name,
+        CAknTextSettingPage::EZeroLengthAllowed );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        iModel->SetDialupAPNameL( name );
+        // Update AI item's value to lbx:
+    	CGSParentPlugin* parent = static_cast<CGSParentPlugin*>(
+            AppUi()->View( KGSPDataPluginUid ) );// This is the parent plugin
+        parent->UpdateView();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::OpenLocalizedResourceFileL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataAccessPointPlugin::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    aResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataAccessPointPlugin::TGSMenuActivationItems()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSMenuActivationItems CGSPDataAccessPointPlugin::MenuActivationItem()
+    {
+    return EGSMenuActivationItemChange;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSPDataAccessPointPlugin.
+*
+*/
+
+
+// User includes
+#include "GSPDataAccessPointPlugin.h"
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// Constants
+const TImplementationProxy KGSPDataAccessPointSettingsPluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x10282DC6,  CGSPDataAccessPointPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = sizeof( KGSPDataAccessPointSettingsPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+    return KGSPDataAccessPointSettingsPluginImplementationTable;
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/GSPDataConnectionPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for GSPDataConnectionPlugin.
+*
+*/
+
+#include  <data_caging_paths.hrh>    //this is needed for RESOURCE_FILES_DIR
+#include  <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gspdataconnectionplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10282DC3
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSPDataConnectionModel.cpp
+SOURCE              GSPDataConnectionPlugin.cpp
+SOURCE              GSPDataConnectionPluginImplementationTable.cpp
+
+USERINCLUDE         ../Logger
+USERINCLUDE         data
+USERINCLUDE         ../Data
+USERINCLUDE         inc
+USERINCLUDE         loc
+
+// System Includes
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+//ECOM resource definition
+START RESOURCE      10282DC3.rss
+TARGET              gspdataconnectionplugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END                 //  ECOM resource definition
+
+//PDataConnection resources
+START RESOURCE      GSPDataConnectionPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // PDataConnection resources
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             centralrepository.lib
+LIBRARY             commdb.lib
+LIBRARY             commonengine.lib // RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             etel.lib // RPhone
+LIBRARY             etelpckt.lib // RPacketService
+LIBRARY             euser.lib
+LIBRARY             featmgr.lib // FeatureManager
+LIBRARY             flogger.lib // RFileLogger
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib // Base classes
+LIBRARY             gslistbox.lib // CGSListBoxItemTextArray
+LIBRARY             hlplch.lib // HlpLauncher
+LIBRARY             apgrfx.lib
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10282DC3.rss
+DOCUMENT            GSPDataConnectionPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information required for building GSPDataConnectionPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSPDataConnectionPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdataconnectionplugin.iby )
+../rom/GSPDataConnectionPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdataconnectionpluginresources.iby )
+loc/GSPDataConnectionPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdataconnectionplugin.loc )
+
+PRJ_MMPFILES
+GSPDataConnectionPlugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSPDataConnectionPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/data/10282DC3.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSPDataConnectionPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x10282DC3;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x10282DC4;
+                    version_no          = 1;
+                    display_name        = "Packet Data Connection";
+                    default_data        = "0x1020724E"; // Parent UID
+                    opaque_data         = "10"; // Order number
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/data/GSPDataConnectionPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSPDataConnectionPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        PDCP // 4 letter ID
+
+// INCLUDES
+#include    <gspdataconnectionplugin.loc> // PDataConnection localized strings
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_pdataconnection_plugin_caption
+//    Packet Data Connection Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_pdataconnection_plugin_caption
+    {
+    buf = qtn_set_attach;
+    }
+    
+//----------------------------------------------------
+//
+//    r_gs_PDataConnection_view
+//    Packet Data Connection view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_pdataconnection_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_pdataconnection_setting_page
+//    
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_pdataconnection_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_attach;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_pdataconnection_setting_page_lbx
+//    
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_pdataconnection_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_attach_avail;
+            },
+        LBUF
+            {
+            txt = qtn_set_attach_needed;
+            }
+        };
+    }
+
+    
+//----------------------------------------------------
+//
+//    r_gs_pdataconnection_on_text
+//    Packet Data Connection text for "when available".
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_pdataconn_when_enable_text
+    {
+    buf = qtn_set_attach_avail;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_pdataconnection_off_text
+//    Packet Data Connection text for "when needed".
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_pdataconn_when_needed_text
+    {
+    buf = qtn_set_attach_needed;
+    }
+    
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataConnectionPlugin model.
+*
+*/
+
+#ifndef  GSPDATACONNECTIONMODEL_H
+#define  GSPDATACONNECTIONMODEL_H
+
+// INCLUDES
+// INCLUDES
+#include    <centralrepository.h>
+#include    <e32property.h>
+#include    <etel.h>
+#include    <etelpckt.h>
+#include    <mmtsy_names.h>
+
+// CONSTANTS
+
+const TInt KAttachSettingWhenNeeded = 1;
+const TInt KAttachSettingWhenAvailable = 0;
+
+
+// CLASS DEFINITIONS
+
+class CRfsHandler;
+class CCommsDatabase;
+class CCommsDbTableView;
+
+
+/**
+*  CGSPDataConnectionModel is the model class of GS app.
+*  It provides functions to get and set setting values.
+*/
+class   CGSPDataConnectionModel : public CBase
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CGSPDataConnectionModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSPDataConnectionModel();
+
+    public: //new
+
+        /**
+        * Gets AI state.
+        */
+        TInt PDataAttachL();
+
+        /**
+        * Sets AI state.
+        */
+        void SetPDataAttachL( const TInt aAttach );
+
+
+    private: // Private constructors
+        /**
+        * Default C++ contructor
+        */
+        CGSPDataConnectionModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Flag to indicate whether the feature KFeatureIdLoggerGprs is supported
+        TBool iIsFeatureIdLoggerGprs;
+
+        // Handle to Comms database.
+        CCommsDatabase* iCommsDb;
+        
+        // Handle to packet service.
+        RPacketService iPktService;
+        
+        // Handle to phone.
+        RPhone iPhone;
+        
+        // Handle to tel server.
+        RTelServer iTelServer;
+
+    };
+#endif // GSPDATACONNECTIONMODEL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataConnectionPlugin implementation.
+*
+*/
+
+#ifndef GSPDATACONNECTIONPLUGIN_H
+#define GSPDATACONNECTIONPLUGIN_H
+
+// User includes
+
+// System includes
+#include <gsplugininterface.h>
+#include <aknview.h>
+#include <ConeResLoader.h>
+#include <eikclb.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class CGSPDataConnectionModel;
+
+
+// Constants
+const TUid KGSPDataConnectionPluginUID   = { 0x10282DC4};
+_LIT( KPDataConnectionResourceFileName, "z:GSPDataConnectionPluginRsc.rsc" );
+
+// CLASS DECLARATION
+
+/**
+*  CGSPDataConnectionPlugin view class.
+*
+* This class handles state and application logic of PDataConnection settings.
+* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will
+* call HandleSelection() instead of DoActivate().
+*
+*/
+class CGSPDataConnectionPlugin : public CGSPluginInterface
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSPDataConnectionPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPDataConnectionPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * See base class.
+        */
+        TGSListboxItemTypes ItemType();
+
+        /**
+        * See base class.
+        */
+        void GetValue( const TGSPluginValueKeys aKey,
+                       TDes& aValue );
+
+        /**
+        * See base class.
+        */
+        void HandleSelection( const TGSSelectionTypes aSelectionType );
+
+        /**
+        * See base class.
+        */
+        TGSMenuActivationItems MenuActivationItem();
+        
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSPDataConnectionPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    protected: // From CAknView
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    private: // New
+
+        /**
+        * Sets Attach state.
+        * Launches Setting Page for setting the item
+        */
+        void SetAttachStateL();
+
+        /**
+        * Launches Attach on/off dialog.
+        * @param aPDataConnectionState Current value of Attach state. This WILL BE
+        *        UPDATED to contain new user selected value.
+        * @return ETrue if value updated.
+        *         EFalse if value not updated.
+        */
+        TBool ShowAttachSettingPageL( TInt& aPDataConnectionState );
+
+        /**
+        * Opens localized resource file.
+        */
+        void OpenLocalizedResourceFileL(
+            const TDesC& aResourceFileName,
+            RConeResourceLoader& aResourceLoader );
+
+        /**
+        * Leaving version of GetValue()
+        */
+        void GetValueL( TDes& aValue );
+
+    protected: // Data
+
+        // PDataConnection model.
+        CGSPDataConnectionModel* iModel;
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+    };
+
+#endif // GSPDATACONNECTIONPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/loc/GSPDataConnectionPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSPDataConnectionPlugin.
+*
+*/
+
+//  LOCALISATION STRINGS
+
+// **PACKET DATA (CONNECTION) VIEW
+
+//d:Text of a list item in Packet data setting list view's list
+//d:Item opens Attach setting page
+//l:list_setting_pane_t1
+//w:
+//r:4.0
+//
+#define qtn_set_attach "Attach"
+
+// ATTACH
+
+//d:Text in setting list item's current value field
+//d:Item in Attach setting page's list
+//d:Setting value When available
+//l:list_set_graphic_pane_t1
+//w:
+//r:4.0
+//
+#define qtn_set_attach_avail "When available" 
+
+//d:Text in setting list item's current value field
+//d:Item in Attach setting page's list
+//d:Setting value When needed
+//l:list_set_graphic_pane_t1
+//w:
+//r:4.0
+//
+#define qtn_set_attach_needed "When needed" 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for GSPDataConnectionPlugin.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "GSPDataConnectionModel.h"
+#include    "GsLogger.h"
+
+#include    <commdb.h>
+#include    <featmgr.h>
+#include    <commdb.h>
+#include    <settingsinternalcrkeys.h>
+
+
+// CONSTANTS
+// Default values for some of the settings
+const   TUint32 KGSDefaultAttachMode = 0;               // when available
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataConnectionModel::NewL
+//
+// EPOC two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSPDataConnectionModel* CGSPDataConnectionModel::NewL()
+    {
+    CGSPDataConnectionModel* self = new( ELeave ) CGSPDataConnectionModel;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataConnectionModel::CGSPDataConnectionModel
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CGSPDataConnectionModel::CGSPDataConnectionModel()
+    {
+    iIsFeatureIdLoggerGprs = EFalse;
+    __GSLOGSTRING( "[CGSPDataConnectionModel] CGSPDataConnectionModel()" );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataConnectionModel::ConstructL
+//
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSPDataConnectionModel::ConstructL()
+    {
+    iCommsDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) )
+        {
+        iIsFeatureIdLoggerGprs = ETrue;
+        User::LeaveIfError( iTelServer.Connect() );
+        User::LeaveIfError( iPhone.Open( iTelServer, KMmTsyPhoneName ) );
+        User::LeaveIfError( iPktService.Open( iPhone ) );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataConnectionModel::~CGSPDataConnectionModel
+//
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSPDataConnectionModel::~CGSPDataConnectionModel()
+    {
+    delete iCommsDb;
+    if( iIsFeatureIdLoggerGprs )
+        {
+        iPktService.Close();
+        iPhone.Close();
+        iTelServer.Close();
+        }
+    __GSLOGSTRING( "[CGSPDataConnectionModel] Handles closed." );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataConnectionModel::PDataAttachL
+//
+// Returns packet data attach mode.
+// ----------------------------------------------------------------------------
+//
+TInt CGSPDataConnectionModel::PDataAttachL()
+    {
+    TUint32 attachMode = KGSDefaultAttachMode;
+    TRAPD( error, iCommsDb->GetGlobalSettingL( TPtrC( GPRS_ATTACH_MODE ),
+                                               attachMode ) );
+    if ( error == KErrNotFound )
+        {
+        iCommsDb->SetGlobalSettingL( TPtrC( GPRS_ATTACH_MODE ), attachMode );
+        }
+    else if ( error != KErrNone )
+        {
+        User::Leave( error );
+        }
+    return static_cast<TInt> ( attachMode );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPDataConnectionModel::SetPDataAttachL
+//
+// Sets packet data attach mode.
+// ----------------------------------------------------------------------------
+//
+void CGSPDataConnectionModel::SetPDataAttachL( const TInt aAttach )
+    {
+    iCommsDb->SetGlobalSettingL( TPtrC( GPRS_ATTACH_MODE ), aAttach );
+
+    if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) )
+        {
+        TRequestStatus status;
+        RPacketService::TAttachMode mode(
+            static_cast<RPacketService::TAttachMode> ( aAttach ) );
+        iPktService.SetAttachMode( status, mode );
+        User::WaitForRequest( status );
+        }
+        
+    }  
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,362 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataConnectionPlugin implementation.
+*
+*/
+
+
+// User includes
+#include    "GSPDataConnectionPlugin.h"
+#include    "GSPDataConnectionModel.h"
+#include    <gsparentplugin.h>
+#include    <gscommon.hrh>
+#include    <GSPDataConnectionPluginRsc.rsg> // GUI Resource
+#include    <gsprivatepluginproviderids.h>
+#include    <gsfwviewuids.h>
+
+// System includes
+#include    <aknnotewrappers.h>
+#include    <aknradiobuttonsettingpage.h>
+#include    <akntextsettingpage.h>
+#include    <aknViewAppUi.h>
+#include    <bautils.h>
+#include    <featmgr.h>
+#include    <hlplch.h> // HlpLauncher
+#include    <StringLoader.h>
+#include    <telephonydomainpskeys.h>
+#include    <apgtask.h>
+
+// Constants
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::CGSPDataConnectionPlugin()
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataConnectionPlugin::CGSPDataConnectionPlugin()
+    : iResources( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::~CGSPDataConnectionPlugin()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataConnectionPlugin::~CGSPDataConnectionPlugin()
+    {
+    iResources.Close();
+
+    if( iModel )
+        {
+        delete iModel;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::ConstructL()
+    {
+    iModel = CGSPDataConnectionModel::NewL();
+    OpenLocalizedResourceFileL( KPDataConnectionResourceFileName, iResources );
+    BaseConstructL( R_GS_PDATACONNECTION_VIEW );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataConnectionPlugin* CGSPDataConnectionPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSPDataConnectionPlugin* self = new( ELeave ) CGSPDataConnectionPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::Id
+//
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSPDataConnectionPlugin::Id() const
+    {
+    return KGSPDataConnectionPluginUID;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::DoActivateL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                  TUid /*aCustomMessageId*/,
+                                  const TDesC8& /*aCustomMessage*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::DoDeactivate
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::DoDeactivate()
+    {
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::GetCaptionL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    HBufC* result = StringLoader::LoadL( R_GS_PDATACONNECTION_PLUGIN_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::PluginProviderCategory
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSPDataConnectionPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::ItemType()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSListboxItemTypes CGSPDataConnectionPlugin::ItemType()
+    {
+    return EGSItemTypeSettingDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::GetValue()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::GetValue( const TGSPluginValueKeys aKey,
+                                         TDes& aValue )
+    {
+    TRAPD( err, GetValueL( aValue ) );
+    if ( err != KErrNone )
+        {
+        CGSPluginInterface::GetValue( aKey, aValue );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::GetValueL()
+//
+// Leaving version of GetValue()
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::GetValueL( TDes& aValue )
+    {
+    TInt attachState = iModel->PDataAttachL();
+    HBufC* result;
+
+    switch( attachState )
+        {
+        case KAttachSettingWhenAvailable:
+            result = StringLoader::LoadL( R_GS_PDATACONN_WHEN_ENABLE_TEXT );
+            aValue.Copy( *result );
+            delete result;
+            break;
+
+        case KAttachSettingWhenNeeded:
+            result = StringLoader::LoadL( R_GS_PDATACONN_WHEN_NEEDED_TEXT );
+            aValue.Copy( *result );
+            delete result;
+         default:
+            break;
+        }
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::HandleSelection()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::HandleSelection(
+    const TGSSelectionTypes aSelectionType )
+    {
+    switch( aSelectionType )
+        {
+        case EGSSelectionBySelectionKey:
+        case EGSSelectionByMenu:
+            TRAP_IGNORE( SetAttachStateL() ); // Launch setting page to change value.
+            break;
+        default:
+            break;
+        }
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::ShowAttachSettingPageL()
+//
+// Indexes of Attach on/off items in a listbox are not the same as aPDataConnectionState
+// value. Therefore matching between these two is required.
+// -----------------------------------------------------------------------------
+//
+TBool CGSPDataConnectionPlugin::ShowAttachSettingPageL( TInt& aPDataConnectionState )
+    {
+    TInt previousPDataConnectionState = aPDataConnectionState;
+    TBool isValueUpdated = EFalse;
+    
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( 
+                            R_GS_PDATACONNECTION_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+    
+    CAknRadioButtonSettingPage* dlg =
+        new (ELeave) CAknRadioButtonSettingPage
+                                 ( R_GS_PDATACONNECTION_SETTING_PAGE,
+                                   aPDataConnectionState,
+                                   items );
+    dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+    CleanupStack::PopAndDestroy( items );
+    
+    // Check if aPDataConnectionState has been changed:
+    if( previousPDataConnectionState != aPDataConnectionState )
+        {
+        isValueUpdated = ETrue;
+        }
+    return isValueUpdated;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::SetAttachStateL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::SetAttachStateL()
+    {
+    // Get information of if there are open connections
+    TInt PDataConnectionState = iModel->PDataAttachL();
+    const TBool isValueUpdated = ShowAttachSettingPageL( PDataConnectionState );
+    
+    if ( isValueUpdated )
+        {
+        // Store updated Active Idle state:
+        iModel->SetPDataAttachL( PDataConnectionState );
+        // Update Attach item's value to lbx:
+        CGSParentPlugin* parent = static_cast<CGSParentPlugin*>(
+            AppUi()->View( KGSPDataPluginUid ) );// This is the parent plugin
+        parent->UpdateView();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::OpenLocalizedResourceFileL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataConnectionPlugin::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    aResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin::TGSMenuActivationItems()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSMenuActivationItems CGSPDataConnectionPlugin::MenuActivationItem()
+    {
+    return EGSMenuActivationItemChange;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataConnectionPlugin
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSPDataConnectionPlugin::Visible() const
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdIpPush ))
+        {
+        return EFalse;
+        }
+    return ETrue;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSPDataConnectionPlugin.
+*
+*/
+
+
+// User includes
+#include "GSPDataConnectionPlugin.h"
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// Constants
+const TImplementationProxy KGSPDataConnectionSettingsPluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x10282DC4,  CGSPDataConnectionPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = sizeof( KGSPDataConnectionSettingsPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+    return KGSPDataConnectionSettingsPluginImplementationTable;
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/GSPDataHSDPAPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for GSPDataHSDPAPlugin.
+*
+*/
+
+#include  <data_caging_paths.hrh>    //this is needed for RESOURCE_FILES_DIR
+#include  <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gspdatahsdpaplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10282DC7
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSPDataHSDPAModel.cpp
+SOURCE              GSPDataHSDPAPlugin.cpp
+SOURCE              GSPDataHSDPAPluginImplementationTable.cpp
+
+USERINCLUDE         ../Logger
+USERINCLUDE         ../Cenrep
+USERINCLUDE         data
+USERINCLUDE         ../Data
+USERINCLUDE         inc
+USERINCLUDE         loc
+
+// System Includes
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+//ECOM resource definition
+START RESOURCE      10282DC7.rss
+TARGET              gspdatahsdpaplugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END                 //  ECOM resource definition
+
+//PDataHSDPA resources
+START RESOURCE      GSPDataHSDPAPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // PDataHSDPA resources
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             centralrepository.lib
+LIBRARY             commonengine.lib // RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             etel.lib // RPhone
+LIBRARY             etelpckt.lib // RPacketService
+LIBRARY             euser.lib
+LIBRARY             featmgr.lib // FeatureManager
+LIBRARY             flogger.lib // RFileLogger
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib // Base classes
+LIBRARY             gslistbox.lib // CGSListBoxItemTextArray
+LIBRARY             hlplch.lib // HlpLauncher
+LIBRARY             apgrfx.lib
+LIBRARY             centralrepository.lib
+LIBRARY	            customapi.lib
+LIBRARY             etelmm.lib
+LIBRARY             profileeng.lib
+LIBRARY             profileengine.lib
+#ifdef RD_STARTUP_CHANGE
+LIBRARY    	   starterclient.lib
+#endif
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10282DC7.rss
+DOCUMENT            GSPDataHSDPAPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information required for building GSPDataHSDPAPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSPDataHSDPAPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdatahsdpaplugin.iby )
+../rom/GSPDataHSDPAPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdatahsdpapluginresources.iby )
+loc/GSPDataHSDPAPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdatahsdpaplugin.loc )
+
+PRJ_MMPFILES
+#ifdef __HSXPA_SUPPORT
+    GSPDataHSDPAPlugin.mmp
+#endif
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSPDataHSDPAPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/data/10282DC7.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSPDataHSDPAPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10282DC7;
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10282DC8; //
+					version_no          = 1;
+					display_name        = "High-speed packet access";
+					default_data        = "0x1020724E"; // Parent UID
+					opaque_data         = "30"; // Order number
+					}
+				};
+			}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/data/GSPDataHSDPAPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSPDataHSDPAPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        HSPA // 4 letter ID
+
+// INCLUDES
+#include    <gspdatahsdpaplugin.loc>
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+
+//----------------------------------------------------
+//
+//    r_gs_pdatahsdpa_plugin_caption
+//    Packet Data HSDPA Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_pdatahsdpa_plugin_caption
+    {
+    buf = qtn_set_hspa_setting;
+    }
+    
+//----------------------------------------------------
+//
+//    r_gs_pdatahsdpa_view
+//    Packet Data HSDPA view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_pdatahsdpa_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_pdatahsdpa_setting_page
+//    
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_gs_pdatahsdpa_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_set_hspa_setting;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_pdatahsdpa_setting_page_lbx
+//    
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_gs_pdatahsdpa_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_set_hspa_setting_enabled;
+            },
+        LBUF
+            {
+            txt = qtn_set_hspa_setting_disabled;
+            }
+        };
+    }
+
+    
+//----------------------------------------------------
+//
+//    r_gs_pdatahsdpa_on_text
+//    Packet Data HSDPA text for HSDPA value on.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_hsdpa_enable_text
+    {
+    buf = qtn_set_hspa_setting_enabled;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_pdatahsdpa_off_text
+//    Packet Data HSDPA text for HSDPA value Disable.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_hsdpa_disable_text
+    {
+    buf = qtn_set_hspa_setting_disabled;
+    }
+
+
+// -----------------------------------------------------------------------------
+//     r_confirm_nw_reset_hsdpa
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_confirm_nw_reset_hsdpa
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_YES_NO__YES;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            itemflags = EEikDlgItemNonFocusing;
+            id = EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationLayout;
+                label = qtn_set_hspa_quest_change_via_offline;
+                animation = R_QGN_NOTE_QUERY_ANIM;
+                };
+            }
+        };
+    }  
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataHSDPAPlugin model.
+*
+*/
+
+#ifndef  GSPDATAHSDPAMODEL_H
+#define  GSPDATAHSDPAMODEL_H
+
+// INCLUDES
+// INCLUDES
+#include    <centralrepository.h>
+#include    <e32property.h>
+#include    <etel.h>
+#include    <etelpckt.h>
+#include    <mmtsy_names.h>
+#include    <rmmcustomapi.h>
+// CONSTANTS
+
+const TInt KSettingHsdpaDisable = 0;
+const TInt KSettingHsdpaEnable = 1;
+
+
+// CLASS DEFINITIONS
+
+class CRfsHandler;
+class RMmCustomAPI;
+class RMobilePhone;
+/**
+*  CGSPDataHSDPAModel is the model class of GS app.
+*  It provides functions to get and set setting values.
+*/
+class   CGSPDataHSDPAModel : public CBase
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CGSPDataHSDPAModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSPDataHSDPAModel();
+
+    public: //new
+                /**
+        * Returns packet data HSDPA state.
+        * @return 0: Disabled
+        *         1: Enabled
+        */
+        TInt CurrentHSDPAItemL();
+        
+        /**
+        * Set packet data HSDPA state.
+        * @param ahsdpaValue 0: Disabled
+        *                    1: Enabled
+        */
+        void SetHSDPAItemValueL( TInt aHsdpaValue );
+        
+                /**
+        * Returns packet data HSDPA state.
+        * @return 1: Show
+        *         0 : Hide
+        */
+        TInt HSDPAItemVisibilityL();
+        
+        /**
+        * Set packet data HSDPA Visibility.
+        * @param aHsdpaVisible 0: Hide
+        *                      1: Show
+        */
+        void SetHSDPAItemVisibilityL( TInt aHsdpaVisible );
+
+    private: // Private constructors
+        /**
+        * Default C++ contructor
+        */
+        CGSPDataHSDPAModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+
+    private: // Data
+        // Handle to tel server.
+        RTelServer iTelServer;
+        
+        //Handle to Custom API
+        RMmCustomAPI iCustomAPI;
+        
+        // Handle to Mobile phone.
+        RMobilePhone iMobilePhone ;
+        
+        // Networking repository
+        CRepository* iNetworkRepository;
+
+    };
+#endif // GSPDATAHSDPAMODEL_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,215 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataHSDPAPlugin implementation.
+*
+*/
+
+#ifndef GSPDATAHSDPAPLUGIN_H
+#define GSPDATAHSDPAPLUGIN_H
+
+// User includes
+
+// System includes
+#include <gsplugininterface.h>
+#include <aknview.h>
+#include <ConeResLoader.h>
+#include <eikclb.h>
+#include <gspubsubslistener.h>
+#include <mgssettingpsobserver.h>
+#include <MProfileEngine.h>
+#include <MProEngProfileActivationObserver.h>
+#include <MProEngNotifyHandler.h>
+
+// Classes referenced
+class CAknNavigationDecorator;
+class CAknViewAppUi;
+class CAknWaitDialog;
+class CGSPDataHSDPAModel;
+
+// Constants
+const TUid KGSPDataHSDPAPluginUID   = { 0x10282DC8 };
+_LIT( KPDataHSDPAResourceFileName, "z:GSPDataHSDPAPluginRsc.rsc" );
+
+// CLASS DECLARATION
+
+/**
+*  CGSPDataHSDPAPlugin view class.
+*
+* This class handles state and application logic of PDataHSDPA settings.
+* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will
+* call HandleSelection() instead of DoActivate().
+*
+*/
+class CGSPDataHSDPAPlugin : public CGSPluginInterface,
+                            public MGSSettingPSObserver,
+                            public MProEngProfileActivationObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSPDataHSDPAPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPDataHSDPAPlugin();
+
+	public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * See base class.
+        */
+        TGSListboxItemTypes ItemType();
+
+        /**
+        * See base class.
+        */
+        void GetValue( const TGSPluginValueKeys aKey,
+                       TDes& aValue );
+
+        /**
+        * See base class.
+        */
+        void HandleSelection( const TGSSelectionTypes aSelectionType );
+
+        /**
+        * See base class.
+        */
+        TGSMenuActivationItems MenuActivationItem();
+        
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    public: //From MProEngProfileActivationObserver
+    
+        /**
+        * Callback for device profile change
+        * Used for observing offline mode activation
+        */
+        void HandleProfileActivatedL( TInt aProfileId );
+
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSPDataHSDPAPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    protected: // From CAknView
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    private: // New
+
+        /**
+        * Sets HSDPA state.
+        * Launches a setting page with a confirmation dialog
+        */
+        void SetHSDPAStateL();
+
+        /**
+        * Opens localized resource file.
+        */
+        void OpenLocalizedResourceFileL(
+            const TDesC& aResourceFileName,
+            RConeResourceLoader& aResourceLoader );
+            
+        /**
+        * Resets all Active Connections, If Any.
+        */
+        void ResetActiveConnectionsL();
+        
+       /*
+        *
+        * Indexes of HSDPA on/off items in a listbox are not the same as 
+        * aPDataHSDPState value. Therefore matching between these two is 
+        * required.
+       */
+        TBool ShowHSDPASettingPageL( TInt& aHsdpaState );
+
+        /**
+        * Leaving version of GetValue()
+        */
+        void GetValueL( TDes& aValue );
+        
+        /**
+        *  Updating parent view
+        */
+        void UpdateParentViewL();
+    
+    private: // From MGSSettingPSObserver
+        /**
+        * Callback from MGSSettingPSObserver
+        */
+        void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
+                              const TRequestStatus& aStatus );
+
+    protected: // Data
+
+        // PDataHSDPA model.
+        CGSPDataHSDPAModel* iModel;
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+        
+        //PubSub object for NW mode state listener
+        CGSPubSubsListener* iNwModeListener;
+        
+        MProfileEngine* iProfileEngine;
+        MProEngNotifyHandler* iNotifyHandler;
+        
+        TInt iNetworkMode;
+        
+        TBool iHSDPASettingSupport;
+    };
+
+#endif // GSPDATAHSDPAPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/loc/GSPDataHSDPAPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSPDataHSDPAPlugin.
+*
+*/
+
+//  LOCALISATION STRINGS
+
+// **OPTIONS MENU
+// **PACKET DATA (CONNECTION) VIEW
+
+//d:Text of a list item in Packet data setting list view's list
+//d:Item opens High-speed packet access point name setting page
+//l:list_setting_pane_t1
+//w:
+//r:4.0
+//
+#define qtn_set_hspa_setting "High-speed packet access"
+
+
+
+//d:Text in setting list item's current value field
+//d:AHigh-speed packet access list item
+//d:Current value field text when current value is Enabled
+//l:list_set_graphic_pane_t1
+//w:
+//r:4.0
+//
+#define qtn_set_hspa_setting_enabled "Enabled"
+
+
+//d:Text in setting list item's current value field
+//d:AHigh-speed packet access list item
+//d:Current value field text when current value is Disabled
+//l:list_set_graphic_pane_t1
+//w:
+//r:4.0
+//
+#define qtn_set_hspa_setting_disabled "Disabled"
+
+//d:Used when changing hsdpa value
+//d:To ensure that all the current network connections are reset
+//d:Before actually changing the value in the UI
+//l:popup_note_window
+//w:
+//r:4.0
+//
+#define qtn_set_hspa_quest_change_via_offline  "All active connections will be disconnected. Continue?"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for GSPDataHSDPAPlugin.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "GSPDataHSDPAModel.h"
+#include    "GsLogger.h"
+
+#include    <featmgr.h>
+#include    <commdb.h>
+#include    <settingsinternalcrkeys.h>
+
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataHSDPAModel::NewL
+//
+// EPOC two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSPDataHSDPAModel* CGSPDataHSDPAModel::NewL()
+    {
+    CGSPDataHSDPAModel* self = new( ELeave ) CGSPDataHSDPAModel;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataHSDPAModel::CGSPDataHSDPAModel
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CGSPDataHSDPAModel::CGSPDataHSDPAModel()
+    {
+    __GSLOGSTRING( "[CGSPDataHSDPAModel] CGSPDataHSDPAModel()" );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataHSDPAModel::ConstructL
+//
+// EPOC default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAModel::ConstructL()
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) )
+        {
+        User::LeaveIfError( iTelServer.Connect() );
+        User::LeaveIfError( iMobilePhone.Open( iTelServer, KMmTsyPhoneName ) );
+        User::LeaveIfError( iCustomAPI.Open( iMobilePhone ) );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataHSDPAModel::~CGSPDataHSDPAModel
+//
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSPDataHSDPAModel::~CGSPDataHSDPAModel()
+    {
+    if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) )
+        {
+        iCustomAPI.Close();
+        iMobilePhone.Close();
+        iTelServer.Close();
+        }
+    __GSLOGSTRING( "[CGSPDataConnectionModel] Handles closed." );
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPDataModel::CurrentHSDPAItemL
+//
+// Returns 0( Disabled ) /1 (Enabled) .
+// ----------------------------------------------------------------------------
+//
+TInt CGSPDataHSDPAModel::CurrentHSDPAItemL()
+    {
+    TInt hsdpaValue = EFalse;
+    TRequestStatus status;
+    RMmCustomAPI::THSxPAStatus hSxPAStatus;
+    iCustomAPI.ReadHSxPAStatus( status,hSxPAStatus );
+    User::WaitForRequest( status );
+    if ( hSxPAStatus == RMmCustomAPI::EHSxPADisabled )
+        {
+        hsdpaValue = EFalse; // HSDPA Disable
+        }
+    else if ( hSxPAStatus == RMmCustomAPI::EHSxPAEnabled )
+        {
+        hsdpaValue = ETrue; //HSDPA Enable
+        }
+    return hsdpaValue;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPDataModel::CurrentHSDPAItemL
+//
+// Set 0( Disabled ) /1 (Enabled) .
+// ----------------------------------------------------------------------------
+//    
+void CGSPDataHSDPAModel::SetHSDPAItemValueL( TInt aHsdpaValue )
+    {
+    TRequestStatus status;
+    RMmCustomAPI::THSxPAStatus hSxPAStatus;
+    if ( aHsdpaValue == 0 )
+        {
+    	hSxPAStatus = RMmCustomAPI::EHSxPADisabled;
+    	}
+    else
+        {
+        hSxPAStatus = RMmCustomAPI::EHSxPAEnabled;
+        }
+    iCustomAPI.WriteHSxPAStatus( status,hSxPAStatus );
+    User::WaitForRequest( status );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,530 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataHSDPAPlugin implementation.
+*
+*/
+
+
+// User includes
+#include    "GSPDataHSDPAPlugin.h"
+#include    "GSPDataHSDPAModel.h"
+#include    <gsparentplugin.h>
+#include    <gscommon.hrh>
+#include    <GSPDataHSDPAPluginRsc.rsg> // GUI Resource
+#include    <gsprivatepluginproviderids.h>
+#include    <gsfwviewuids.h>
+
+// System includes
+#include    <AknWaitDialog.h>
+#include    <aknnotewrappers.h>
+#include    <aknradiobuttonsettingpage.h>
+#include    <akntextsettingpage.h>
+#include    <aknViewAppUi.h>
+#include    <bautils.h>
+#include    <featmgr.h>
+#include    <hlplch.h> // HlpLauncher
+#include    <StringLoader.h>
+#include    <telephonydomainpskeys.h>
+#include    <apgtask.h>
+#include    <NetworkHandlingDomainPSKeys.h>
+#include 	<CoreApplicationUIsSDKCRKeys.h>
+#include 	<AknWaitDialog.h>
+#include    <ProEngFactory.h>
+#ifdef RD_STARTUP_CHANGE
+#include 	<starterclient.h>
+#endif
+#include <centralrepository.h>
+#include <settingsinternalcrkeys.h>
+#include "SettingsPrivateCRKeys.h"
+
+// Constants
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::CGSPDataHSDPAPlugin()
+// Constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataHSDPAPlugin::CGSPDataHSDPAPlugin()
+    : iResources( *iCoeEnv )
+    {
+    }
+
+    
+// ---------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::~CGSPDataHSDPAPlugin()
+// Destructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataHSDPAPlugin::~CGSPDataHSDPAPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    if ( iNwModeListener )
+        {
+        delete iNwModeListener;
+        }
+        
+    iResources.Close();
+
+    if( iModel )
+        {
+        delete iModel;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;        
+        }
+    if( iNotifyHandler )
+        {
+        delete iNotifyHandler;
+        iNotifyHandler = NULL;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::ConstructL(const TRect& aRect)
+// Symbian OS two-phased constructor
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    iModel = CGSPDataHSDPAModel::NewL();
+    OpenLocalizedResourceFileL( KPDataHSDPAResourceFileName, 
+                                iResources );
+    //PS listener initialization
+    iNwModeListener = CGSPubSubsListener::NewL( 
+                     KPSUidNetworkInfo,
+                     KNWTelephonyNetworkMode, this );
+    iNwModeListener->Get( iNetworkMode );
+    
+    iProfileEngine = CreateProfileEngineL();
+    
+    iNotifyHandler = ProEngFactory::NewNotifyHandlerL();    
+    iNotifyHandler->RequestProfileActivationNotificationsL( *this );
+    
+    //Checking if HSDPA setting is suppose to be visible
+    CRepository* hsdpaRepository = CRepository::NewL( KCRUidNetworkSettings );
+    User::LeaveIfError( hsdpaRepository->Get( KSettingsHSDPAVisbility, 
+                                        iHSDPASettingSupport ) );
+    
+    BaseConstructL( R_GS_PDATAHSDPA_VIEW );
+    
+    delete hsdpaRepository;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::NewL()
+// Static constructor
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataHSDPAPlugin* CGSPDataHSDPAPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSPDataHSDPAPlugin* self = 
+                                   new( ELeave ) CGSPDataHSDPAPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::Id
+//
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSPDataHSDPAPlugin::Id() const
+    {
+    return KGSPDataHSDPAPluginUID;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::DoActivateL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                  TUid /*aCustomMessageId*/,
+                                  const TDesC8& /*aCustomMessage*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::DoDeactivate
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::DoDeactivate()
+    {
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::GetCaptionL
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    HBufC* result = StringLoader::LoadL( R_GS_PDATAHSDPA_PLUGIN_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::PluginProviderCategory
+//
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSPDataHSDPAPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::ItemType()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSListboxItemTypes CGSPDataHSDPAPlugin::ItemType()
+    {
+    return EGSItemTypeSettingDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::GetValue()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::GetValue( const TGSPluginValueKeys aKey,
+                                              TDes& aValue )
+    {
+    TRAPD( err, GetValueL( aValue ) );
+    if ( err != KErrNone )
+        {
+        CGSPluginInterface::GetValue( aKey, aValue );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::GetValueL()
+//
+// Leaving version of GetValue()
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::GetValueL( TDes& aValue )
+    {
+    const TInt hsdpaState = iModel->CurrentHSDPAItemL();
+    HBufC* result;
+
+    switch( hsdpaState )
+        {
+        case KSettingHsdpaEnable:
+            result = StringLoader::LoadL( R_GS_HSDPA_ENABLE_TEXT );
+            aValue.Copy( *result );
+            delete result;
+            break;
+        case KSettingHsdpaDisable:
+            result = StringLoader::LoadL( R_GS_HSDPA_DISABLE_TEXT );
+            aValue.Copy( *result );
+            delete result;
+         default:
+            break;
+        }
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::HandleSelection()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::HandleSelection(
+    const TGSSelectionTypes aSelectionType )
+    {
+    switch( aSelectionType )
+        {
+        // Launch setting page to change value.
+        case EGSSelectionBySelectionKey:
+        case EGSSelectionByMenu:
+            TRAP_IGNORE( SetHSDPAStateL() );  
+            break;
+        default:
+            break;
+        }
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::ShowHSDPASettingPageL()
+//
+// Indexes of HSDPA on/off items in a listbox are not the same as aPDataHSDPAState
+// value. Therefore matching between these two is required.
+// -----------------------------------------------------------------------------
+//
+TBool CGSPDataHSDPAPlugin::ShowHSDPASettingPageL( TInt& aHsdpaState )
+    {
+    TInt prevHsdpaState = aHsdpaState;
+    TInt selectedIndex;
+    TBool isValueUpdated = EFalse;
+
+    // Match HSDPA state to lbx item index:
+    switch( aHsdpaState )
+        {
+        case KSettingHsdpaEnable:
+            selectedIndex = KSettingHsdpaDisable;
+            break;
+        case KSettingHsdpaDisable:
+            selectedIndex = KSettingHsdpaEnable;
+            break;
+        }
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( 
+                            R_GS_PDATAHSDPA_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg =
+        new (ELeave) CAknRadioButtonSettingPage
+                                  ( R_GS_PDATAHSDPA_SETTING_PAGE,
+                                    selectedIndex,
+                                    items );
+    dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+    CleanupStack::PopAndDestroy( items );
+
+    // Match selected lbx item index to HSDPA state:
+    switch( selectedIndex )
+        {
+        case KSettingHsdpaEnable:
+            aHsdpaState = KSettingHsdpaDisable;
+            break;
+        case KSettingHsdpaDisable:
+            aHsdpaState = KSettingHsdpaEnable;
+            break;
+        }
+    // Check if aPDataHSDPAState has been changed:
+    if( prevHsdpaState != aHsdpaState )
+        {
+        TInt connectionErr(KErrNone);
+		TInt networkStatus;
+	
+		CRepository* repository = CRepository::NewL( KCRUidCoreApplicationUIs );
+		connectionErr = repository->Get( KCoreAppUIsNetworkConnectionAllowed, 
+		                                 networkStatus );
+		delete repository;
+		
+		if ( connectionErr == KErrNone )
+			{
+			CAknQueryDialog* resetNote = CAknQueryDialog::NewL();
+		    if( resetNote->ExecuteLD( R_CONFIRM_NW_RESET_HSDPA ) )
+            	{
+        		ResetActiveConnectionsL();
+        		isValueUpdated = ETrue;
+				}
+			}
+        }
+    return isValueUpdated;
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::SetHSDPAStateL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::SetHSDPAStateL()
+    {
+    // Get information of if there are open connections
+    TInt hsdpaState = iModel->CurrentHSDPAItemL();
+    const TBool isValueUpdated = ShowHSDPASettingPageL( hsdpaState );
+    if ( isValueUpdated )
+        {
+        // Store updated Active Idle state:
+        iModel->SetHSDPAItemValueL( hsdpaState );
+        // Update HSDPA item's value to lbx:
+        UpdateParentViewL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::OpenLocalizedResourceFileL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    aResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::TGSMenuActivationItems()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSMenuActivationItems CGSPDataHSDPAPlugin::MenuActivationItem()
+    {
+    return EGSMenuActivationItemChange;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSPDataHSDPAPlugin::Visible() const
+    {
+    // We check for if HSDPA item is supported to make it visble
+    TBool hsdpaVisible = EFalse;
+    if ( FeatureManager::FeatureSupported( KFeatureIdHsxpaSupport ) &&
+         iNetworkMode == ENWNetworkModeWcdma &&
+         iProfileEngine->ActiveProfileId() != EProfileOffLineId &&
+         iHSDPASettingSupport )
+        {
+        hsdpaVisible = ETrue;
+        }
+    return hsdpaVisible;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::ResetActiveConnectionsL
+//
+// All Active connections if any, are reset
+// instead of rebooting the phone, this is all
+// to make sure that HSDPA setting item is enabled or disabled
+// from UI level which now doesnt conflict to exact functionality of CoreUi
+// ---------------------------------------------------------------------------
+//  
+void CGSPDataHSDPAPlugin::ResetActiveConnectionsL()
+{
+#ifdef RD_STARTUP_CHANGE
+	RStarterSession rSession;
+	
+	if( iProfileEngine->ActiveProfileId() != EProfileOffLineId )
+		{	
+		User::LeaveIfError( rSession.Connect() );		
+		rSession.SetState( RStarterSession::EOffline );
+		rSession.SetState( RStarterSession::ENormal );
+		rSession.Close();
+		}
+    
+#endif
+}
+
+// ---------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::HandleNotifyPSL
+//
+// Handling PS keys change
+// ---------------------------------------------------------------------------
+//  
+void CGSPDataHSDPAPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey,
+                                          const TRequestStatus& /* aStatus */ )
+    {
+    // We check the NW mode value from PS Key
+    if ( aUid == KPSUidNetworkInfo && 
+         aKey == KNWTelephonyNetworkMode )
+        {
+        iNwModeListener->Get( iNetworkMode );
+        }
+	UpdateParentViewL();     
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::HandleProfileActivatedL
+// From MProEngProfileActivationObserver
+//
+// Callback for device profile change
+// Used for observing offline mode activation
+// ----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::HandleProfileActivatedL( TInt /*aProfileId*/ )
+    {
+    UpdateParentViewL();
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPDataHSDPAPlugin::UpdateParentViewL
+// 
+// Updating parent view
+// ----------------------------------------------------------------------------
+//
+void CGSPDataHSDPAPlugin::UpdateParentViewL()
+    {    
+    CGSParentPlugin* parent = static_cast<CGSParentPlugin*>(
+            AppUi()->View( KGSPDataPluginUid ) );// This is the parent plugin
+            
+    // Now let's check if Standby view is active
+    TGSCustomOperationType paramValue = EGSCustomOperationViewActive;
+    TAny* param = &paramValue;
+    TAny* returnValue = parent->CustomOperationL( param, NULL );
+    TBool* ViewActive = static_cast<TBool*> ( returnValue );
+    
+    if ( *ViewActive )
+        {
+        if ( parent )
+            {
+            parent->UpdateView();
+            }
+        }
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSPDataHSDPAPlugin.
+*
+*/
+
+
+// User includes
+#include "GSPDataHSDPAPlugin.h"
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// Constants
+const TImplementationProxy KGSPDataHSDPAPluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x10282DC8,  CGSPDataHSDPAPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = sizeof( KGSPDataHSDPAPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+    return KGSPDataHSDPAPluginImplementationTable;
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/Data/1020724F.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSPDataPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x1020724F;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x1020724E;
+                    version_no          = 1;
+                    display_name        = "Packet Data Plugin";
+                    #ifdef RD_CONTROL_PANEL
+                        default_data        = "0x10283341"; // Parent UID
+                        opaque_data         = "10"; // Order number
+                    #else //RD_CONTROL_PANEL
+                        default_data        = "0x10207250"; // Parent UID
+                        opaque_data         = "70"; // Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+        };
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/Data/GSPDataPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSPDataPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        PDAT // 4 letter ID
+
+// INCLUDES
+#include    <gspdataplugin.loc> // PData localized strings
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_gprs_view_title
+//    Packet data view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_gprs_view_title
+    {
+    txt = qtn_set_title_settings_gprs;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_gprs_plugin_caption
+//    Packet Data Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_gprs_plugin_caption
+    {
+    buf = qtn_set_folder_conn_gprs;
+    }
+    
+//----------------------------------------------------
+//
+//    r_gs_pdata_view
+//    Packet data view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_pdata_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/GSPDataPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for GSPDataPlugin.
+*
+*/
+
+#include  <data_caging_paths.hrh>    //this is needed for RESOURCE_FILES_DIR
+#include  <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gspdataplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x1020724F
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          Src
+SOURCE              GSPDataPlugin.cpp
+SOURCE              GSPDataPluginImplementationTable.cpp
+
+USERINCLUDE         ../Logger
+USERINCLUDE         Data
+USERINCLUDE         ../Data
+USERINCLUDE         Inc
+USERINCLUDE         loc
+
+// System Includes
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/cshelp
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          Data
+
+//ECOM resource definition
+START RESOURCE      1020724F.rss
+TARGET              gspdataplugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END                 //  ECOM resource definition
+
+//PData resources
+START RESOURCE      GSPDataPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // PData resources
+
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib 
+LIBRARY             commdb.lib
+LIBRARY             commonengine.lib // RConeResourceLoader
+LIBRARY             cone.lib 
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             egul.lib // CGulIcon
+LIBRARY             eikcoctl.lib 
+LIBRARY             eikcore.lib 
+LIBRARY             etel.lib // RPhone
+LIBRARY             etelpckt.lib // RPacketService
+LIBRARY             euser.lib
+LIBRARY             featmgr.lib // FeatureManager
+LIBRARY             flogger.lib // RFileLogger
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib // Base classes
+LIBRARY             gslistbox.lib // CGSListBoxItemTextArray
+LIBRARY             hlplch.lib // HlpLauncher
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          Data
+DOCUMENT            1020724F.rss
+DOCUMENT            GSPDataPluginRsc.rss
+
+SOURCEPATH          Inc
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/Inc/GSPDataPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataPlugin header.
+*
+*/
+
+
+#ifndef GSPDATAPLUGIN_H
+#define GSPDATAPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <eikmenup.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+
+// Constants
+_LIT( KPDataResourceFileName, "z:GSPdataPluginRsc.rsc" );
+_LIT( KGSPDataPluginIconDirAndName, "z:GSPDataPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+* CGSPDataPlugin view class.
+*
+* @since Series60_3.1
+*/
+class CGSPDataPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSPDataPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPDataPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+        
+        /**
+        * See base class.
+        */
+        TGSListboxTypes ListBoxType();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+        
+        TAny* CustomOperationL( TAny* aParam1, TAny* aParam2 );
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSPDataPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+        
+        // Indicates view active status
+        TBool iViewActive;
+
+    };
+
+
+#endif // GSPDATAPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,311 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataPlugin source code.
+*
+*/
+
+
+// Includes
+#include "GSPDataPlugin.h"
+#include "GsLogger.h"
+#include <gsfwviewuids.h>
+#include <gspdataplugin.mbg> // Icons
+#include <GSPDataPluginRsc.rsg>
+#include <gsmainview.h>
+#include <gsprivatepluginproviderids.h>
+#include <conset.hlp.hrh>
+
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <barsread.h> // For TResourceReader
+#include <featmgr.h>
+
+
+// Constants
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::CGSPDataPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataPlugin::CGSPDataPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv ), iViewActive ( EFalse )
+    {
+    __GSLOGSTRING( "[CGSPDataPlugin] CGSPDataPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::~CGSPDataPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataPlugin::~CGSPDataPlugin()
+    {
+    __GSLOGSTRING( "[CGSPDataPlugin] ~CGSPDataPlugin()|->" );
+    iResourceLoader.Close();
+    __GSLOGSTRING( "[CGSPDataPlugin] ~CGSPDataPlugin()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPDataPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSPDataPlugin] ConstructL()|->" );
+    OpenLocalizedResourceFileL( KPDataResourceFileName, iResourceLoader );                                
+    BaseConstructL( R_GS_PDATA_VIEW, R_GS_GPRS_VIEW_TITLE );
+    __GSLOGSTRING( "[CGSPDataPlugin] ConstructL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSPDataPlugin* CGSPDataPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    __GSLOGSTRING( "[CGSPDataPlugin] NewL()" );
+
+    CGSPDataPlugin* self = new(ELeave) CGSPDataPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSPDataPlugin::Id() const
+    {
+    return KGSPDataPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPDataPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING( "[CGSPDataPlugin] DoActivateL()|->" );
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+        
+    iViewActive = ETrue;
+
+    // Create tab group for this view (do only if casting parent succeeds):
+    __GSLOGSTRING( "[CGSPDataPlugin] DoActivateL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPDataPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSPDataPlugin] DoDeactivate()|->" );
+    CGSParentPlugin::DoDeactivate();
+    iViewActive = EFalse;
+    __GSLOGSTRING( "[CGSPDataPlugin] DoDeactivate()-|" );
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSPDataPlugin::UpperLevelViewUid()
+    {
+    #ifdef RD_CONTROL_PANEL
+        return KGSAdminPluginUid;
+    #else //RD_CONTROL_PANEL
+        return KGSConPluginUid;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPDataPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __GSLOGSTRING( "[CGSPDataPlugin] GetCaptionL()|->" );
+    HBufC* result = StringLoader::LoadL( R_GS_GPRS_PLUGIN_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    __GSLOGSTRING( "[CGSPDataPlugin] GetCaptionL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSPDataPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPDataPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KSET_HLP_CONNEC_GPRS;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPDataPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSPDataPlugin::CreateIconL( const TUid aIconType )
+    {
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSPDataPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetConnGprs,
+        fp->FullName(),
+        EMbmGspdatapluginQgn_prop_set_conn_gprs,
+        EMbmGspdatapluginQgn_prop_set_conn_gprs_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPDataPlugin::ListBoxType()
+//
+//
+// ---------------------------------------------------------------------------
+//
+
+TGSListboxTypes CGSPDataPlugin::ListBoxType()
+    {
+    return EGSListBoxTypeSettings;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataPlugin::DynInitMenuPaneL()
+// 
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSPDataPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                       CEikMenuPane* aMenuPane )
+    {
+    FeatureManager::InitializeLibL();
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    FeatureManager::UnInitializeLib();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPDataPlugin::CustomOperationL()
+//
+//
+// ----------------------------------------------------------------------------
+TAny* CGSPDataPlugin::CustomOperationL( TAny* aParam1, TAny* /*aParam2*/ )
+    {
+    TGSCustomOperationType* operationType =
+                    static_cast<TGSCustomOperationType*> ( aParam1 );
+    switch ( *operationType )
+        {
+        case EGSCustomOperationViewActive:
+            // Returning view status - ETrue if the view is active, EFalse if
+            // it's not
+            return &iViewActive;
+        default:
+            break;
+        }
+    return NULL;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSPDataPlugin.
+*
+*/
+
+
+// User includes
+#include "GSPDataPlugin.h"
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+
+// Constants
+const TImplementationProxy KGSPDataSettingsPluginImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x1020724E, CGSPDataPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = sizeof( KGSPDataSettingsPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+    return KGSPDataSettingsPluginImplementationTable;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information required for building GSPDataPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSPDataPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdataplugin.iby )
+../rom/GSPDataPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdatapluginresources.iby )
+loc/GSPDataPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdataplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gspdataplugin.mif
+  OPTION HEADERFILE gspdataplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_conn_gprs
+END
+
+
+PRJ_MMPFILES
+GSPDataPlugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSPDataPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPDataPlugin/loc/GSPDataPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSPDataPlugin.
+*
+*/
+
+//  LOCALISATION STRINGS
+
+
+// **PACKET DATA VIEW
+
+//d:Text in title pane
+//d:Packet data setting list view
+//l:title_pane_t2/opt9
+//w:
+//r:4.0
+//
+#define qtn_set_title_settings_gprs "Packet data"
+
+
+//d:Packet data plugin caption.
+//l:list_double_large_graphic_pane_t1_cp2
+//w:
+//r:4.0
+//
+#define qtn_set_folder_conn_gprs "Packet data"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/2002120C.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Power Saving Query plugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x2002120C;
+    interfaces  =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x2002120D;
+                    version_no          = 1;
+                    display_name        = "Power Saving Query Plugin";
+                    default_data        = "0x10283317";// Parent UID
+                    opaque_data         = "16";//Order number
+                    }
+                };
+            }
+        };
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/GSPowerSavingQueryPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for GSPowerSavingQueryPlugin
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    POWE // 4 letter ID
+
+//  INCLUDES
+#include "GSPowerSavingQueryPlugin.hrh"
+#include <gspowersavingqueryplugin.loc>
+
+#include <avkon.loc> // Avkon localized strings
+#include <avkon.mbg>
+#include <avkon.rsg>
+#include <eikcore.rsg>
+#include <uikon.rh>
+#include <GSApp.rsg>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include "GSCommonResources.rss"
+
+
+RESOURCE TBUF
+    {
+    buf="POWE";
+    }
+
+//----------------------------------------------------
+//
+//    EIK_APP_INFO
+//    It contains application information.
+//
+//----------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    }
+
+
+//----------------------------------------------------
+//  r_gs_power_saving_query_view_caption
+//
+//  Power saving query view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_power_saving_query_view_caption
+    {
+    buf = qtn_cp_power_saving_query_settings;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_power_saving_query_view_title
+//    Power saving query view's title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_power_saving_query_view_title
+    {
+    txt = qtn_cp_power_saving_query_settings;
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_power_saving_query_view
+//    Power saving query view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_power_saving_query_view
+    {
+    menubar = r_gs_menubar_change_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_power_saving_query_lbx
+//    Power saving query view's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE GS_FEATURE_ARRAY r_power_saving_query_lbx
+    {
+    items =
+        {
+        GS_FEATURE
+            {
+            txt = " \t"qtn_power_saving_query_settings_header"\t\t";
+            item = KGSSettIdPowerSavingQuery;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//
+//    r_power_saving_query_setting_page
+//    Power saving query setting page.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_power_saving_query_setting_page
+    {
+    number = EAknSettingPageNoOrdinalDisplayed;
+    label = qtn_power_saving_query_settings_header;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknSetListBox;
+    editor_resource_id = r_setting_listbox;
+    }
+
+//----------------------------------------------------
+//
+//    r_power_saving_query_setting_page_lbx
+//    Power saving query setting page's listbox.
+//
+//----------------------------------------------------
+//
+RESOURCE ARRAY r_power_saving_query_setting_page_lbx
+    {
+    items =
+        {
+        LBUF
+            {
+            txt = qtn_power_saving_query_settings_val_on;
+            },
+        LBUF
+            {
+            txt = qtn_power_saving_query_settings_val_off;
+            }
+        };
+    }
+    
+//----------------------------------------------------
+//
+//    r_power_saving_query_on
+//    On value.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_power_saving_query_on
+    {
+    buf = qtn_power_saving_query_settings_val_on;
+    }
+    
+//----------------------------------------------------
+//
+//    r_power_saving_query_off
+//    Off value.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_power_saving_query_off
+    {
+    buf = qtn_power_saving_query_settings_val_off;
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/GSPowerSavingQueryPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file.
+*
+*/
+
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+#include  <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gspowersavingqueryplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x2002120C
+VENDORID            VID_DEFAULT
+
+
+SOURCEPATH  Src
+SOURCE      GSPowerSavingQueryPlugin.cpp
+SOURCE      GSPowerSavingQueryPluginModel.cpp
+SOURCE      GSPowerSavingQueryPluginContainer.cpp
+SOURCE      GSPowerSavingQueryPluginImplementationTable.cpp
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Logger
+USERINCLUDE     ../Data // For GSCommonResources.rss
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  2002120C.rss
+TARGET          gspowersavingqueryplugin.rsc
+END
+
+START RESOURCE  GSPowerSavingQueryPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   cone.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   eikcore.lib
+LIBRARY   egul.lib
+LIBRARY   eikdlg.lib            // eikon dialogs
+LIBRARY   commdb.lib
+
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   flogger.lib           // For GSLogger
+LIBRARY   gsecomplugin.lib
+LIBRARY   centralrepository.lib // For CenRep
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Data call settings.
+*
+*/
+
+
+#ifndef GSPOWERSAVINGQUERYPLUGIN_H
+#define GSPOWERSAVINGQUERYPLUGIN_H
+
+// INCLUDES
+#include <gsbaseview.h>
+#include <ConeResLoader.h>
+
+//CONSTANTS
+const TUid KGSPowerSavingQueryPluginUid = { 0x2002120C };
+_LIT( KGSPowerSavingQueryPluginIconDirAndName, "z:GSPowerSavingQueryPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CGSPowerSavingQueryPluginContainer;
+
+// CLASS DEFINITION
+/**
+*  CGSPowerSavingQueryPlugin view class for power saving query settings
+*  @since Series 60_5.1
+*
+*/
+class CGSPowerSavingQueryPlugin : public CGSBaseView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return GS connection view.
+        */
+        static CGSPowerSavingQueryPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor
+        */
+        ~CGSPowerSavingQueryPlugin();
+
+    public: // From CGSPluginInterface
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        TBool Visible() const;
+
+    public: // from base classes
+
+        /**
+        * Returns view id.
+        * @return TUid
+        */
+        TUid Id() const;
+
+        /**
+        * Handles commands.
+        * @param aCommand Command to be handled.
+        *
+        */
+        void HandleCommandL( TInt aCommand );
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid /*aCustomMessageId*/,
+                          const TDesC8& /*aCustomMessage*/ );
+
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aItemId An item which is updated.
+        *
+        */
+        void UpdateListBoxL( TInt aItemId );
+
+        /**
+        * Get CGSPowerSavingQueryPlugin's ccontainer.
+        */
+        CGSPowerSavingQueryPluginContainer* Container();
+
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CGSPowerSavingQueryPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        *
+        */
+        void ConstructL();
+
+    private: // from CGSBaseView
+
+        void NewContainerL();
+        void HandleListBoxSelectionL();
+
+    private: // new methods
+
+        /**
+        * Display power saving query setting page.
+        */
+        void ShowSettingPageL();
+        
+        /**
+         * SwitchOnOffValue
+         */
+        void SwitchOnOffValue(TInt &aValue);
+    private:
+        // resource loader
+        RConeResourceLoader iResourceLoader;
+
+    };
+
+#endif //GSPOWERSAVINGQUERYPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains common definitions for menu id:s
+*
+*/
+
+
+#ifndef GSPOWERSAVINGQUERYPLUGIN_HRH
+#define GSPOWERSAVINGQUERYPLUGIN_HRH
+    
+// setting item id   
+enum TSettingItemId
+    {
+    KGSSettIdPowerSavingQuery
+    };
+
+//Power saving query value
+enum TGSPowerSavingQuery
+    {
+    EGSPowerSavingQueryOff = 0,
+    EGSPowerSavingQueryOn
+    };
+
+#endif //  GSPOWERSAVINGQUERYPLUGIN_HRH
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for Power saving query settings view.
+*
+*/
+
+
+#ifndef GSPOWERSAVINGQUERYPLUGINCONTAINER_H
+#define GSPOWERSAVINGQUERYPLUGINCONTAINER_H
+
+// INCLUDES
+#include <gsbasecontainer.h>
+
+// FORWARD DECLARATION
+class CGSListBoxItemTextArray;
+class CGSPowerSavingQueryPluginModel;
+
+// CLASS DECLARATION
+
+/**
+*  CGSPowerSavingQueryPluginContainer container class
+*  @since Series 60_3.1
+* 
+*/
+class CGSPowerSavingQueryPluginContainer : public CGSBaseContainer
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS constructor.
+        * @param aRect Listbox's rect.
+        * 
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPowerSavingQueryPluginContainer();
+
+    public: //new
+
+        /**
+        * Updates listbox's item's value.
+        * @param aFeatureId An item which is updated.
+        * 
+        */
+        void UpdateListBoxL( TInt aFeatureId );
+
+        /**
+        * Retrieves the currently selected listbox feature id
+        * @return feature id.
+        */
+        TInt CurrentFeatureId() const;
+        
+        /**
+        * Retrieves the power saving query plugin data model
+        * @return the data model
+        */
+        CGSPowerSavingQueryPluginModel* Model();
+        
+    protected: // from CGSBaseContainer
+        void ConstructListBoxL( TInt aResLbxId );
+
+    private: // new
+        void CreateListBoxItemsL();
+        
+        /*
+         * MakePowerSavingQueryItemL
+         */
+        void MakePowerSavingQueryItemL();
+    
+    private:
+        /**
+        * Required for help.
+        * 
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+    
+    private: // data
+        //Listbox item array model
+        CGSListBoxItemTextArray* iListboxItemArray;
+        //Data Model
+        CGSPowerSavingQueryPluginModel* iModel;
+    };
+
+#endif //GSPOWERSAVINGQUERYPLUGINCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for Power saving query plugin.
+*
+*/
+
+
+#ifndef GSPOWERSAVINGQUERYPLUGINMODEL_H
+#define GSPOWERSAVINGQUERYPLUGINMODEL_H
+
+// INCLUDES
+#include <e32base.h>
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CRepository;
+// CLASS DEFINITION
+/**
+*  CGSPowerSavingQueryPluginModel is the model class of Power saving query plugin.
+*  It provides functions to get and set setting values.
+*  @lib GSPowerSavingQueryPlugin.lib
+*  @since Series 60_5.1
+
+*/
+
+class CGSPowerSavingQueryPluginModel : public CBase
+    {
+    public:  // Constructor and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CGSPowerSavingQueryPluginModel* NewL();
+
+        /**
+        * Destructor
+        */
+        ~CGSPowerSavingQueryPluginModel();
+        
+    public:
+        /**
+        * Returns the power saving query value (0 or 1) 
+        * 
+        * @return TInt
+        */
+        TInt PowerSavingQueryEnabled();
+
+        /**
+        * Sets the the power saving query value.
+        * @param aQuery TInt (0 or 1)
+        *
+        * @return ETrue: no errors
+        *         EFalse: an error has occurred
+        */
+        TBool EnablePowerSavingQuery( TInt aQueryValue );
+
+    private: // Private constructors
+        /**
+        * Default C++ contructor
+        */
+        CGSPowerSavingQueryPluginModel();
+
+        /**
+        * Symbian OS default constructor
+        * @return void
+        */
+        void ConstructL();
+        
+    private: // data
+        CRepository* iDeviceManagementRepository;
+    
+    };
+
+
+#endif //GSPOWERSAVINGQUERYPLUGINMODEL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,411 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View for Power saving query
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSPowerSavingQueryPlugin.h"
+#include "GSPowerSavingQueryPluginContainer.h"
+#include "GSPowerSavingQueryPluginModel.h"
+#include "GSPowerSavingQueryPlugin.hrh"
+#include "GsLogger.h"
+#include <GSPowerSavingQueryPlugin.mbg> // icons
+#include <GSPowerSavingQueryPluginRsc.rsg>
+#include <gsfwviewuids.h>
+#include <gsprivatepluginproviderids.h>
+#include <aknradiobuttonsettingpage.h>
+#include <aknViewAppUi.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <bautils.h>
+#include <coeaui.h>
+#include <gulicon.h>
+#include <hlplch.h>             // for hlplauncher
+#include <gscommon.hrh>
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+const TInt KGSSettingOff = 0;
+const TInt KGSSettingOn  = 1;
+const TInt KGSIndexOff   = 1;
+const TInt KGSIndexOn    = 0;
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+_LIT( KGSPowerSavingQueryPluginResourceFileName, "z:GSPowerSavingQueryPluginRsc.rsc" );
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::CGSPowerSavingQueryPlugin()
+//
+// Constructor
+// ----------------------------------------------------------------------------
+//
+CGSPowerSavingQueryPlugin::CGSPowerSavingQueryPlugin()
+  : iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::NewL()
+//
+// Symbian OS default constructor
+// ---------------------------------------------------------------------------
+CGSPowerSavingQueryPlugin* CGSPowerSavingQueryPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSPowerSavingQueryPlugin* self = new( ELeave ) CGSPowerSavingQueryPlugin();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::ConstructL()
+//
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------------------------
+void CGSPowerSavingQueryPlugin::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    // Find the resource file
+    TParse parse;
+    parse.Set( KGSPowerSavingQueryPluginResourceFileName,
+               &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
+
+    // Open resource file
+    iResourceLoader.OpenL( fileName );
+
+    BaseConstructL( R_GS_POWER_SAVING_QUERY_VIEW );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::~CGSPowerSavingQueryPlugin
+//
+// Destructor
+// ----------------------------------------------------------------------------
+CGSPowerSavingQueryPlugin::~CGSPowerSavingQueryPlugin()
+    {
+    FeatureManager::UnInitializeLib();
+    iResourceLoader.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// TUid CGSPowerSavingQueryPlugin::Id()
+//
+// Returns view's ID.
+// ---------------------------------------------------------------------------
+TUid CGSPowerSavingQueryPlugin::Id() const
+    {
+    return KGSPowerSavingQueryPluginUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::GetCaption
+//
+// Return application/view caption.
+// ----------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // the resource file is already opened.
+    HBufC* result = StringLoader::LoadL( R_GS_POWER_SAVING_QUERY_VIEW_CAPTION );
+
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::PluginProviderCategory
+//
+// A means to identify the location of this plug-in in the framework.
+// ----------------------------------------------------------------------------
+//
+TInt CGSPowerSavingQueryPlugin::PluginProviderCategory() const
+    {
+    //To identify internal plug-ins.
+    return KGSPluginProviderInternal;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::Visible
+//
+// Provides the visibility status of self to framework.
+// ----------------------------------------------------------------------------
+//
+TBool CGSPowerSavingQueryPlugin::Visible() const
+    {
+    return ETrue;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::HandleCommandL(TInt aCommand)
+//
+// Handles commands directed to this class.
+// ---------------------------------------------------------------------------
+void CGSPowerSavingQueryPlugin::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EGSMSKCmdAppChange:
+            HandleListBoxSelectionL();
+            break;
+        case EGSCmdAppChange:
+            ShowSettingPageL();
+            break;
+        case EAknSoftkeyBack:
+            iAppUi->ActivateLocalViewL( KGSDeviceManagementPluginUid );
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            iAppUi->HandleCommandL( aCommand );
+            break;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::UpdateListBoxL
+//
+// Updates listbox items.
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::UpdateListBoxL( TInt aItemId )
+    {
+    if( Container() )
+        {
+        Container()->UpdateListBoxL( aItemId );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::Container
+//
+// Return handle to container class.
+// ----------------------------------------------------------------------------
+//
+CGSPowerSavingQueryPluginContainer* CGSPowerSavingQueryPlugin::Container()
+    {
+    return static_cast<CGSPowerSavingQueryPluginContainer*>( iContainer );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::NewContainerL()
+//
+// Creates new iContainer.
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::NewContainerL()
+    {
+    iContainer = new( ELeave ) CGSPowerSavingQueryPluginContainer;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::DoActivateL()
+//
+// From CAknView 
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                  TUid aCustomMessageId,
+                  const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING("[CGSPowerSavingQueryPlugin]-->CGSPowerSavingQueryPlugin::DoActivateL");
+    
+    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+    
+    __GSLOGSTRING("[CGSPowerSavingQueryPlugin]<--CGSPowerSavingQueryPlugin::DoActivateL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::DoActivateL()
+//
+// From CAknView
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::DoDeactivate()
+    {
+    CGSBaseView::DoDeactivate();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::HandleListBoxSelectionL()
+//
+// Handles events raised through a rocker key.
+// ---------------------------------------------------------------------------
+void CGSPowerSavingQueryPlugin::HandleListBoxSelectionL()
+    {
+    CGSPowerSavingQueryPluginModel* model = Container()->Model();
+    
+    TInt queryValue( model->PowerSavingQueryEnabled() );
+    
+    if ( EGSPowerSavingQueryOn == queryValue ) 
+        {
+        queryValue = EGSPowerSavingQueryOff;
+        }
+    else
+        {
+        queryValue = EGSPowerSavingQueryOn;
+        }
+    
+    model->EnablePowerSavingQuery( queryValue );
+    
+    UpdateListBoxL( KGSSettIdPowerSavingQuery );
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::ShowDialupAutodisconSettingPageL
+//
+// Display dialup auto disconnect setting page.
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::ShowSettingPageL()
+    {
+    TBool queryValue = Container()->Model()->PowerSavingQueryEnabled();
+    
+    SwitchOnOffValue( queryValue );
+
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL(
+            R_POWER_SAVING_QUERY_SETTING_PAGE_LBX );
+    CleanupStack::PushL( items );
+
+    CAknRadioButtonSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage(
+            R_POWER_SAVING_QUERY_SETTING_PAGE, queryValue, items );
+
+    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+        {
+        SwitchOnOffValue( queryValue );
+        Container()->Model()->EnablePowerSavingQuery( queryValue );
+        UpdateListBoxL( KGSSettIdPowerSavingQuery );
+        }
+
+    CleanupStack::PopAndDestroy( items );
+    }
+
+// -----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSPowerSavingQueryPlugin::CreateIconL( const TUid aIconType )
+    {
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSPowerSavingQueryPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpDevPsActivate,
+        fp->FullName(),
+        EMbmGspowersavingquerypluginQgn_prop_cp_dev_ps_activate,
+        EMbmGspowersavingquerypluginQgn_prop_cp_dev_ps_activate_mask );
+        }
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+  
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::DynInitMenuPaneL()
+//
+// dynamically handle help item if not supported
+// -----------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::DynInitMenuPaneL( TInt aResourceId, 
+                                          CEikMenuPane* aMenuPane )
+    {   
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+        
+        aMenuPane->SetItemDimmed( EAknCmdHelp, 
+                !FeatureManager::FeatureSupported( KFeatureIdHelp ) );
+        }
+    }
+// -----------------------------------------------------------------------------
+// CGSPowerSavingQueryPlugin::SwitchOnOffValue()
+//
+// 
+// -----------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPlugin::SwitchOnOffValue( TInt& aValue )
+    {
+    if ( aValue == KGSSettingOn )
+        {
+        aValue = KGSIndexOn;
+        }
+    else if ( aValue == KGSSettingOff )
+        {
+        aValue = KGSIndexOff;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Power saving query view
+*
+*/
+
+
+// INCLUDE FILES
+#include "GSPowerSavingQueryPluginContainer.h"
+#include "GSPowerSavingQueryPluginModel.h"
+#include "GSPowerSavingQueryPlugin.hrh"
+#include "GsLogger.h"
+#include <GSPowerSavingQueryPluginRsc.rsg>
+#include <aknlists.h>
+#include <StringLoader.h>
+#include <AknUtils.h>
+#include <gsfwviewuids.h>
+#include <gslistbox.h>
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::ConstructL()
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPluginContainer::ConstructL( const TRect& aRect )
+    {
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::ConstructL");
+    
+    iListBox = new( ELeave ) CAknSettingStyleListBox;
+    iModel = CGSPowerSavingQueryPluginModel::NewL();
+
+    BaseConstructL( aRect, R_GS_POWER_SAVING_QUERY_VIEW_TITLE, 
+                    R_POWER_SAVING_QUERY_LBX );
+    
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::~CGSPowerSavingQueryPluginContainer()
+// 
+// Destructor 
+// ---------------------------------------------------------------------------
+//
+CGSPowerSavingQueryPluginContainer::~CGSPowerSavingQueryPluginContainer()
+    {
+    delete iListboxItemArray;
+    delete iModel;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::ConstructListBoxL()
+// 
+// Construct the listbox from resource array.
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPluginContainer::ConstructListBoxL( TInt aResLbxId )
+    {
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::ConstructListBoxL");
+    
+    iListBox->ConstructL( this, EAknListBoxSelectionList );
+
+    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, 
+                                                 *iListBox, *iCoeEnv );
+    iListBox->Model()->SetItemTextArray( iListboxItemArray );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    CreateListBoxItemsL();
+    
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::ConstructListBoxL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL()
+// 
+// Create listbox items.
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL()
+    {
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL");
+    
+    MakePowerSavingQueryItemL();
+    
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL");
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::UpdateListBoxL()
+// 
+// Update listbox item.
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPluginContainer::UpdateListBoxL( TInt aFeatureId )
+    {
+    switch( aFeatureId )
+        {
+        case KGSSettIdPowerSavingQuery:
+            MakePowerSavingQueryItemL();
+            break;
+        default:
+            break;
+        }
+
+    iListBox->HandleItemAdditionL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL()
+// 
+// Create Power saving query list item 
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL()
+    {
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL");
+    
+    TInt queryValue = iModel->PowerSavingQueryEnabled();
+    
+    TInt resId( R_POWER_SAVING_QUERY_OFF );
+    if ( EGSPowerSavingQueryOn == queryValue )
+        {
+        resId = R_POWER_SAVING_QUERY_ON;
+        }
+    
+    HBufC* buf = iEikonEnv->AllocReadResourceL( resId );
+
+    TPtr bufPtr( buf->Des() );
+    iListboxItemArray->SetDynamicTextL( KGSSettIdPowerSavingQuery, bufPtr );
+
+    // And add to listbox
+    iListboxItemArray->SetItemVisibilityL( KGSSettIdPowerSavingQuery, 
+            CGSListBoxItemTextArray::EVisible );
+
+    delete buf;
+    
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL");
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::GetHelpContext() const
+//  
+// Gets Help 
+// ---------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+      aContext.iMajor = KUidGS;
+  //  aContext.iContext = 0;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::CurrentFeatureId()
+//
+// Return the feature id of selected listitem  
+// ---------------------------------------------------------------------------
+//
+TInt CGSPowerSavingQueryPluginContainer::CurrentFeatureId() const
+    {
+    return iListboxItemArray->CurrentFeature();
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginContainer::Model()
+//
+// Return the power saving query plugin data model 
+// ---------------------------------------------------------------------------
+//
+CGSPowerSavingQueryPluginModel* CGSPowerSavingQueryPluginContainer::Model()
+    {
+    return iModel;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSPowerSavingQueryPlugin
+*
+*/
+
+
+// INCLUDES
+#include "GSPowerSavingQueryPlugin.h"
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// CONSTANTS
+const TImplementationProxy KGSPowerSavingQueryPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x2002120D,	CGSPowerSavingQueryPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// 
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSPowerSavingQueryPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSPowerSavingQueryPluginImplementationTable;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model for Power saving query plugin.
+*
+*/
+
+
+// INCLUDES
+#include "GSPowerSavingQueryPluginModel.h"
+#include <settingsinternalcrkeys.h>
+#include <centralrepository.h>
+#include "GSPowerSavingQueryPlugin.hrh"
+#include "GsLogger.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// ============================= LOCAL FUNCTIONS ==============================
+
+// ========================= MEMBER FUNCTIONS =================================
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginModel::NewL
+// 
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+//
+CGSPowerSavingQueryPluginModel* CGSPowerSavingQueryPluginModel::NewL()
+    {
+    CGSPowerSavingQueryPluginModel* self = 
+                   new( ELeave ) CGSPowerSavingQueryPluginModel();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginModel::CGSPowerSavingQueryPluginModel
+// 
+// 
+// C++ default constructor can NOT contain any code, that might leave.
+// ----------------------------------------------------------------------------
+//
+CGSPowerSavingQueryPluginModel::CGSPowerSavingQueryPluginModel()
+    {
+    
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginModel::ConstructL
+// 
+// Symbian OS default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CGSPowerSavingQueryPluginModel::ConstructL()
+    {
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginModel]-->CGSPowerSavingQueryPluginModel::ConstructL");
+    
+    iDeviceManagementRepository = 
+               CRepository::NewL( KCRUidDeviceManagementSettings );
+    
+    __GSLOGSTRING("[CGSPowerSavingQueryPluginModel]<--CGSPowerSavingQueryPluginModel::ConstructL");
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginModel::~CGSPowerSavingQueryPluginModel
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CGSPowerSavingQueryPluginModel::~CGSPowerSavingQueryPluginModel()
+    {
+    delete iDeviceManagementRepository;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginModel::PowerSavingQueryEnabled();
+// 
+// Reads power saving query value from central repository
+// ----------------------------------------------------------------------------
+//
+TInt CGSPowerSavingQueryPluginModel::PowerSavingQueryEnabled()
+    {
+    TInt queryValue( EGSPowerSavingQueryOff );
+    iDeviceManagementRepository->Get( KSettingsPowerSavingQuery, queryValue );
+    return queryValue;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPowerSavingQueryPluginModel::EnablePowerSavingQuery
+// 
+// Writes power saving query value to central repository
+// ----------------------------------------------------------------------------
+//
+TBool CGSPowerSavingQueryPluginModel::EnablePowerSavingQuery(  TInt aQueryValue )
+    {
+    return iDeviceManagementRepository->Set( KSettingsPowerSavingQuery, 
+              aQueryValue );    
+    }
+  
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSPowerSavingQueryPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSPowerSavingQueryPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspowersavingqueryplugin.iby )
+../rom/GSPowerSavingQueryPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspowersavingquerypluginresources.iby )
+loc/GSPowerSavingQueryPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspowersavingqueryplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE GSPowerSavingQueryPlugin.mif
+  OPTION HEADERFILE GSPowerSavingQueryPlugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_dev_ps_activate
+END
+
+PRJ_MMPFILES
+GSPowerSavingQueryPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/loc/GSPowerSavingQueryPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSPowerSavingQueryPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d:Text of a list item in parent view's list
+//d:Item opens Power saving query plugin view
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 5.1
+#define qtn_cp_power_saving_query_settings "Power saving query"
+
+//d:Text of a list item in Power saving query plugin view
+//l:list_setting_pane_t1
+//w:
+//r: 5.1
+#define qtn_power_saving_query_settings_header "Power saving query"
+
+//d:Item in Power saving query setting page's list
+//l:list_set_graphic_pane_t1
+//w:
+//r: 5.1
+//
+#define qtn_power_saving_query_settings_val_on "On"
+
+//d:Item in Power saving query setting page's list
+//l:list_set_graphic_pane_t1
+//w:
+//r: 5.1
+//
+#define qtn_power_saving_query_settings_val_off "Off" 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/GSPrslnPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Resource file for plugin.
+*
+*/
+
+#include <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+// To get the MW_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsprslnplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10207253
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSPrslnPluginImplementationTable.cpp
+SOURCE              GSPrslnPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         ../data
+USERINCLUDE         ../Logger
+USERINCLUDE         loc
+
+SYSTEMINCLUDE       /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          data
+
+START RESOURCE      10207253.rss
+TARGET              gsprslnplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSPrslnPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+LIBRARY             euser.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib 
+LIBRARY             cone.lib 
+LIBRARY             eikcoctl.lib 
+LIBRARY             eikcore.lib 
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             GSEcomPlugin.lib
+LIBRARY             GSFramework.lib
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             flogger.lib  // For GSLogger
+LIBRARY             FeatMgr.lib  // Feature manager 
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10207253.rss
+DOCUMENT            GSPrslnPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSPrslnPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSPrslnPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsprslnplugin.iby )
+../rom/GSPrslnPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsprslnpluginresources.iby )
+loc/GSPrslnPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsprslnplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsprslnplugin.mif
+  OPTION HEADERFILE gsprslnplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_perso
+END
+
+
+PRJ_MMPFILES
+GSPrslnPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSPrslnPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/data/10207253.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    ECOM resource file for plugin.
+*
+*/
+
+#include <RegistryInfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x10207253;
+    interfaces  = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x10207252;
+                    version_no          = 1;
+                    display_name        = "Personalisation Settings Plugin"; // Debug name
+                    #ifdef RD_CONTROL_PANEL
+                        default_data        = "0x1020723B";// Parent UID
+                        opaque_data         = "10";// Order number
+                    #else //RD_CONTROL_PANEL
+                        default_data        = "0x10207237";// Parent UID
+                        opaque_data         = "0";// Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/data/GSPrslnPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Resource file for plugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    PRSN // 4 letter ID
+
+//  INCLUDES
+#include    <GSPrslnPlugin.loc>
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <GSApp.rsg>
+#include    <uikon.rh>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_prsln_view
+//    Personalisation Settings view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_prsln_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_prsln_view_title
+//    Personalisation Settings view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_prsln_view_title
+    {
+    #ifdef RD_CONTROL_PANEL
+        txt = qtn_cp_title_personal;
+    #else //RD_CONTROL_PANEL
+        txt = qtn_set_title_settings_gen_personalisation;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_prsln_view_caption
+//    Personalisation View caption for plugin
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_prsln_view_caption
+    {
+    #ifdef RD_CONTROL_PANEL
+        buf = qtn_cp_folder_personal;
+    #else //RD_CONTROL_PANEL
+        buf = qtn_set_folder_personalisation;
+    #endif //RD_CONTROL_PANEL
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_psln_softkeys_options_back_open
+//    Text association with MSK ( OPEN )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_psln_softkeys_options_back_open
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyBack; 
+            txt = text_softkey_back; 
+            },
+        CBA_BUTTON 
+            {
+            id=EGSCmdAppOpen; 
+            txt = qtn_msk_open;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_gs_psln_softkeys_options_exit_open
+//    Text association with MSK ( OPEN )
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_gs_psln_softkeys_options_exit_open
+    {
+    buttons =
+        {
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyOptions; 
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON 
+            {
+            id=EAknSoftkeyExit; 
+            txt = text_softkey_exit; 
+            },
+        CBA_BUTTON 
+            {
+            id=EGSCmdAppOpen; 
+            txt = qtn_msk_open;
+            }
+        };
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/inc/GSPrslnPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header file for plugin.
+*
+*/
+
+
+#ifndef GSPRSLNPLUGIN_H
+#define GSPRSLNPLUGIN_H
+
+// Includes
+#include <GSParentPlugin.h>
+#include <GSFWViewUIDs.h>
+
+#include <aknview.h>
+#include <eikclb.h>
+#include <eikmenup.h>
+
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+class CGSTabHelper;
+
+// Constants
+_LIT( KGSPrslnPluginResourceFileName, "z:GSPrslnPluginRsc.rsc" );
+_LIT( KGSPrslnPluginIconDirAndName, "z:gsprslnplugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+* CGSPrslnPlugin view class.
+*
+* @since Series60_3.1
+*/
+class CGSPrslnPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSPrslnPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSPrslnPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        TGSListboxTypes ListBoxType();
+        
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSPrslnPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+
+        // Tab hepler.
+        CGSTabHelper* iTabHelper;
+        
+        //Indicates if cba is already constructed
+        TBool iCbaConstructed;
+    };
+
+
+#endif // GSPRSLNPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/loc/GSPrslnPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Localization strings for GSPrslnPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Plugin title.
+//d:Long string.
+//l:title_pane_t2/opt9
+//w:
+//r:3.1
+//
+#define qtn_set_title_settings_gen_personalisation "Personalisation"
+
+//d:Plugin caption.
+//d:Used BY GS FW.
+//l:list_single_large_graphic_pane_t1
+//w:
+//r:3.1
+//
+#define qtn_set_folder_personalisation "Personalisation"
+
+// **OPTIONS MENU
+
+//d:Command in Options list.
+//d:Opens the highlighted item.
+//l:list_single_pane_t1_cp2
+//w:
+//r:3.1
+//
+#define qtn_set_options_open "Open"
+
+//d:Plugin title.
+//d:Long string.
+//l:title_pane_t2/opt9
+//w:
+//r:5.0
+//
+#define qtn_cp_title_personal "Personal"
+
+//d:Plugin caption.
+//d:Used BY GS FW.
+//l:list_single_large_graphic_pane_t1
+//w:
+//r:5.0
+//
+#define qtn_cp_folder_personal "Personal"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,318 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Cpp file for plugin.
+*
+*/
+
+
+// Includes
+#include "GSPrslnPlugin.h"
+#include "GSLogger.h"
+
+#include <GSPrslnPluginRsc.rsg>
+#include <GSPrslnPlugin.mbg>
+
+// Includes from GS framework:
+#include <GSFWViewUIDs.h>
+#include <GSPrivatePluginProviderIds.h>
+#include <GSMainView.h>
+#include <csxhelp/cp.hlp.hrh>
+
+#include <AknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <barsread.h> // For TResourceReader
+#include <StringLoader.h>
+#include <FeatMgr.h>
+
+#include <eikbtgpc.h>
+
+#ifndef RD_CONTROL_PANEL
+    #include <GSTabHelper.h>
+#endif //RD_CONTROL_PANEL
+
+// Constants
+// Active Idle UID.
+const TUid KScutActiveIdleUid       = { 0x102750F0 };
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::CGSPrslnPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSPrslnPlugin::CGSPrslnPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv ), iCbaConstructed( EFalse )
+    {
+    __GSLOGSTRING( "[CGSPrslnPlugin] CGSPrslnPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::~CGSPrslnPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSPrslnPlugin::~CGSPrslnPlugin()
+    {
+    iResourceLoader.Close();
+    
+    #ifndef RD_CONTROL_PANEL
+        delete iTabHelper;
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSPrslnPlugin] ~CGSPrslnPlugin()" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPrslnPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSPrslnPlugin] ConstructL()" );
+    OpenLocalizedResourceFileL( KGSPrslnPluginResourceFileName,
+                                iResourceLoader );
+    BaseConstructL( R_GS_PRSLN_VIEW, R_GS_PRSLN_VIEW_TITLE );
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper = CGSTabHelper::NewL();
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSPrslnPlugin* CGSPrslnPlugin::NewL( TAny* /*aInitParams*/ )
+	{
+	__GSLOGSTRING( "[CGSPrslnPlugin] NewL()" );
+	CGSPrslnPlugin* self = new(ELeave) CGSPrslnPlugin();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSPrslnPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSPrslnPlugin] Id():0x%X", KGSPrslnPluginUid.iUid );
+    return KGSPrslnPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPrslnPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    
+    CEikButtonGroupContainer* cba = Cba();
+
+    if ( aCustomMessageId == KScutActiveIdleUid && !iCbaConstructed )
+        {
+        cba->SetCommandSetL( R_GS_PSLN_SOFTKEYS_OPTIONS_EXIT_OPEN );
+        cba->DrawDeferred();
+        }
+    iCbaConstructed = ETrue;
+        
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+
+    #ifndef RD_CONTROL_PANEL
+        // Create tab group for this view (do only if casting parent succeeds):
+        if( parent )
+            {
+            iTabHelper->CreateTabGroupL( Id(), parent );
+            }
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPrslnPlugin::DoDeactivate()
+    {
+    CGSParentPlugin::DoDeactivate();
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper->RemoveTabGroup();
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSPrslnPlugin::UpperLevelViewUid()
+    {
+    #ifdef RD_CONTROL_PANEL
+        return KGSMainViewUid;
+    #else //RD_CONTROL_PANEL
+        return KGSGenPluginUid;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSPrslnPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSPrslnPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_PERSONAL;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSPrslnPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_PRSLN_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::CreateIconL
+//
+// Return the icon, if has one.
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CGSPrslnPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSPrslnPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpPerso,
+        fp->FullName(),
+        EMbmGsprslnpluginQgn_prop_cp_perso,
+        EMbmGsprslnpluginQgn_prop_cp_perso_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSPrslnPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSPrslnPlugin::ListBoxType()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TGSListboxTypes CGSPrslnPlugin::ListBoxType()
+    {
+    return EGSListBoxTypeSingleLarge;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSPrslnPlugin::DynInitMenuPaneL()
+// 
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSPrslnPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                       CEikMenuPane* aMenuPane )
+    {
+    FeatureManager::InitializeLibL();
+    // show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    
+    FeatureManager::UnInitializeLib();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    ECOM prxy table for plugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSPrslnPlugin.h"
+
+// Constants
+const TImplementationProxy KGSPrslnPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10207252,	CGSPrslnPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSPrslnPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSPrslnPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/Data/1020743A.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Security plugin.
+*
+*/
+
+// INCLUDES
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x1020743A;
+    interfaces  = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x1020743B;
+                    version_no          = 1;
+                    display_name        = "Security Plugin";
+                    #ifdef RD_CONTROL_PANEL
+                        default_data        = "0x10283317";
+                        opaque_data         = "30";//Order number
+                    #else //RD_CONTROL_PANEL
+                        default_data        = "0x10207237";
+                        opaque_data         = "4";//Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/Data/GSSecurityPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file for General Settings
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    GSSE // 4 letter ID
+
+//  INCLUDES
+#include <gssecurityplugin.loc>
+
+#include <avkon.loc> // Avkon localized strings
+#include <avkon.mbg>
+#include <avkon.rsg>
+#include <eikcore.rsg>
+#include <uikon.rh>
+#include <GSApp.rsg>
+
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+
+//----------------------------------------------------
+//  r_gs_security_view_caption
+// 
+// Security view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_security_view_caption
+    {
+    buf = qtn_set_folder_security;
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_gs_security_view_title
+//    Security view title
+//
+//----------------------------------------------------
+//
+
+RESOURCE TITLE_PANE r_gs_security_view_title
+    {
+    txt = qtn_set_title_settings_security;        
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_gs_security_view
+//    Security view's menu
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_security_view 
+    {
+    menubar=r_gs_menubar_open_exit; 
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/GSSecurityPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file.
+*
+*/
+
+
+#include "../Logger/GsLoggingConfiguration.h"
+#include <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gssecurityplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x1020743A
+VENDORID            VID_DEFAULT
+
+
+SOURCEPATH  Src
+SOURCE      GSSecurityPluginImplementationTable.cpp
+SOURCE      GSSecurityPlugin.cpp
+
+
+//User include paths
+USERINCLUDE     Inc
+USERINCLUDE     Data // For *.rh
+USERINCLUDE     loc
+USERINCLUDE     ../Data
+USERINCLUDE     ../Logger
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      Data
+
+START RESOURCE  1020743A.rss
+TARGET          gssecurityplugin.rsc
+END
+
+START RESOURCE  GSSecurityPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib 
+LIBRARY   cone.lib 
+LIBRARY   eikcoctl.lib 
+LIBRARY   eikcore.lib 
+LIBRARY   egul.lib
+LIBRARY   flogger.lib           // File logging
+
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager 
+LIBRARY   centralrepository.lib
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   gsecomplugin.lib
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/Inc/GSSecurityPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for the Security sub-folder
+*
+*/
+
+
+#ifndef GSSECURITYPLUGIN_H
+#define GSSECURITYPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <eikmenup.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+
+
+// CLASS DECLARATION
+
+/**
+* CGSSecurityPlugin view class.
+*
+* @since Series60_3.1
+*/
+class CGSSecurityPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSSecurityPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSSecurityPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        TGSListboxTypes ListBoxType();
+        
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSSecurityPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+
+    };
+
+#endif //GSSECURITYPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,281 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Source file for CGSSecurityPlugin class
+*
+*/
+
+
+// Includes
+#include "GSSecurityPlugin.h"
+#include "GsLogger.h"
+
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <barsread.h>       // For TResourceReader
+#include <StringLoader.h>
+
+// Includes from GS framework:
+#include <gsfwviewuids.h>
+#include <gsprivatepluginproviderids.h>
+
+// Plugin includes:
+#include <GSSecurityPluginRsc.rsg>
+#include <gssecplugin.mbg>
+#include <csxhelp/cp.hlp.hrh>
+#include <featmgr.h>
+
+
+// CONSTANTS
+_LIT( KGSSecurityPluginResourceFileName, "z:GSSecurityPluginRsc.rsc" );
+
+#ifdef __SCALABLE_ICONS
+  // svg file
+  _LIT( KGSSecPluginIconFileName, "\\resource\\apps\\GSSecPlugin.mif");
+#else
+  // bitmap
+  _LIT( KGSSecPluginIconFileName, "\\resource\\apps\\GSSecPlugin.mbm");
+#endif // __SCALABLE_ICONS
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::CGSSecurityPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSSecurityPlugin::CGSSecurityPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::~CGSSecurityPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSSecurityPlugin::~CGSSecurityPlugin()
+    {
+    iResourceLoader.Close();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSecurityPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSSecurityPlugin] ConstructL()|->" );
+    OpenLocalizedResourceFileL( KGSSecurityPluginResourceFileName,
+                                iResourceLoader );
+    BaseConstructL( R_GS_SECURITY_VIEW, R_GS_SECURITY_VIEW_TITLE );
+    __GSLOGSTRING( "[CGSSecurityPlugin] ConstructL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSSecurityPlugin* CGSSecurityPlugin::NewL( TAny* /*aInitParams*/ )
+  {
+  CGSSecurityPlugin* self = new( ELeave ) CGSSecurityPlugin();
+  CleanupStack::PushL( self );
+  self->ConstructL();
+  CleanupStack::Pop( self );
+  return self;
+  }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSSecurityPlugin::Id() const
+    {
+    return KGSSecurityPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSecurityPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
+                                     TUid aCustomMessageId,
+                                     const TDesC8& aCustomMessage )
+    {
+    CGSParentPlugin::DoActivateL( aPrevViewId, aCustomMessageId,
+                                  aCustomMessage );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSecurityPlugin::DoDeactivate()
+    {
+    CGSParentPlugin::DoDeactivate();
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSSecurityPlugin::UpperLevelViewUid()
+    {
+    #ifdef RD_CONTROL_PANEL
+        return KGSDeviceManagementPluginUid;
+    #else //RD_CONTROL_PANEL
+        return KGSGenPluginUid;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSSecurityPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSSecurityPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_SECURITY;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSecurityPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __GSLOGSTRING( "[CGSSecurityPlugin] GetCaptionL()|->" );
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_SECURITY_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    __GSLOGSTRING( "[CGSSecurityPlugin] GetCaptionL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSSecurityPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSSecurityPlugin::CreateIconL
+//
+// Return the icon, if has one.
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CGSSecurityPlugin::CreateIconL( const TUid aIconType )
+    {
+    __GSLOGSTRING( "[CGSSecurityPlugin] CreateIconL()|->" );
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropSetSecSub,
+        KGSSecPluginIconFileName,
+        EMbmGssecpluginQgn_prop_set_sec_sub,
+        EMbmGssecpluginQgn_prop_set_sec_sub_mask );
+        }
+     else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    __GSLOGSTRING( "[CGSSecurityPlugin] CreateIconL()-|" );
+    return icon;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSSecurityPlugin::ListBoxType()
+//
+//
+// -----------------------------------------------------------------------------
+//
+TGSListboxTypes CGSSecurityPlugin::ListBoxType()
+    {
+    return EGSListBoxTypeSettings;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CGSSecurityPlugin::DynInitMenuPaneL()
+// 
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSSecurityPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                          CEikMenuPane* aMenuPane )
+    {
+    FeatureManager::InitializeLibL();
+	// show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+	FeatureManager::UnInitializeLib();
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSSecurityPlugin.h"
+
+// Constants
+const TImplementationProxy KGSSecurityPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x1020743B,	CGSSecurityPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSSecurityPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KGSSecurityPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building 
+*                GSSecurityPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSSecurityPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gssecurityplugin.iby )
+../rom/GSSecurityPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gssecuritypluginresources.iby )
+loc/GSSecurityPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gssecurityplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gssecplugin.mif
+  OPTION HEADERFILE gssecplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_set_sec_sub
+END
+
+
+PRJ_MMPFILES
+GSSecurityPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSSecurityPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSecurityPlugin/loc/GSSecurityPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSSecurityPlugin
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d:Text of a list item in General folder list
+//d:Item opens Security folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_folder_security "Security"
+
+//d:Text in title pane
+//d:Security settings view
+//l:title_pane_t2/opt9
+//w:
+//r: 3.1
+#define qtn_set_title_settings_security "Security settings"
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/GSSynchronisationPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSSynchronisationPlugin project specification file.
+*
+*/
+
+#include <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gssynchronisationplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10283318
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          src
+SOURCE              GSSynchronisationPluginImplementationTable.cpp
+SOURCE              GSSynchronisationPlugin.cpp
+
+USERINCLUDE         inc
+USERINCLUDE         data
+USERINCLUDE         ../Data
+USERINCLUDE         loc
+USERINCLUDE         ../Logger
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+SOURCEPATH          data
+
+START RESOURCE      10283318.rss
+TARGET              gssynchronisationplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSSynchronisationPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+// Libraries
+
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             egul.lib // CGulIcon
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             euser.lib
+LIBRARY             flogger.lib // For GSLogger
+LIBRARY             gsframework.lib
+LIBRARY             gsecomplugin.lib
+LIBRARY             gslistbox.lib// For CGSListBoxItemTextArray
+LIBRARY             ws32.lib // For RWsSession
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          data
+DOCUMENT            10283318.rss
+DOCUMENT            GSSynchronisationPluginRsc.rss
+
+SOURCEPATH          inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSSynchronisationPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSSynchronisationPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gssynchronisationplugin.iby )
+../rom/GSSynchronisationPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gssynchronisationpluginresources.iby )
+loc/GSSyncPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gssyncplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gssynchronisationplugin.mif
+  OPTION HEADERFILE gssynchronisationplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_conn_sync
+END
+
+
+PRJ_MMPFILES
+GSSynchronisationPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/clean.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+del *.cwlink
+del *.mcp
+del *.xml
+del *.resources
+del *_UID_.cpp
+rd GSSynchronisationPlugin_Data /s /q
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/data/10283318.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for GSSynchronisationPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10283318;
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10283319;
+					version_no          = 1;
+					display_name        = "GSSynchronisationPlugin"; // Debug name
+					default_data        = "0x10207250";// Parent UID
+					opaque_data         = "80";// Order number
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/data/GSSynchronisationPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource file GSSynchronisationPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    SYNC // 4 letter ID
+
+//  INCLUDES
+#include    <gssyncplugin.loc>
+#include    <avkon.loc>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <bldvariant.hrh>
+#include    <data_caging_paths_strings.hrh>
+#include    <eikcore.rsg>
+#include    <eikon.rsg>
+#include    <uikon.rh>
+#include    <GSApp.rsg>
+
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_synchronisation_view
+//    Device management view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_synchronisation_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_synchronisation_view_title
+//    View title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_synchronisation_view_title
+    {
+    txt = qtn_cp_title_synchronisation;
+    }
+
+
+//----------------------------------------------------
+//  r_gs_synchronisation_view_caption
+//
+// Caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_synchronisation_view_caption
+    {
+    buf = qtn_cp_folder_synchronisation;
+    }
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/inc/GSSynchronisationPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSSynchronisationPlugin header.
+*
+*/
+
+
+#ifndef GSSYNCHRONISATIONPLUGIN_H
+#define GSSYNCHRONISATIONPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+class CGSTabHelper;
+
+// Constants
+_LIT( KGSSynchronisationPluginResourceFileName, "z:GSSynchronisationPluginrsc.rsc" );
+_LIT( KGSSynchronisationPluginIconDirAndName, "z:GSSynchronisationPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+// CLASS DECLARATION
+
+/**
+* CGSSynchronisationPlugin view class.
+*
+* @since Series60_3.2
+*/
+class CGSSynchronisationPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSSynchronisationPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSSynchronisationPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSSynchronisationPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+    };
+
+
+#endif // GSSYNCHRONISATIONPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/loc/GSSyncPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Localization strings for GSSynchronisationPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Plugin title.
+//d:Long string.
+//l:title_pane_t2/opt9
+//w:
+//r:5.0
+//
+#define qtn_cp_title_synchronisation "Data transfer"
+
+//d:Plugin caption.
+//d:Used by GS FW.
+//l:list_single_large_graphic_pane_t1_cp2
+//w:
+//r:5.0
+//
+#define qtn_cp_folder_synchronisation "Data transfer"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSSynchronisationPlugin source code.
+*
+*/
+
+
+// Includes
+#include "GSSynchronisationPlugin.h"
+#include "GsLogger.h"
+#include <gsfwviewuids.h>
+#include <gssynchronisationplugin.mbg> // Icons
+#include <GSSynchronisationPluginRsc.rsg>
+#include <gsmainview.h>
+#include <gsprivatepluginproviderids.h>
+#include <gstabhelper.h>
+#include <csxhelp/cp.hlp.hrh>
+
+
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <barsread.h> // For TResourceReader
+
+
+// Constants
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSSynchronisationPlugin::CGSSynchronisationPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSSynchronisationPlugin::CGSSynchronisationPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] CGSSynchronisationPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSynchronisationPlugin::~CGSSynchronisationPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSSynchronisationPlugin::~CGSSynchronisationPlugin()
+    {
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] ~CGSSynchronisationPlugin()|->" );
+    iResourceLoader.Close();
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] ~CGSSynchronisationPlugin()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSynchronisationPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSynchronisationPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] ConstructL()|->" );
+    OpenLocalizedResourceFileL( KGSSynchronisationPluginResourceFileName,
+                                iResourceLoader );
+    BaseConstructL( R_GS_SYNCHRONISATION_VIEW, R_GS_SYNCHRONISATION_VIEW_TITLE );
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] ConstructL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSynchronisationPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSSynchronisationPlugin* CGSSynchronisationPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] NewL()" );
+
+    CGSSynchronisationPlugin* self = new(ELeave) CGSSynchronisationPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSSynchronisationPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSSynchronisationPlugin] Id():0x%X", KGSSynchronisationPluginUid.iUid );
+    return KGSSynchronisationPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSynchronisationPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] DoActivateL()|->" );
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] DoActivateL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSynchronisationPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] DoDeactivate()|->" );
+    CGSParentPlugin::DoDeactivate();
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] DoDeactivate()-|" );
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSSynchronisationPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSSynchronisationPlugin::UpperLevelViewUid()
+    {
+    return KGSConPluginUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSSynchronisationPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSSynchronisationPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] GetCaptionL()|->" );
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_SYNCHRONISATION_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    __GSLOGSTRING( "[CGSSynchronisationPlugin] GetCaptionL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSSynchronisationPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSSynchronisationPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSSynchronisationPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSSynchronisationPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_SYNCHRONISATION;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSSynchronisationPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSSynchronisationPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+    TParse* fp = new( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSSynchronisationPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpConnSync,
+        fp->FullName(),
+        EMbmGssynchronisationpluginQgn_prop_cp_conn_sync,
+        EMbmGssynchronisationpluginQgn_prop_cp_conn_sync_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSSynchronisationPlugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSSynchronisationPlugin.h"
+
+// Constants
+const TImplementationProxy KGSSynchronisationPluginImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x10283319,	CGSSynchronisationPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSSynchronisationPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+	return KGSSynchronisationPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/Data/1020723E.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM plugin resource file for Telephony Settings plugin.
+*
+*/
+
+
+// INCLUDES
+#include <registryinfo.rh>
+
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid     = 0x1020723E;
+    interfaces  = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid   = 0x10207236;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid  = 0x1020723D;
+                    version_no          = 1;
+                    display_name        = "Telephony Settings Plugin";
+                    default_data        = "0x1020723B";//Parent UID
+                    #ifdef RD_CONTROL_PANEL
+                        opaque_data         = "40";//Order number
+                    #else //RD_CONTROL_PANEL
+                        opaque_data         = "1";//Order number
+                    #endif //RD_CONTROL_PANEL
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/Data/GSTelPluginRsc.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Resource file for plugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    TELP // 4 letter ID
+
+//  INCLUDES
+#include    <gstelplugin.loc>
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <GSApp.rsg>
+#include    <uikon.rh>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Common resources among GS
+#include    "GSCommonResources.rss"
+
+//----------------------------------------------------
+//
+//    r_gs_tel_view
+//    Telephony Settings view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_gs_tel_view
+    {
+    menubar = r_gs_menubar_open_exit;
+    cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN;
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_tel_view_title
+//    Telephony Settings view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TITLE_PANE r_gs_tel_view_title
+    {
+    #ifdef RD_CONTROL_PANEL
+        txt = qtn_set_title_telephony;
+    #else //RD_CONTROL_PANEL
+        txt = qtn_set_title_settings_telephone;
+    #endif //RD_CONTROL_PANEL
+    }
+
+
+//----------------------------------------------------
+//
+//    r_gs_tel_view_caption
+//    Telephony View caption for plugin
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_tel_view_caption
+    {
+    #ifdef RD_CONTROL_PANEL
+        buf = qtn_cp_folder_telephony;
+    #else //RD_CONTROL_PANEL
+        buf = qtn_set_folder_telephone;
+    #endif //RD_CONTROL_PANEL
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/GSTelPlugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Resource file for plugin.
+*
+*/
+
+#include <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gstelplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x1020723E
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          Src
+SOURCE              GSTelPluginImplementationTable.cpp
+SOURCE              GSTelPlugin.cpp
+
+USERINCLUDE         Inc
+USERINCLUDE         Data
+USERINCLUDE         ../Data
+USERINCLUDE         ../Logger
+USERINCLUDE         loc
+
+SYSTEMINCLUDE       /epoc32/include/ecom
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          Data
+
+START RESOURCE      1020723E.rss
+TARGET              gstelplugin.rsc
+END
+
+// View resources
+START RESOURCE      GSTelPluginRsc.rss
+DEPENDS gsapp.rsg
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // View resources
+
+
+LIBRARY             euser.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib 
+LIBRARY             cone.lib 
+LIBRARY             eikcoctl.lib 
+LIBRARY             eikcore.lib 
+LIBRARY             commonengine.lib// For RConeResourceLoader
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             flogger.lib // For GSLogger
+LIBRARY             featmgr.lib  // feature manager
+
+//Documents. Defining these is optional. Used only by IDE's file browser.
+SOURCEPATH          Data
+DOCUMENT            GSTelPluginRsc.rss
+
+SOURCEPATH          Inc
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/Inc/GSPhoneSettingConstants.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Constants to use for Call, Barring and Network settings
+*
+*/
+
+
+#ifndef GSPHONESETTINGCONSTANTS_H
+#define GSPHONESETTINGCONSTANTS_H
+
+
+enum TGeneralSettingsPanic {
+    EInvalidIndex,
+    EInvalidCurrentItem,
+    EInvalidDivertAction,
+    ECFDefaultNumberCountError,
+    EAIViewCompleteWithNullViewId,
+    EAIViewCreateWithNonNullViewId
+    };
+
+//  LOCAL FUNCTIONS
+GLDEF_C inline void Panic( TDesC aClassName, TGeneralSettingsPanic aPanic )
+    {
+    User::Panic( aClassName, aPanic );
+    }
+
+// maximum string length for resource strings
+const TInt KGSMaxStringLength = 64;
+
+// barring pwd length
+const TInt KGSBarringPasswordLength = 4;
+
+// custom message id, when trying to activate view from phone
+const TInt KGSCustomActivateNetView = 9000;
+
+// on/off setting ON
+const TInt KGSSettingOn = 1;
+
+// on/off setting OFF
+const TInt KGSSettingOff = 0;
+
+// on/off setting's index 1 is OFF
+const TInt KGSIndexOff = 1;
+
+// on/off setting's index 0 is ON
+const TInt KGSIndexOn = 0;
+
+// manual select mode
+const TInt KGSManualSelectMode = 1;
+
+// automatic select mode
+const TInt KGSAutomaticSelectMode = 0;
+
+// CLIR values
+const TInt KGSCliDefault = 0;
+const TInt KGSCliOn = 1;
+const TInt KGSCliOff = 2;
+
+// ALS block values
+const TInt KGSAlsBlockOn = 0;
+const TInt KGSAlsBlockOff = 1;
+
+// array granularity
+const TInt KGSNetworkInfoArrayGranularity = 10; 
+
+// Granularity of the arrays in Popup menus
+const TInt KGSCallPopupMenuItems = 4;
+const TInt KGSNetPopupMenuItems = 3;
+
+//Error note type ID - for Net view internal usage only
+const TInt KGSErrorNote = 5001;
+
+//Confirmation note type ID - for Net view internal usage only
+const TInt KGSConfirmationNote = 5002;
+
+//Information note type ID - for Net view internal usage only
+const TInt KGSInformationNote = 5003;
+
+// PIN query OK
+const TInt KGSPinQueryOk = 1;
+
+// MCN is active
+const TInt KGSMcnServiceOn = 1;
+
+// Single match for CF search.
+const TInt KCFSingleContact = 1;
+
+//Number of default CF numbers.
+const TInt KCFDefaultNumbers = 3;
+
+//Number of Delay times.
+const TInt KGSNrOfDelays = 6;
+
+//Increment of each delay step.
+const TInt KCFDelayStep = 5; //5,10,15,20,25,30
+
+//Number has several '+''s in it.
+const TInt KCFErrIllegalNumber = 1;
+
+//No delay time is needed.
+const TInt KCFNoNeedToGetTimeValue = 1;
+
+//Divert to mailbox number.
+const TInt KCFDivertToMailBox = 0;
+
+//How many characters to use for CF match.
+const TInt KCFCharactersToMatch = 7;
+
+//Max. number of target items for CFs.
+const TInt KCFMaxNrOfTargets   =   5;
+
+//If none of the four special characters are found from CF number, 
+//this value is returned. KErrNotFound(-1)*4 = -4.
+const TInt KCFValidPhoneNumber =  -4;
+
+//Invalid characters in the CF number.
+_LIT ( KCFInvalidChars, "*#pw" );
+
+//Plus sign.
+_LIT ( KCFPlusSign, "+");
+
+//Length of a setting item.
+const TInt KGSSettingItemLength = 128;
+
+//Typedef for setting items.
+typedef TBuf<KGSSettingItemLength> TSettingItem;
+
+//Length of short network name.
+const TInt KGSNwShortNameLength = 10;
+
+//Length of long network name.
+const TInt KGSNwLongNameLength = 20;
+
+//Network setting item typedef.
+typedef TBuf<KGSNwLongNameLength> TNetworkID;
+
+//Length of SMS txt editor.
+const TInt KGSSMSTxtEditorLength = 160;
+
+//Typedef for SMS txt editor.
+typedef TBuf<KGSSMSTxtEditorLength> TGSSMSTextEditor;
+
+//Empty space.
+_LIT( KGSEmptySpace, " " );
+
+//unused parameter
+const TInt KGSNotUsed = -1;
+
+//Japanese replace prefix max length
+const TInt KGSReplacePrefixTextLength = 10;
+
+#endif //GSPHONESETTINGCONSTANTS_H
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/Inc/GSTelPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSTelPlugin header.
+*
+*/
+
+
+#ifndef GSTELPLUGIN_H
+#define GSTELPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <gsparentplugin.h>
+#include <gsfwviewuids.h>
+#include <eikmenup.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+class CGSTabHelper;
+
+// Constants
+_LIT( KGSTelPluginResourceFileName, "z:GSTelPluginRsc.rsc" );
+_LIT( KGSDefaultTelIconFileName, "Z:\\resource\\apps\\GSTelplugin.mbm");
+_LIT( KGSTelPluginIconFileName, "\\resource\\apps\\GSTelplugin.mif");
+
+// CLASS DECLARATION
+
+/**
+* CGSGenPlugin view class.
+*
+* @since Series60_3.1
+*/
+class CGSTelPlugin : public CGSParentPlugin
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSTelPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSTelPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSParentPlugin
+
+        /**
+        * See base class.
+        */
+        TUid UpperLevelViewUid();
+        
+        /**
+        * See base class.
+        */
+        //TGSListboxTypes ListBoxType();
+
+        /**
+        * See base class.
+        */
+        void GetHelpContext( TCoeHelpContext& aContext );
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+        
+    protected: // From MEikMenuObserver
+
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CGSTelPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+
+        // Tab hepler.
+        CGSTabHelper* iTabHelper;
+    };
+
+
+#endif // GSTELPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/Src/GSTelPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,292 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSTelPlugin source code.
+*
+*/
+
+
+// Includes
+#include "GSTelPlugin.h"
+#include "GsLogger.h"
+#include <gsfwviewuids.h>
+#include <gstelplugin.mbg> // Icons
+#include <GSTelPluginRsc.rsg>
+#include <gsmainview.h>
+#include <gsprivatepluginproviderids.h>
+#include <csxhelp/cp.hlp.hrh>
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <barsread.h> // For TResourceReader
+#include <featmgr.h>
+
+#ifndef RD_CONTROL_PANEL
+    #include <GSTabHelper.h>
+#endif //RD_CONTROL_PANEL
+
+
+// Constants
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+
+// ---------------------------------------------------------------------------
+// CGSTelPlugin::CGSTelPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSTelPlugin::CGSTelPlugin()
+    : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
+    {
+    __GSLOGSTRING( "[CGSTelPlugin] CGSTelPlugin()" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTelPlugin::~CGSTelPlugin()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSTelPlugin::~CGSTelPlugin()
+    {
+    __GSLOGSTRING( "[CGSTelPlugin] ~CGSTelPlugin()|->" );
+    iResourceLoader.Close();
+    
+    #ifndef RD_CONTROL_PANEL
+        if ( iTabHelper )
+            {
+            delete iTabHelper;
+            }
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSTelPlugin] ~CGSTelPlugin()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTelPlugin::ConstructL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSTelPlugin::ConstructL()
+    {
+    __GSLOGSTRING( "[CGSTelPlugin] ConstructL()|->" );
+    OpenLocalizedResourceFileL( KGSTelPluginResourceFileName,
+                                iResourceLoader );
+    BaseConstructL( R_GS_TEL_VIEW, R_GS_TEL_VIEW_TITLE );
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper = CGSTabHelper::NewL();
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSTelPlugin] ConstructL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTelPlugin::NewL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+CGSTelPlugin* CGSTelPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    __GSLOGSTRING( "[CGSTelPlugin] NewL()" );
+
+    CGSTelPlugin* self = new(ELeave) CGSTelPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSTelPlugin::Id() const
+    {
+    __GSLOGSTRING1( "[CGSTelPlugin] Id():0x%X", KGSTelPluginUid.iUid );
+    return KGSTelPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSTelPlugin::DoActivateL
+    ( const TVwsViewId& aPrevViewId,
+      TUid aCustomMessageId,
+      const TDesC8& aCustomMessage )
+    {
+    __GSLOGSTRING( "[CGSTelPlugin] DoActivateL()|->" );
+    CGSParentPlugin::DoActivateL( aPrevViewId,
+                                  aCustomMessageId,
+                                  aCustomMessage );
+    CGSMainView* parent =
+        static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
+
+    #ifndef RD_CONTROL_PANEL
+        // Create tab group for this view (do only if casting parent succeeds):
+        if( parent )
+            {
+            iTabHelper->CreateTabGroupL( Id(), parent );
+            }
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSTelPlugin] DoActivateL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSTelPlugin::DoDeactivate()
+    {
+    __GSLOGSTRING( "[CGSTelPlugin] DoDeactivate()|->" );
+    CGSParentPlugin::DoDeactivate();
+    
+    #ifndef RD_CONTROL_PANEL
+        iTabHelper->RemoveTabGroup();
+    #endif //RD_CONTROL_PANEL
+    __GSLOGSTRING( "[CGSTelPlugin] DoDeactivate()-|" );
+    }
+
+
+// ========================= From CGSParentPlugin =====================
+
+
+// ---------------------------------------------------------------------------
+// CGSTelPlugin::UpperLevelViewUid()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TUid CGSTelPlugin::UpperLevelViewUid()
+    {
+    return KGSMainViewUid;
+    }
+
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CGSTelPlugin::GetCaptionL()
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CGSTelPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    __GSLOGSTRING( "[CGSTelPlugin] GetCaptionL()|->" );
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_GS_TEL_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    __GSLOGSTRING( "[CGSTelPlugin] GetCaptionL()-|" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSTelPlugin::PluginProviderCategory()
+//
+//
+// ---------------------------------------------------------------------------
+//
+TInt CGSTelPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSTelPlugin::GetHelpContext()
+//
+//
+// -----------------------------------------------------------------------------
+//
+void CGSTelPlugin::GetHelpContext( TCoeHelpContext& aContext )
+    {
+    aContext.iMajor = KUidGS;
+    aContext.iContext = KCP_HLP_TELEPHONY;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSTelPlugin::CreateIconL()
+//
+//
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CGSTelPlugin::CreateIconL( const TUid aIconType )
+    {
+    //EMbm<Mbm_file_name><Bitmap_name>
+    CGulIcon* icon;
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpTele,
+        KGSDefaultTelIconFileName,
+        EMbmGstelpluginQgn_prop_cp_tele,
+        EMbmGstelpluginQgn_prop_cp_tele_mask );
+        }
+       else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    return icon;
+    }
+
+// ----------------------------------------------------------------------------
+// CGSTelPlugin::DynInitMenuPaneL()
+// 
+// Display the dynamic menu
+// ----------------------------------------------------------------------------
+void CGSTelPlugin::DynInitMenuPaneL( TInt aResourceId,
+                                     CEikMenuPane* aMenuPane )
+    {
+    FeatureManager::InitializeLibL();
+	// show or hide the 'help' menu item when supported
+    if( aResourceId == R_GS_MENU_ITEM_HELP )
+        {
+        User::LeaveIfNull( aMenuPane );
+            
+        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+	
+	FeatureManager::UnInitializeLib();
+    }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/Src/GSTelPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECOM proxy table for GSTelPlugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "GSTelPlugin.h"
+
+// Constants
+const TImplementationProxy KGSTelPluginImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x1020723D,	CGSTelPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KGSTelPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+	return KGSTelPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                GSTelPlugin.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/GSTelPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gstelplugin.iby )
+../rom/GSTelPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gstelpluginresources.iby )
+loc/GSTelPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gstelplugin.loc )
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gstelplugin.mif
+  OPTION HEADERFILE gstelplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_tele
+END
+
+PRJ_MMPFILES
+GSTelPlugin.mmp
+
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/GSTelPlugin/loc/GSTelPlugin.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Localization strings for GSPrslnPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Text in title pane
+//d:Telephone setting list view
+//l:title_pane_t2/opt9
+//w:
+//r: 3.1
+#define qtn_set_title_settings_telephone "Telephone"
+
+//d:Text of a list item in main view's folder list
+//d:Item opens Telephone folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 3.1
+#define qtn_set_folder_telephone "Telephone"
+
+// **OPTIONS MENU
+
+//d:Command in Options list.
+//d:Opens the highlighted item.
+//l:list_single_pane_t1_cp2
+//w:
+//r:3.1
+//
+#define qtn_set_options_open "Open"
+
+
+//CONTROL PANEL
+
+//d:Text in title pane
+//d:Telephone setting list view
+//l: title_pane_t2/opt9
+//w:
+//r: 5.0
+#define qtn_set_title_telephony "Calling"
+
+//d:Text of a list item in main view's folder list
+//d:Item opens Telephone folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 5.0
+#define qtn_cp_folder_telephony "Calling"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/Logger/GsLogger.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       Macro definition file for logging.
+*
+*
+*/
+
+
+
+#ifndef GSLOGGER_H
+#define GSLOGGER_H
+
+#include "GsLoggingConfiguration.h"
+#include <e32std.h>
+#include <e32svr.h>
+#include <flogger.h>
+
+_LIT( KLogsDir,                  "Gs");
+_LIT( KLogFileName,              "Gs.log");
+
+/*
+ We have 3 possible logging methods:
+
+ set GS_LOGGING_METHOD to 0 to get no logging at all
+ set GS_LOGGING_METHOD to 1 to get logging via RDebug::Print
+ set GS_LOGGING_METHOD to 2 to get logging to log file
+
+ Switching on/off is done in the Configuration file (GsLoggingConfiguration.h)
+ */
+
+#if ( defined (_GSLOGGING) )
+    #if ( defined (_GS_LOGGING_TO_FILE))
+        #define GS_LOGGING_METHOD 2
+    #else
+        #define GS_LOGGING_METHOD 1
+    #endif
+#else
+    #define GS_LOGGING_METHOD 0
+#endif
+
+
+#if (GS_LOGGING_METHOD==0)
+    #define __GSLOGSTRING(C)
+    #define __GSLOGSTRING1(C, X)
+    #define __GSLOGSTRING2(C, X, Y)
+    #define __GSLOGSTRING3(C, X, Y, Z)
+    #define __GSLOGSTRING4(C, X, Y, Z, A)
+#endif
+#if (GS_LOGGING_METHOD==1)
+    #define __GSLOGSTRING(C)                RDebug::Print(_L(C));
+    #define __GSLOGSTRING1(C, X)            RDebug::Print(_L(C),X);
+    #define __GSLOGSTRING2(C, X, Y)         RDebug::Print(_L(C),X, Y);
+    #define __GSLOGSTRING3(C, X, Y, Z)      RDebug::Print(_L(C),X, Y, Z);
+    #define __GSLOGSTRING4(C, X, Y, Z, A)   RDebug::Print(_L(C),X, Y, Z, A);
+#endif
+#if (GS_LOGGING_METHOD==2)
+    #define __GSLOGSTRING(C)                {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());}
+    #define __GSLOGSTRING1(C, X)            {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X);}
+    #define __GSLOGSTRING2(C, X, Y)         {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y);}
+    #define __GSLOGSTRING3(C, X, Y, Z)      {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y,Z);}
+    #define __GSLOGSTRING4(C, X, Y, Z, A)   {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y,Z,A);}
+#endif
+
+#endif // GSLOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/Logger/GsLoggingConfiguration.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Macro definition file for logging configuration.
+*                 Note: This file has to be separate from the logging header
+*                       file to be able to include it in mmp file. If not, we
+*                       will get warning about not used flogger.lib in other
+                        logging cases where flogger.lib is not used.
+*
+*/
+
+
+
+#ifndef GSCONFIGURATION_H
+#define GSCONFIGURATION_H
+
+#ifdef _DEBUG // logging to file in debug only
+
+/**
+* Have this line active if you want to have logging for this component.
+* Comment this line out if you don't want any logging for this component.
+*/
+//#define _GSLOGGING
+
+/**
+* Have this line active if you want to have logging to file.
+* Comment this line out if you want to have logging via RDebug::Print.
+*/
+//#define _GS_LOGGING_TO_FILE
+
+/**
+* Have this line active in case you want to have plugin loading performance
+* measurements activated.
+*/
+//#define _GS_PERFORMANCE_TRACES
+
+/**
+* Have this line active in case you want to have verbose messages for plugin
+* loading. This is helpful if loading of plugin(s) is failing.
+*/
+//#define _GS_PLUGINLOADER_VERBOSE_TRACES
+
+/**
+* Enable to get traces about plugin sorting. Usable to get each sorted view
+* items.
+*/
+//#define _GS_PLUGINLOADER_FINAL_SORTING_TRACES
+
+/**
+* Enable to get traces about plugin sorting for each iteration. Usable if
+* sorting logic fails.
+*/
+//#define _GS_PLUGINLOADER_ITERATION_SORTING_TRACES
+
+/**
+* Enable to active verbose messages for CGSWatchDog. This is helpful if plugins
+* are missing or disabled from GS incorrectly.
+*/
+//#define _GS_WATCHDOG_VERBOSE_TRACES
+
+/**
+* Activate to get traces of lbx format strings. Good for finding how and which
+* icons and texts are used for lbx items.
+*/
+//#define _GS_PARENTPLUGIN_LBX_FORMAT_TRACES
+
+
+
+#endif // _DEBUG
+
+#endif // GSCONFIGURATION_H
Binary file gssettingsuis/Gs/conf/s60settingsuis.confml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_1000A82B.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8751.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877A.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877B.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877C.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877E.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877F.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8780.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8781.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8782.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8831.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_101F883B.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_1020720A.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_1028239D.crml has changed
Binary file gssettingsuis/Gs/conf/s60settingsuis_2002120B.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building
+*                General Settings.
+*
+*/
+
+
+#ifndef RD_GS_RENOVATION // This is the old GS
+
+    PRJ_PLATFORMS
+    DEFAULT
+
+    PRJ_EXPORTS
+    ../Data/backup_registration.xml  z:/private/100058EC/backup_registration.xml
+
+    PRJ_MMPFILES
+
+    //gnumakefile icons_dc.mk
+
+    #ifdef __SCALABLE_ICONS
+        gnumakefile icons_aif_scalable_dc.mk
+    //#else
+        //gnumakefile icons_aif_bitmaps_dc.mk
+    #endif //__SCALABLE_ICONS
+
+    ../group/GS.mmp
+
+
+#else // This is the RD_GS_RENOVATION
+
+
+    #include <platform_paths.hrh>
+   
+    // GS Modules:
+    #include    "../GSBackgroundImage/bld.inf"
+    #include    "../GSListBox/bld.inf"
+
+    #include    "../GSFramework/bld.inf"
+    #include    "../GSApplication/bld.inf"
+
+    // Main view plugins:
+    #include    "../GSAppsPlugin/bld.inf"
+    #include    "../GSConPlugin/bld.inf"
+    #include    "../GSGenPlugin/bld.inf"
+    #include    "../GSTelPlugin/bld.inf"
+
+    // Sub view plugins:
+    #include    "../GSDataCallPlugin/bld.inf"
+    #include    "../GSDisplayPlugin/bld.inf"
+    #include    "../GSOpticalJoystickPlugin/bld.inf"
+    #include    "../GSPDataPlugin/bld.inf"
+//    #include    "../GSPrslnPlugin/bld.inf"
+    #include    "../GSSecurityPlugin/bld.inf"
+    #include    "../GSCallPlugin/bld.inf"
+    #include    "../GSCallDivertPlugin/bld.inf"
+    #include    "../GSCallBarringPlugin/bld.inf"
+    #include    "../GSNetworkPlugin/bld.inf"
+    #include    "../GSPDataAccessPointPlugin/bld.inf"
+    #include    "../GSPDataConnectionPlugin/bld.inf"
+    #include    "../GSPowerSavingQueryPlugin/bld.inf"
+
+    #ifdef RD_CONTROL_PANEL
+        #include    "../GSDeviceManagementPlugin/bld.inf"
+        #include    "../GSSynchronisationPlugin/bld.inf"
+        #include    "../GSInstallationsPlugin/bld.inf"
+        #include    "../GSAdminPlugin/bld.inf"
+        #include    "../GSAutoKeyguardPlugin/bld.inf"
+    #endif //RD_CONTROL_PANEL
+
+    #ifdef __HSXPA_SUPPORT
+    	#include    "../GSPDataHSDPAPlugin/bld.inf"
+    #endif
+
+    #include "../gslauncher/group/bld.inf"
+    #include "../GSIndicatorPlugin/group/bld.inf"
+    #include "../help/group/bld.inf"
+
+    PRJ_EXPORTS
+    //Configuration tool migration
+    ../conf/s60settingsuis.confml                 MW_LAYER_CONFML(s60settingsuis.confml)
+    ../conf/s60settingsuis_101F877A.crml 	  MW_LAYER_CRML(s60settingsuis_101f877a.crml)
+    ../conf/s60settingsuis_101F877B.crml 	  MW_LAYER_CRML(s60settingsuis_101f877b.crml)
+    ../conf/s60settingsuis_101F877C.crml 	  MW_LAYER_CRML(s60settingsuis_101f877c.crml)
+    ../conf/s60settingsuis_101F877E.crml 	  MW_LAYER_CRML(s60settingsuis_101f877e.crml)
+    ../conf/s60settingsuis_101F877F.crml 	  MW_LAYER_CRML(s60settingsuis_101f877f.crml)
+    ../conf/s60settingsuis_101F883B.crml 	  MW_LAYER_CRML(s60settingsuis_101f883b.crml)
+    ../conf/s60settingsuis_101F8751.crml 	  MW_LAYER_CRML(s60settingsuis_101f8751.crml)
+    ../conf/s60settingsuis_101F8780.crml 	  MW_LAYER_CRML(s60settingsuis_101f8780.crml)
+    ../conf/s60settingsuis_101F8781.crml 	  MW_LAYER_CRML(s60settingsuis_101f8781.crml)
+    ../conf/s60settingsuis_101F8782.crml 	  MW_LAYER_CRML(s60settingsuis_101f8782.crml)
+    ../conf/s60settingsuis_101F8831.crml 	  MW_LAYER_CRML(s60settingsuis_101f8831.crml)
+    ../conf/s60settingsuis_1000A82B.crml 	  MW_LAYER_CRML(s60settingsuis_1000a82b.crml)
+    ../conf/s60settingsuis_1020720A.crml 	  MW_LAYER_CRML(s60settingsuis_1020720a.crml)
+    ../conf/s60settingsuis_1028239D.crml 	  MW_LAYER_CRML(s60settingsuis_1028239d.crml)
+    ../conf/s60settingsuis_2002120B.crml 	  MW_LAYER_CRML(s60settingsuis_2002120b.crml)
+    
+    PRJ_TESTMMPFILES
+
+#endif // RD_GS_RENOVATION
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/gslauncher/bwins/gslauncheru.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	?LaunchGSViewL@CGSLauncher@@QAEXVTUid@@0ABVTDesC8@@@Z @ 1 NONAME ; void CGSLauncher::LaunchGSViewL(class TUid, class TUid, class TDesC8 const &)
+	?NewL@CGSLauncher@@SAPAV1@XZ @ 2 NONAME ; class CGSLauncher * CGSLauncher::NewL(void)
+	?NewLC@CGSLauncher@@SAPAV1@XZ @ 3 NONAME ; class CGSLauncher * CGSLauncher::NewLC(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/gslauncher/eabi/gslauncheru.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_ZN11CGSLauncher13LaunchGSViewLE4TUidS0_RK6TDesC8 @ 1 NONAME
+	_ZN11CGSLauncher4NewLEv @ 2 NONAME
+	_ZN11CGSLauncher5NewLCEv @ 3 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/gslauncher/group/GSLauncher.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for project GSLauncher
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET                  gslauncher.dll
+TARGETTYPE      				DLL
+UID             				0x1000008d 0x2000F859
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  GSLauncher.cpp
+
+USERINCLUDE             ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         	euser.lib
+LIBRARY						ws32.lib			// wssession
+LIBRARY						viewcli.lib
+LIBRARY         	apgrfx.lib
+LIBRARY         	estor.lib
+
+DEFFILE           gslauncher.def
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/gslauncher/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for project GSLauncher
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/gslauncher.iby CORE_MW_LAYER_IBY_EXPORT_PATH(gslauncher.iby)
+
+PRJ_MMPFILES
+GSLauncher.mmp
+
+PRJ_TESTMMPFILES
+// This is no good -tsrc's  bld.inf should be compiled instead since it has copy script
+// ../tsrc/public/basic/group/T_CGSLauncher.mmp
+
+PRJ_TESTEXPORTS
+// ../test/inc/mytestcommon.h     /epoc32/somewhere/mytestcommon.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/gslauncher/inc/GSLauncher.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Launches GS views.
+*
+*/
+
+
+
+#ifndef C_GSLAUNCHER_H
+#define C_GSLAUNCHER_H
+
+#include <e32std.h>
+#include <e32def.h>
+#include <apgtask.h>
+
+
+
+class CGSLauncherExtension;
+/**
+ *  Launches general settings with specific plug-in opened.
+ *  Using this API, a client may request a general settings view to be shown.
+ *  Implementation will launch general settings if it is not yet running. 
+ *
+ *  Example usage of the interface:
+ *  @code
+ *   CGSLauncher* l = CGSLauncher::NewLC();
+ *   l->LaunchGSViewL ( yourPluginUid, TUid::Uid(0), KNullDesC8 ); 
+ *   CleanupStack::PopAndDestroy(l);
+ *  @endcode
+ *
+ *  @lib gslauncher.lib
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS(CGSLauncher) : public CBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructors.
+     */
+    IMPORT_C static CGSLauncher* NewL();
+
+    IMPORT_C static CGSLauncher* NewLC();
+    
+
+    /**
+    * Destructor.
+    */
+    virtual ~CGSLauncher();
+
+    /**
+     * Launches general settings with specific plug-in activated.
+     * Launching of plug-in's local views is not supported directly. 
+     * Custom message to can be used to achieve this.
+     * General settings application is started if it's not running. 
+     * Any application embedded into general settings will be closed.
+     *
+     * Needs capability: SwEvent
+     * 
+     * @since S60 5.0
+     * @param aTarget 					Target plug-in as identified in ecom registration
+     *													resource ("implementation_uid").
+     * @param aCustomMessageId  For client data. Passed to the plug-in.
+     * @param aCustomMessage  	For client data. Passed to the plug-in.
+     * @return none
+     */
+	IMPORT_C void LaunchGSViewL( const TUid aTarget,const TUid aCustomMessageId
+			,const TDesC8& aCustomMessage );
+
+
+protected:
+
+private:
+
+    CGSLauncher();
+    
+    void ConstructL();
+
+private: // data
+		CGSLauncherExtension* iExt;
+    };
+
+#endif // C_GSLAUNCHER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/gslauncher/rom/gslauncher.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Image description file for project GSLauncher
+*
+*/
+
+
+#ifndef GSLAUNCHER_IBY
+#define GSLAUNCHER_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\gslauncher.dll        SHARED_LIB_DIR\gslauncher.dll
+
+#endif // GSLAUNCHER_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/gslauncher/src/GSLauncher.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Launches GS views.
+*
+*/
+
+#include "GSLauncher.h"
+
+#include <e32property.h>
+#include <w32std.h>
+#include <apgcli.h>
+#include <viewcli.h>
+#ifdef  SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <viewclipartner.h>
+#endif
+
+#include <gsfwviewuids.h>
+#include <s32mem.h>
+
+
+const TUid KGSMessageViewLaunch = { 0x1 };
+const TInt KGSApaMsgLength = 1024;
+
+// ======== MEMBER FUNCTIONS ========
+// ---------------------------------------------------------------------------
+// description_if_needed
+// ---------------------------------------------------------------------------
+//
+CGSLauncher::CGSLauncher()
+	{
+	}
+
+
+// ---------------------------------------------------------------------------
+// description_if_needed
+// ---------------------------------------------------------------------------
+//
+void CGSLauncher::ConstructL()
+	{
+	//code
+	}
+	
+
+// ---------------------------------------------------------------------------
+// description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSLauncher* CGSLauncher::NewL()
+  {
+  CGSLauncher* self = CGSLauncher::NewLC();
+  CleanupStack::Pop( self );
+  return self;
+  }
+
+// ---------------------------------------------------------------------------
+// description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CGSLauncher* CGSLauncher::NewLC()
+  {
+  CGSLauncher* self = new( ELeave ) CGSLauncher;
+  CleanupStack::PushL( self );
+  self->ConstructL();
+  return self;
+  }
+
+
+// ---------------------------------------------------------------------------
+// description_if_needed
+// ---------------------------------------------------------------------------
+//
+CGSLauncher::~CGSLauncher()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// implementation_description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CGSLauncher::LaunchGSViewL( const TUid aTarget, 
+                                          const TUid aCustomMessageId,
+                                          const TDesC8& aCustomMessage )
+    {
+	RProperty		prop;
+	RWsSession 		ws;
+	User::LeaveIfError(ws.Connect());
+	CleanupClosePushL( ws );
+	
+	TApaTaskList 	l(ws);
+	TApaTask 		gs = l.FindApp(KUidGS);
+	
+	// GS not running, launch via avkon
+	if ( !gs.Exists() )
+		{
+		CVwsSessionWrapper* wsw = CVwsSessionWrapper::NewLC();
+		const TVwsViewId viewId( KUidGS, aTarget );
+		wsw->CreateActivateViewEvent( viewId,aCustomMessageId, aCustomMessage );
+		CleanupStack::PopAndDestroy( wsw );
+		}
+	else
+		{
+		// GS running, send parameters in string
+        // Pachage custom message
+		CBufFlat* buffer = CBufFlat::NewL( KGSApaMsgLength ); // etc
+		CleanupStack::PushL( buffer );
+		RBufWriteStream stream( *buffer );
+		stream << aTarget;
+		// In case none plugin needs custom message currently, set it to NULL.
+		stream << aCustomMessageId;
+		stream << aCustomMessage;
+//		stream << TUid::Uid(0);
+//		stream << KNullDesC8;
+		stream.CommitL();
+		stream.Close();
+		TPtr8 pBuffer( buffer->Ptr( 0 ) );
+
+        gs.SendMessage( KGSMessageViewLaunch, pBuffer );
+		CleanupStack::PopAndDestroy( buffer );
+		gs.BringToForeground();
+		}		
+	CleanupStack::PopAndDestroy( &ws );
+    }
+
+
Binary file gssettingsuis/Gs/help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/help/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - Initial contribution
+* 
+* Contributors:
+* 
+* 
+* Description:
+* Export help related files.
+*
+*/
+
+#include <platform_paths.hrh>				
+PRJ_EXPORTS
+:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
+:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
+
+../inc/cp.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/cp.hlp.hrh)
+../rom/gssettingsuishelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(gssettingsuishelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/help/inc/cp.hlp.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+	
+//
+// cp.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __CP_HLP_HRH__
+#define __CP_HLP_HRH__
+
+_LIT(KCP_HLP_ADMINISTRATIVE_SETTINGS, "CP_HLP_ADMINISTRATIVE_SETTINGS"); // 
+_LIT(KCP_HLP_DEVICE_MANAGEMENT, "CP_HLP_DEVICE_MANAGEMENT"); // 
+_LIT(KSET_HLP_WLAN_WPA_MAIN, "SET_HLP_WLAN_WPA_MAIN"); // 
+_LIT(KSET_HLP_WLAN_8021X_MAIN, "SET_HLP_WLAN_8021X_MAIN"); // 
+_LIT(KSET_HLP_WLAN_ADV_SETTINGS, "SET_HLP_WLAN_ADV_SETTINGS"); // 
+_LIT(KSET_HLP_WLAN_EAP_PLUGINS_IAP, "SET_HLP_WLAN_EAP_PLUGINS_IAP"); // 
+_LIT(KSET_HLP_WLAN_EAP_AKA, "SET_HLP_WLAN_EAP_AKA"); // 
+_LIT(KSET_HLP_WLAN_EAP_SIM, "SET_HLP_WLAN_EAP_SIM"); // 
+_LIT(KSET_HLP_WLAN_EAP_GTC, "SET_HLP_WLAN_EAP_GTC"); // 
+_LIT(KSET_HLP_WLAN_EAP_TTLS_TYPES, "SET_HLP_WLAN_EAP_TTLS_TYPES"); // 
+_LIT(KSET_HLP_WLAN_EAP_TTLS_SUITES, "SET_HLP_WLAN_EAP_TTLS_SUITES"); // 
+_LIT(KSET_HLP_WLAN_EAP_TTLS_SETT, "SET_HLP_WLAN_EAP_TTLS_SETT"); // 
+_LIT(KSET_HLP_WLAN_EAP_TLS_SUITES, "SET_HLP_WLAN_EAP_TLS_SUITES"); // 
+_LIT(KSET_HLP_WLAN_EAP_TLS_SETT, "SET_HLP_WLAN_EAP_TLS_SETT"); // 
+_LIT(KSET_HLP_WLAN_EAP_PEAP_TYPES, "SET_HLP_WLAN_EAP_PEAP_TYPES"); // 
+_LIT(KSET_HLP_WLAN_EAP_PEAP_SUITES, "SET_HLP_WLAN_EAP_PEAP_SUITES"); // 
+_LIT(KSET_HLP_WLAN_EAP_PEAP_SETT, "SET_HLP_WLAN_EAP_PEAP_SETT"); // 
+_LIT(KSET_HLP_WLAN_EAP_MSCHAPV2, "SET_HLP_WLAN_EAP_MSCHAPV2"); // 
+_LIT(KSET_HLP_WLAN_EAP_PLAIN_MSCHAP, "SET_HLP_WLAN_EAP_PLAIN_MSCHAP"); // 
+_LIT(KSET_HLP_WLAN_EAP_LEAP, "SET_HLP_WLAN_EAP_LEAP"); // 
+_LIT(KSET_HLP_WLAN_EAP_FAST_TYPES, "SET_HLP_WLAN_EAP_FAST_TYPES"); // 
+_LIT(KSET_HLP_WLAN_EAP_FAST_SUITES, "SET_HLP_WLAN_EAP_FAST_SUITES"); // 
+_LIT(KSET_HLP_WLAN_EAP_FAST_SETT, "SET_HLP_WLAN_EAP_FAST_SETT"); // 
+_LIT(KSET_HLP_WLAN_EAP_PAP, "SET_HLP_WLAN_EAP_PAP"); // 
+_LIT(KSET_HLP_WLAN_WEP_KEY_SETT, "SET_HLP_WLAN_WEP_KEY_SETT"); // 
+_LIT(KSET_HLP_WLAN_WEP_MAIN, "SET_HLP_WLAN_WEP_MAIN"); // 
+_LIT(KACL_HLP_MAIN, "ACL_HLP_MAIN"); // 
+_LIT(KSET_HLP_CONN_DEST_VIEW, "SET_HLP_CONN_DEST_VIEW"); // 
+_LIT(KSET_HLP_DEFAULT_CONN, "SET_HLP_DEFAULT_CONN"); // 
+_LIT(KSET_HLP_VPN_DEST_ASSOC_VIEW, "SET_HLP_VPN_DEST_ASSOC_VIEW"); // 
+_LIT(KSET_HLP_CONN_METHODS_VIEW, "SET_HLP_CONN_METHODS_VIEW"); // 
+_LIT(KSET_HLP_APP_DEST_ASSOC_VIEW, "SET_HLP_APP_DEST_ASSOC_VIEW"); // 
+_LIT(KCP_HLP_APPILICATION_SETTINGS, "CP_HLP_APPILICATION_SETTINGS"); // 
+_LIT(KSCP_HLP_CALL, "SCP_HLP_CALL"); // 
+_LIT(KCP_HLP_CONNECTIVITY, "CP_HLP_CONNECTIVITY"); // 
+_LIT(KCP_HLP_DISPLAY, "CP_HLP_DISPLAY"); // 
+_LIT(KCP_HLP_DEVICE, "CP_HLP_DEVICE"); // 
+_LIT(KCP_HLP_LANGUAGE, "CP_HLP_LANGUAGE"); // 
+_LIT(KCP_HLP_MAIN_VIEW, "CP_HLP_MAIN_VIEW"); // 
+//_LIT(KCP_HLP_NETWORK, "CP_HLP_NETWORK"); // 
+//_LIT(KCP_HLP_PEN_INPUT, "CP_HLP_PEN_INPUT"); // 
+_LIT(KCP_HLP_PERSONAL, "CP_HLP_PERSONAL"); // 
+_LIT(KCP_HLP_SECURITY, "CP_HLP_SECURITY"); // 
+_LIT(KSET_HLP_SECURITY_DEVICE_SIM, "SET_HLP_SECURITY_DEVICE_SIM"); // 
+_LIT(KCP_HLP_IDLE, "CP_HLP_IDLE"); // 
+_LIT(KCP_HLP_TELEPHONY, "CP_HLP_TELEPHONY"); // 
+_LIT(KCP_HLP_WRITING_LANGUAGE, "CP_HLP_WRITING_LANGUAGE"); // 
+_LIT(KES_HLP_LIGHT_MAIN, "ES_HLP_LIGHT_MAIN"); // 
+_LIT(KES_HLP_LIGHT_BLINKING, "ES_HLP_LIGHT_BLINKING"); // 
+_LIT(KSET_HLP_ACCESSORIES_LIST, "SET_HLP_ACCESSORIES_LIST"); // 
+_LIT(KSSET_HLP_MAIN_VIEW, "SSET_HLP_MAIN_VIEW"); // 
+_LIT(KSET_HLP_AP_SETTING_GPRS, "SET_HLP_AP_SETTING_GPRS"); // 
+_LIT(KSET_HLP_AP_SETTING_GPRS_AS, "SET_HLP_AP_SETTING_GPRS_AS"); // 
+_LIT(KSET_HLP_AP_DATA_AS_IPV4, "SET_HLP_AP_DATA_AS_IPV4"); // 
+_LIT(KSET_HLP_AP_DATA_AS_IPV6, "SET_HLP_AP_DATA_AS_IPV6"); // 
+_LIT(KSET_HLP_AP_SETTING_DATA, "SET_HLP_AP_SETTING_DATA"); // 
+_LIT(KSET_HLP_AP_SETTING_DATA_AS, "SET_HLP_AP_SETTING_DATA_AS"); // 
+_LIT(KSET_HLP_AP_SETTING_WLAN_AS, "SET_HLP_AP_SETTING_WLAN_AS"); // 
+_LIT(KSET_HLP_VPN_AP_SETTINGS_VIEW, "SET_HLP_VPN_AP_SETTINGS_VIEW"); // 
+_LIT(KSET_HLP_AP_SETTING_WLAN, "SET_HLP_AP_SETTING_WLAN"); // 
+_LIT(KSET_HLP_AP_WLAN_AS_IPV4, "SET_HLP_AP_WLAN_AS_IPV4"); // 
+_LIT(KSET_HLP_AP_WLAN_AS_IPV6, "SET_HLP_AP_WLAN_AS_IPV6"); // 
+_LIT(KCP_HLP_AUTOKEYGUARD, "CP_HLP_AUTOKEYGUARD"); // 
+_LIT(KRD_HLP_REMOTE_DRIVE_CONFIG, "RD_HLP_REMOTE_DRIVE_CONFIG"); // 
+_LIT(KRD_HLP_REMOTE_DRIVES, "RD_HLP_REMOTE_DRIVES"); // 
+_LIT(KCP_HLP_NETWORK, "CP_HLP_NETWORK"); // 
+_LIT(KSET_HLP_BARRING_SETTINGS, "SET_HLP_BARRING_SETTINGS"); // 
+_LIT(KDIV_HLP_BARRING_MAIN, "DIV_HLP_BARRING_MAIN"); // 
+_LIT(KDIV_HLP_CALL_FORW_DAT, "DIV_HLP_CALL_FORW_DAT"); // 
+_LIT(KDIV_HLP_CALL_FORW_MAIN, "DIV_HLP_CALL_FORW_MAIN"); // 
+_LIT(KDIV_HLP_CALL_FORW_VOI, "DIV_HLP_CALL_FORW_VOI"); // 
+_LIT(KDIV_HLP_CALL_FORW_VOIP, "DIV_HLP_CALL_FORW_VOIP"); // 
+_LIT(KSET_HLP_WLAN_SETTINGS, "SET_HLP_WLAN_SETTINGS"); // 
+_LIT(KCP_HLP_SYNCHRONISATION, "CP_HLP_SYNCHRONISATION"); // 
+_LIT(KCP_HLP_INSTALLATIONS, "CP_HLP_INSTALLATIONS"); // 
+_LIT(KSET_HLP_ACCESSORIES_HEADPHONE, "SET_HLP_ACCESSORIES_HEADPHONE"); // 
+_LIT(KSET_HLP_ACCESSORIES_HEADSET, "SET_HLP_ACCESSORIES_HEADSET"); // 
+_LIT(KSET_HLP_ACCESS_WIRED_CK, "SET_HLP_ACCESS_WIRED_CK"); // 
+_LIT(KSET_HLP_ACCESS_WIRELESS_CK, "SET_HLP_ACCESS_WIRELESS_CK"); // 
+_LIT(KSET_HLP_ACCESSORIES_LOOPSET, "SET_HLP_ACCESSORIES_LOOPSET"); // 
+_LIT(KSET_HLP_ACCESSORIES_MUSIC_ST, "SET_HLP_ACCESSORIES_MUSIC_ST"); // 
+_LIT(KSET_HLP_ACCESSORIES_TTY, "SET_HLP_ACCESSORIES_TTY"); // 
+_LIT(KSET_HLP_ACCESSORIES_TVOUT, "SET_HLP_ACCESSORIES_TVOUT"); // 
+_LIT(KCP_HLP_PEN_INPUT, "CP_HLP_PEN_INPUT"); // 
+_LIT(KPREDINPUT_HLP_INPUT, "PREDINPUT_HLP_INPUT"); // 
+_LIT(KPREDINPUT_HLP_INPUT_SETTINGS, "PREDINPUT_HLP_INPUT_SETTINGS"); // 
+_LIT(KPREDINPUT_HLP_USERDICT, "PREDINPUT_HLP_USERDICT"); // 
+_LIT(KPREDINPUT_HLP_SHORTCUT, "PREDINPUT_HLP_SHORTCUT"); // 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/help/rom/gssettingsuishelps_variant.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __GSSETTINGSUISHELPS_VARIANT_IBY__
+#define __GSSETTINGSUISHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/readme.txt	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,35 @@
+GS RENOVATION framework notes.
+
+On default the old GS is used.
+
+Activate RD_GS_RENOVATION flag in the group\bld.inf if RD_GS_RENOVATION framework is 
+to be used. Remember to use abld reallyclean before building the project when 
+switching between ond and renoved GS framework or you will get mixed files from
+the old and new frameworks:
+  1. Define/undefine RD_GS_RENOVATION
+  2. abld reallyclean
+  3. bldmake bldfiles
+  4. abld build
+
+
+Do not use UIDs used by other plugins even for testing purposes. ECOM framework
+seems to have some issues with updating the ECOM plugins implementaions and 
+their UIDs.
+
+Implemented:
+- Main view.
+- Default icons.
+- Plugins.
+- GS FW for loading the plugins.
+- Helper classes.
+
+Functionality not implemented yet:
+- Help.
+- Btimaps in addition to scalable icons.
+
+Bugs not fixed in GS renovation:
+-GSAppsPlugin does not handle "trap" panics.
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSActiveIdlePlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSActiveIdlePlugin ROM resources.
+*
+*/
+
+#ifndef GSACTIVEIDLEPLUGIN_IBY
+#define GSACTIVEIDLEPLUGIN_IBY
+
+  #ifdef RD_GS_RENOVATION
+  #ifndef RD_BOOT_CUSTOMIZABLE_AI
+    ECOM_PLUGIN( GSActiveIdlePlugin.dll, 102750C3.rsc )
+    //data=DATAZ_\BITMAP_DIR\GSActiveIdlePlugin.mif BITMAP_DIR\GSActiveIdlePlugin.mif
+  #endif //RD_BOOT_CUSTOMIZABLE_AI
+  #endif // RD_GS_RENOVATION
+
+#endif // GSACTIVEIDLEPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSActiveIdlePluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSActiveIdlePlugin ROM resources.
+*
+*/
+
+#ifndef GSACTIVEIDLEPLUGINRESOURCES_IBY
+#define GSACTIVEIDLEPLUGINRESOURCES_IBY
+
+  #ifdef RD_GS_RENOVATION
+  #ifndef RD_BOOT_CUSTOMIZABLE_AI
+    data=DATAZ_\RESOURCE_FILES_DIR\GSActiveIdlePluginRsc.rsc RESOURCE_FILES_DIR\GSActiveIdlePluginRsc.rsc
+  #endif //RD_BOOT_CUSTOMIZABLE_AI
+  #endif // RD_GS_RENOVATION
+
+#endif // GSACTIVEIDLEPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSAdminPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAdminPlugin ROM files.
+*
+*/
+
+#ifndef GSADMINPLUGIN_IBY
+#define GSADMINPLUGIN_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        ECOM_PLUGIN( GSAdminPlugin.dll, 10283340.rsc )
+        data=DATAZ_\BITMAP_DIR\GSAdminPlugin.mif BITMAP_DIR\GSAdminPlugin.mif
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSADMINPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSAdminPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAdminPlugin ROM resources.
+*
+*/
+
+#ifndef GSADMINPLUGINRESOURCES_IBY
+#define GSADMINPLUGINRESOURCES_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSAdminPluginRsc.rsc RESOURCE_FILES_DIR\GSAdminPluginRsc.rsc
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSADMINPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSApp.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSApp ROM files.
+*
+*/
+
+#ifndef GSAPP_IBY
+#define GSAPP_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        // GS Application:
+        file=ABI_DIR\BUILD_DIR\GSApp.exe                    PROGRAMS_DIR\GSApp.exe
+
+        // AIF icons/files:
+        #ifdef __SCALABLE_ICONS
+            data=DATAZ_\APP_BITMAP_DIR\GSApp_aif.MIF        APP_BITMAP_DIR\GSApp_aif.mif
+        #else
+            AUTO-BITMAP=DATAZ_\APP_BITMAP_DIR\GSApp_aif.MBM APP_BITMAP_DIR\GSApp_aif.mbm
+        #endif //__SCALABLE_ICONS
+
+        // Non-localisable resource file, can be defined in application IBY
+        data=ZSYSTEM\..\PRIVATE\10003A3F\APPS\GSApp_reg.RSC Private\10003a3f\apps\GSApp_reg.rsc
+
+        // GS Framework:
+        file=ABI_DIR\BUILD_DIR\GSFramework.dll              SHARED_LIB_DIR\GSFramework.dll
+        file=ABI_DIR\BUILD_DIR\GSEcomPlugin.dll             SHARED_LIB_DIR\GSEcomPlugin.dll
+
+        // Normal icons:
+        data=DATAZ_\BITMAP_DIR\Gsfwicon.mif             BITMAP_DIR\Gsfwicon.mif        
+        data=DATAZ_\private\100058EC\backup_registration.xml    private\100058EC\backup_registration.xml
+        
+    #endif // RD_GS_RENOVATION
+
+#endif // GSAPP_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSAppResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAppResources ROM files.
+*
+*/
+
+#ifndef GSAPPRESOURCES_IBY
+#define GSAPPRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        // Resource file(s) for GENERAL SETTINGS application (Gs.iby)
+        data=DATAZ_\APP_RESOURCE_DIR\GSApp.RSC                  APP_RESOURCE_DIR\GSApp.rsc
+
+        // GS Framework:
+        data=DATAZ_\RESOURCE_FILES_DIR\GSParentPluginRsc.rsc    RESOURCE_FILES_DIR\GSParentPluginRsc.rsc
+        data=DATAZ_\RESOURCE_FILES_DIR\GSFrameworkRsc.rsc       RESOURCE_FILES_DIR\GSFrameworkRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSAPPRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSAppsPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAppsPlugin ROM files.
+*
+*/
+
+#ifndef GSAPPSPLUGIN_IBY
+#define GSAPPSPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSAppsPlugin.dll,1020723A.rsc )
+        data=DATAZ_\BITMAP_DIR\GSAppsPlugin.mif BITMAP_DIR\GSAppsPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSAPPSPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSAppsPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAppsPluginResources ROM files.
+*
+*/
+
+#ifndef GSAPPSPLUGINRESOURCES_IBY
+#define GSAPPSPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSAppsPluginRsc.rsc RESOURCE_FILES_DIR\GSAppsPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSAPPSPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSAutoKeyguardPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAutoKeyguardPlugin ROM files.
+*
+*/
+
+#ifndef GSAUTOKEYGUARDPLUGIN_IBY
+#define GSAUTOKEYGUARDPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSAutoKeyguardPlugin.dll, 200110f0.rsc )
+        data=DATAZ_\BITMAP_DIR\gsautokeyguardplugin.mif BITMAP_DIR\gsautokeyguardplugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSAUTOKEYGUARDPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSAutoKeyguardPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAutoKeyguardPlugin ROM resources.
+*
+*/
+
+#ifndef GSAUTOKEYGUARDPLUGINRESOURCES_IBY
+#define GSAUTOKEYGUARDPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSAutoKeyguardPluginRsc.rsc     RESOURCE_FILES_DIR\GSAutoKeyguardPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSAUTOKEYGUARDPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSBackgroundImage.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef _BACKGROUNDIMAGE_IBY_
+#define _BACKGROUNDIMAGE_IBY_
+
+file=ABI_DIR\BUILD_DIR\BackgroundImage.dll                 SHARED_LIB_DIR\BackgroundImage.dll
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSCallBarringPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallBarringPlugin ROM files.
+*
+*/
+
+#ifndef GSCALLBARRINGPLUGIN_IBY
+#define GSCALLBARRINGPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSCallBarringPlugin.dll,102824A5.rsc )
+        data=DATAZ_\BITMAP_DIR\GSCallBarringplugin.mif BITMAP_DIR\GSCallBarringplugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLBARRINGPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSCallBarringPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallBarringPluginResources ROM resources.
+*
+*/
+
+#ifndef GSCALLBARRINGPLUGINRESOURCES_IBY
+#define GSCALLBARRINGPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSCallBarringPluginRsc.rsc   RESOURCE_FILES_DIR\GSCallBarringPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLBARRINGPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSCallDivertPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallDivertPlugin ROM files.
+*
+*/
+
+#ifndef GSCALLDIVERTPLUGIN_IBY
+#define GSCALLDIVERTPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSCallDivertPlugin.dll,102824A3.rsc )
+        data=DATAZ_\BITMAP_DIR\GSCallDivertplugin.mif BITMAP_DIR\GSCallDivertplugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLDIVERTPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSCallDivertPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallDivertPluginResources ROM resources.
+*
+*/
+
+#ifndef GSCALLDIVERTPLUGINRESOURCES_IBY
+#define GSCALLDIVERTPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSCallDivertPluginRsc.rsc   RESOURCE_FILES_DIR\GSCallDivertPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLDIVERTPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSCallPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallPlugin ROM files.
+*
+*/
+
+#ifndef GSCALLPLUGIN_IBY
+#define GSCALLPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSCallPlugin.dll,102824A1.rsc )
+        data=DATAZ_\BITMAP_DIR\GSCallplugin.mif BITMAP_DIR\GSCallplugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSCallPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSCallPluginResources ROM resources.
+*
+*/
+
+#ifndef GSCALLPLUGINRESOURCES_IBY
+#define GSCALLPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSCallPluginRsc.rsc   RESOURCE_FILES_DIR\GSCallPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSConPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSConPlugin ROM files.
+*
+*/
+
+#ifndef GSCONPLUGIN_IBY
+#define GSCONPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSConPlugin.dll, 10207251.rsc )
+        data=DATAZ_\BITMAP_DIR\GSConPlugin.mif BITMAP_DIR\GSConPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCONPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSConPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSConPluginResources ROM files.
+*
+*/
+
+#ifndef GSCONPLUGINRESOURCES_IBY
+#define GSCONPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSConPluginRsc.rsc RESOURCE_FILES_DIR\GSConPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCONPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSDataCallPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDataCallPlugin ROM file.
+*
+*/
+
+#ifndef GSDATACALLPLUGIN_IBY
+#define GSDATACALLPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSDataCallPlugin.dll, 10207437.rsc )
+        data=DATAZ_\BITMAP_DIR\GSDataCallPlugin.mif BITMAP_DIR\GSDataCallPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSDATACALLPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSDataCallPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDataCallPlugin ROM resources
+*
+*/
+
+#ifndef GSDATACALLPLUGINRESOURCES_IBY
+#define GSDATACALLPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSDataCallPluginRsc.rsc RESOURCE_FILES_DIR\GSDataCallPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSDATACALLPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSDeviceManagementPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDeviceManagementPlugin ROM resources.
+*
+*/
+
+#ifndef GSDEVICEMANAGEMENTPLUGIN_IBY
+#define GSDEVICEMANAGEMENTPLUGIN_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        ECOM_PLUGIN( GSDeviceManagementPlugin.dll, 10207238.rsc )
+        data=DATAZ_\BITMAP_DIR\GSDeviceManagementPlugin.mif BITMAP_DIR\GSDeviceManagementPlugin.mif
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSDEVICEMANAGEMENTPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSDeviceManagementPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDeviceManagementPlugin ROM resources.
+*
+*/
+
+#ifndef GSDEVICEMANAGEMENTPLUGINRESOURCES_IBY
+#define GSDEVICEMANAGEMENTPLUGINRESOURCES_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSDeviceManagementPluginRsc.rsc RESOURCE_FILES_DIR\GSDeviceManagementPluginRsc.rsc
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSDEVICEMANAGEMENTPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSDisplayPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDisplayPlugin ROM file
+*
+*/
+
+#ifndef GSDISPLAYPLUGIN_IBY
+#define GSDISPLAYPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSDisplayPlugin.dll, 10207440.rsc )
+        data=DATAZ_\BITMAP_DIR\GSDisplayplugin.mif BITMAP_DIR\GSDisplayplugin.mif
+
+#ifdef FF_POWER_SAVE
+        data=ZPRIVATE\2000B187\2000B591.xml         			private\2000B187\2000B591.xml
+#endif // FF_POWER_SAVE
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSDISPLAYPLUGIN_IBY
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSDisplayPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSDisplayPlugin ROM resources.
+*
+*/
+
+#ifndef GSDISPLAYPLUGINRESOURCES_IBY
+#define GSDISPLAYPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSDisplayPluginRsc.rsc RESOURCE_FILES_DIR\GSDisplayPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSDISPLAYPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSGenPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSGenPlugin ROM resources.
+*
+*/
+
+#ifndef GSGENPLUGIN_IBY
+#define GSGENPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSGenPlugin.dll, 10207238.rsc )
+        data=DATAZ_\BITMAP_DIR\GSGenPlugin.mif BITMAP_DIR\GSGenPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSGENPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSGenPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSGenPlugin ROM resources.
+*
+*/
+
+#ifndef GSGENPLUGINRESOURCES_IBY
+#define GSGENPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSGenPluginRsc.rsc RESOURCE_FILES_DIR\GSGenPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSGENPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSInstallationsPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSInstallationsPlugin ROM resources.
+*
+*/
+
+#ifndef GSINSTALLATIONSPLUGIN_IBY
+#define GSINSTALLATIONSPLUGIN_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        ECOM_PLUGIN( GSInstallationsPlugin.dll, 10207238.rsc )
+        data=DATAZ_\BITMAP_DIR\GSInstallationsPlugin.mif BITMAP_DIR\GSInstallationsPlugin.mif
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSINSTALLATIONSPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSInstallationsPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSInstallationsPlugin ROM resources.
+*
+*/
+
+#ifndef GSINSTALLATIONSPLUGINRESOURCES_IBY
+#define GSINSTALLATIONSPLUGINRESOURCES_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSInstallationsPluginRsc.rsc RESOURCE_FILES_DIR\GSInstallationsPluginRsc.rsc
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSINSTALLATIONSPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSInteractionPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSInteractionPlugin ROM files.
+*
+*/
+
+#ifndef GSINTERACTIONPLUGIN_IBY
+#define GSINTERACTIONPLUGIN_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        ECOM_PLUGIN( GSInteractionPlugin.dll, 10283340.rsc )
+        data=DATAZ_\BITMAP_DIR\gsinteractionplugin.mif BITMAP_DIR\GSInteractionPlugin.mif
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSINTERACTIONPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSInteractionPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSInteractionPlugin ROM resources.
+*
+*/
+
+#ifndef GSINTERACTIONPLUGINRESOURCES_IBY
+#define GSINTERACTIONPLUGINRESOURCES_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSInteractionPluginRsc.rsc RESOURCE_FILES_DIR\GSInteractionPluginRsc.rsc
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSINTERACTIONPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSListBox.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef _GSLISTBOX_IBY_
+#define _GSLISTBOX_IBY_
+
+file=ABI_DIR\BUILD_DIR\GSListBox.dll                 SHARED_LIB_DIR\GSListBox.dll
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSNetworkPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSNetworkPlugin ROM files.
+*
+*/
+
+#ifndef GSNETWORKPLUGIN_IBY
+#define GSNETWORKPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSNetworkPlugin.dll,102824A7.rsc )
+        data=DATAZ_\BITMAP_DIR\GSNetworkplugin.mif BITMAP_DIR\GSNetworkplugin.mif
+        
+        #ifdef FF_POWER_SAVE
+        	data=ZPRIVATE\2000B187\2000B593.xml         			private\2000B187\2000B593.xml
+	#endif // FF_POWER_SAVE
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSNETWORKPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSNetworkPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSNetworkPluginResources ROM resources.
+*
+*/
+
+#ifndef GSNETWORKPLUGINRESOURCES_IBY
+#define GSNETWORKPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSNetworkPluginRsc.rsc   RESOURCE_FILES_DIR\GSNetworkPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSNETWORKPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSOpticalJoystickPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSOpticalJoystickPlugin ROM file.
+*
+*/
+
+#ifndef GSOPTICALJOYSTICKPLUGIN_IBY
+#define GSOPTICALJOYSTICKPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSOpticalJoystickPlugin.dll, 1028331A.rsc )
+        data=DATAZ_\BITMAP_DIR\GSOpticalJoystickPlugin.mif BITMAP_DIR\GSOpticalJoystickPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSOPTICALJOYSTICKPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSOpticalJoystickPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSOpticalJoystickPlugin ROM resources
+*
+*/
+
+#ifndef GSOPTICALJOYSTICKPLUGINRESOURCES_IBY
+#define GSOPTICALJOYSTICKPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSOpticalJoystickPluginRsc.rsc RESOURCE_FILES_DIR\GSOpticalJoystickPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSOPTICALJOYSTICKPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataAccessPointPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataAccessPointPlugin ROM files.
+*
+*/
+
+#ifndef GSPDATAACCESSPOINTPLUGIN_IBY
+#define GSPDATAACCESSPOINTPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+        ECOM_PLUGIN( GSPDataAccessPointPlugin.dll,10282DC5.rsc )
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLDIVERTPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataAccessPointPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataAccessPointPluginResources ROM resources.
+*
+*/
+
+#ifndef GSPDATAACCESSPOINTPLUGINRESOURCES_IBY
+#define GSPDATAACCESSPOINTPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSPDataAccessPointPluginRsc.rsc   RESOURCE_FILES_DIR\GSPDataAccessPointPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPDATAACCESSPOINTPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataConnectionPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataConnectionPlugin ROM files.
+*
+*/
+
+#ifndef GSPDATACONNECTIONPLUGIN_IBY
+#define GSPDATACONNECTIONPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+        ECOM_PLUGIN( GSPDataConnectionPlugin.dll,10282DC3.rsc )
+    #endif // RD_GS_RENOVATION
+
+#endif // GSCALLPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataConnectionPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataConnectionPluginResources ROM resources.
+*
+*/
+
+#ifndef GSPDATACONNECTIONPLUGINRESOURCES_IBY
+#define GSPDATACONNECTIONPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+        data=DATAZ_\RESOURCE_FILES_DIR\GSPDataConnectionPluginRsc.rsc   RESOURCE_FILES_DIR\GSPDataConnectionPluginRsc.rsc
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPDATACONNECTIONPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataHSDPAPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataHSDPAPlugin ROM files.
+*
+*/
+
+#ifndef GSPDATAHSDPAPLUGIN_IBY
+#define GSPDATAHSDPAPLUGIN_IBY
+
+    #ifdef __HSXPA_SUPPORT
+        ECOM_PLUGIN( GSPDataHSDPAPlugin.dll,10282DC7.rsc )
+    #endif // __HSXPA_SUPPORT
+
+#endif // GSNETWORKPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataHSDPAPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataHSDPAPluginResources ROM resources.
+*
+*/
+
+#ifndef GSPDATAHSDPAPLUGINRESOURCES_IBY
+#define GSPDATAHSDPAPLUGINRESOURCES_IBY
+
+    #ifdef __HSXPA_SUPPORT
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSPDataHSDPAPluginRsc.rsc   RESOURCE_FILES_DIR\GSPDataHSDPAPluginRsc.rsc
+
+    #endif // __HSXPA_SUPPORT
+
+#endif // GSPDATAHSDPAPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataPlugin ROM files.
+*
+*/
+
+#ifndef GSPDATAPLUGIN_IBY
+#define GSPDATAPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSPDataPlugin.dll,1020724F.rsc )
+        data=DATAZ_\BITMAP_DIR\GSPDataPlugin.mif BITMAP_DIR\GSPDataPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPDATAPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPDataPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPDataPlugin ROM resources.
+*
+*/
+
+#ifndef GSPDATAPLUGINRESOURCES_IBY
+#define GSPDATAPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSPDataPluginRsc.rsc RESOURCE_FILES_DIR\GSPDataPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPDATAPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPowerSavingQueryPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPowerSavingQueryPlugin ROM file.
+*
+*/
+
+#ifndef GSPOWERSAVINGQUERYPLUGIN_IBY
+#define GSPOWERSAVINGQUERYPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSPowerSavingQueryPlugin.dll, 2002120C.rsc )
+        data=DATAZ_\BITMAP_DIR\GSPowerSavingQueryPlugin.mif BITMAP_DIR\GSPowerSavingQueryPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPOWERSAVINGQUERYPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPowerSavingQueryPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPowerSavingQueryPlugin ROM resources
+*
+*/
+
+#ifndef GSPOWERSAVINGQUERYPLUGINRESOURCE_IBY
+#define GSPOWERSAVINGQUERYPLUGINRESOURCE_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSPowerSavingQueryPluginRsc.rsc RESOURCE_FILES_DIR\GSPowerSavingQueryPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPOWERSAVINGQUERYPLUGINRESOURCE_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPrslnPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPrslnPlugin ROM files.
+*
+*/
+
+#ifndef GSPRSLNPLUGIN_IBY
+#define GSPRSLNPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSPrslnPlugin.dll, 10207253.rsc )
+        data=DATAZ_\BITMAP_DIR\GSPrslnPlugin.mif BITMAP_DIR\GSPrslnPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPRSLNPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSPrslnPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSPrslnPlugin ROM resources.
+*
+*/
+
+#ifndef GSPRSLNPLUGINRESOURCES_IBY
+#define GSPRSLNPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSPrslnPluginRsc.rsc RESOURCE_FILES_DIR\GSPrslnPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSPRSLNPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSSecurityPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSAccsPlugin ROM files.
+*
+*/
+
+#ifndef GSSECURITYPLUGIN_IBY
+#define GSSECURITYPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSSecurityPlugin.dll, 1020743A.rsc )
+        data=DATAZ_\BITMAP_DIR\GSSecPlugin.mif BITMAP_DIR\GSSecPlugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSSECURITYPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSSecurityPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSSecurityPlugin ROM resources.
+*
+*/
+
+#ifndef GSSECURITYPLUGINRESOURCES_IBY
+#define GSSECURITYPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSSecurityPluginRsc.rsc RESOURCE_FILES_DIR\GSSecurityPluginRsc.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSSECURITYPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSSynchronisationPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSSynchronisationPlugin ROM resources.
+*
+*/
+
+#ifndef GSSYNCHRONISATIONPLUGIN_IBY
+#define GSSYNCHRONISATIONPLUGIN_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        ECOM_PLUGIN( GSSynchronisationPlugin.dll, 10207238.rsc )
+        data=DATAZ_\BITMAP_DIR\GSSynchronisationPlugin.mif BITMAP_DIR\GSSynchronisationPlugin.mif
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSSYNCHRONISATIONPLUGIN_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSSynchronisationPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSSynchronisationPlugin ROM resources.
+*
+*/
+
+#ifndef GSSYNCHRONISATIONPLUGINRESOURCES_IBY
+#define GSSYNCHRONISATIONPLUGINRESOURCES_IBY
+
+    #ifdef RD_CONTROL_PANEL
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSSynchronisationPluginRsc.rsc RESOURCE_FILES_DIR\GSSynchronisationPluginRsc.rsc
+
+    #endif // RD_CONTROL_PANEL
+
+#endif // GSSYNCHRONISATIONPLUGINRESOURCES_IBY
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSTelPlugin.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSTelPlugin ROM files.
+*
+*/
+
+#ifndef GSTELPLUGIN_IBY
+#define GSTELPLUGIN_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        ECOM_PLUGIN( GSTelPlugin.dll,1020723E.rsc )
+        data=DATAZ_\BITMAP_DIR\GSTelplugin.mif BITMAP_DIR\GSTelplugin.mif
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSTELPLUGIN_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GSTelPluginResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSTelPluginResources ROM resources.
+*
+*/
+
+#ifndef GSTELPLUGINRESOURCES_IBY
+#define GSTELPLUGINRESOURCES_IBY
+
+    #ifdef RD_GS_RENOVATION
+
+        data=DATAZ_\RESOURCE_FILES_DIR\GSTelPluginRsc.rsc   RESOURCE_FILES_DIR\GSTelPluginRsc.rsc
+        data=DATAZ_\RESOURCE_FILES_DIR\SoftReject.rsc       RESOURCE_FILES_DIR\SoftReject.rsc
+
+    #endif // RD_GS_RENOVATION
+
+#endif // GSTELPLUGINRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/rom/GsResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSResources ROM files.
+*
+*/
+
+#ifndef GSRESOURCES_IBY
+#define GSRESOURCES_IBY
+
+  #ifndef RD_GS_RENOVATION
+
+    //Resource file(s) for GENERAL SETTINGS application (Gs.iby)
+    data=DATAZ_\APP_RESOURCE_DIR\GS.RSC          APP_RESOURCE_DIR\GS.rsc
+    data=DATAZ_\RESOURCE_FILES_DIR\SoftReject.RSC   RESOURCE_FILES_DIR\SoftReject.rsc
+
+  #endif // RD_GS_RENOVATION
+
+#endif  // GSRESOURCES_IBY
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,463 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "T_CGSPluginInterface.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <GSFWViewUIDs.h>
+#include <ecom.h>
+
+#include "GSWatchDog.h"
+
+//  INTERNAL INCLUDES
+
+
+
+CGSPluginIndexer* CGSPluginIndexer::NewL( TUid aInterface )
+    {
+    CGSPluginIndexer* self = new( ELeave ) CGSPluginIndexer( aInterface );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CGSPluginIndexer::CGSPluginIndexer( TUid aInterface )
+    : iInterfaceUid( aInterface)
+    {
+    }
+
+
+CGSPluginIndexer::~CGSPluginIndexer()
+    {
+    iImplInfoArray.ResetAndDestroy();// This is needed
+    iImplInfoArray.Close();
+    }
+
+
+void CGSPluginIndexer::ConstructL()
+    {
+    REComSession::ListImplementationsL( iInterfaceUid,
+                                        iImplInfoArray );
+    iIndex = 0;
+    }
+
+
+TBool CGSPluginIndexer::HasNext()
+    {
+    if( iImplInfoArray.Count() >= iIndex + 1 )
+        {
+        return ETrue;
+        }
+    else
+        {
+        EUNIT_PRINT( _L("CGSPluginIndexer(%d/%d)"), iIndex, iImplInfoArray.Count() );
+        return EFalse;
+        }
+    }
+
+
+TUid CGSPluginIndexer::NextUid()
+    {
+    EUNIT_PRINT( _L("NextUid(%d/%d)"), iIndex, iImplInfoArray.Count() );
+    return iImplInfoArray[ iIndex++ ]->ImplementationUid();
+    }
+
+
+void CGSPluginIndexer::ResetIndex()
+    {
+    iIndex = 0;
+    }
+
+
+TInt CGSPluginIndexer::Index()
+    {
+    return iIndex;
+    }
+
+TInt CGSPluginIndexer::Count()
+    {
+    return iImplInfoArray.Count();
+    }
+
+///////////////////////////////////////////////////////////////
+
+
+// CONSTRUCTION
+T_CGSPluginInterface* T_CGSPluginInterface::NewL()
+    {
+    T_CGSPluginInterface* self = T_CGSPluginInterface::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+T_CGSPluginInterface* T_CGSPluginInterface::NewLC()
+    {
+    T_CGSPluginInterface* self = new( ELeave ) T_CGSPluginInterface();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+T_CGSPluginInterface::~T_CGSPluginInterface()
+    {
+    delete iPluginIndexer;
+    }
+
+// Default constructor
+T_CGSPluginInterface::T_CGSPluginInterface()
+    {
+    }
+
+// Second phase construct
+void T_CGSPluginInterface::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+
+    // Create iterator for plugins:
+    iPluginIndexer = CGSPluginIndexer::NewL( KGSPluginInterfaceUid );
+    }
+
+//  METHODS
+
+
+void T_CGSPluginInterface::SetupL(  )
+    {
+    if( !iPluginIndexer->HasNext() )
+        {
+        iPluginIndexer->ResetIndex();
+        }
+    }
+
+void T_CGSPluginInterface::Teardown(  )
+    {
+//    REComSession::DestroyedImplementation( iCGSPluginInterface->DestructorID() );
+//    delete iCGSPluginInterface;
+//    iCGSPluginInterface = NULL;
+//    REComSession::FinalClose();
+    }
+
+
+void T_CGSPluginInterface::T_CGSPluginInterface_SetToBlacklistL()
+    {
+    TUid toBeBlacklisted = {  0x10282E06 };
+    EUNIT_PRINT( _L("Setting 0x%X to blacklist..."), toBeBlacklisted.iUid );
+
+    CGSWatchDog* dog =  CGSWatchDog::NewL();
+    CleanupStack::PushL( dog );
+    dog->QuarantineL( toBeBlacklisted );
+    // Destroying watchdog without removing from quarantine will blacklist the 
+    // plugin.
+    CleanupStack::PopAndDestroy( dog );
+    
+    dog =  CGSWatchDog::NewL();
+    CleanupStack::PushL( dog );
+    dog->QuarantineL( toBeBlacklisted );
+    // Destroying watchdog without removing from quarantine will blacklist the 
+    // plugin. Do this twice as dog does not blacklist for the first run.
+    CleanupStack::PopAndDestroy( dog );
+    
+    dog =  CGSWatchDog::NewL();
+    CleanupStack::PushL( dog );
+    
+    EUNIT_ASSERT_DESC( dog->IsInBlackList( toBeBlacklisted ), 
+            "The plugin should be in the blacklist");
+    
+    CleanupStack::PopAndDestroy( dog );
+    EUNIT_PRINT( _L("setting to blacklist done.") );
+    }
+
+
+void T_CGSPluginInterface::T_CGSPluginInterface_ResetBlacklistL()
+    {
+    EUNIT_PRINT( _L("Resetting blacklist...") );
+    TInt runs = KGSDefaultMaxPluginBlackListedRuns + 1;
+    for( TInt i = 0; i < runs; i++ )
+        {
+        CGSWatchDog* dog =  CGSWatchDog::NewL();
+        CleanupStack::PushL( dog );
+        dog->ReportCleanExitL();
+        CleanupStack::PopAndDestroy( dog );
+        }
+    EUNIT_PRINT( _L("Resetting blacklist done.") );
+    }
+
+
+void T_CGSPluginInterface::T_CGSPluginInterface_CheckHeapL()
+    {
+    EUNIT_PRINT( _L("CheckHeapL...") );
+    RHeap heap = User::Heap();
+    TInt maxBlock;
+    TInt free;
+    TInt delta;
+    TBuf<256> buf;
+    TUid plgId;
+    _LIT( KCaptionErr, "Caption unavailable");
+
+    CGSWatchDog* dog =  CGSWatchDog::NewL();
+    CleanupStack::PushL( dog );
+
+    while( iPluginIndexer->HasNext() )
+        {
+        EUNIT_PRINT( _L("Heap test (%d/%d)..."), iPluginIndexer->Index()+1, iPluginIndexer->Count() );
+        plgId = iPluginIndexer->NextUid();
+        if( dog->IsInBlackList( plgId ) )
+            {
+            EUNIT_PRINT( _L("Blacklisted: 0x%X"), plgId.iUid );
+            continue;
+            }
+        dog->QuarantineL( plgId );
+
+        free = heap.Available( maxBlock );
+
+        CGSPluginInterface* plugin = CGSPluginInterface::NewL( plgId, NULL );
+        TRAPD(
+            err,
+            plugin->GetCaptionL( buf );
+            );
+        if( err )
+            {
+            buf = KCaptionErr;
+            }
+        EUNIT_PRINT( _L("Releasing (0x%X %S)..."), plgId.iUid, &buf );
+        REComSession::DestroyedImplementation( plugin->DestructorID() );
+        EUNIT_PRINT( _L("Deleting (0x%X %S)..."), plgId.iUid, &buf );
+        delete plugin;
+        plugin = NULL;
+        EUNIT_PRINT( _L("REComSession::FinalClose()...") );
+        REComSession::FinalClose();
+
+        delta = heap.Available( maxBlock ) - free;
+        
+        EUNIT_PRINT( _L("Plugin heap alloc (%S, 0x%X) delta:%d"), &buf, plgId.iUid, delta );
+        if( delta > 0 )
+            {
+            EUNIT_PRINT( _L("MEMORY LEAK: %S(0x%X) delta:%d"), &buf, plgId.iUid, delta );
+            }
+        dog->RemoveFromQuarantineL( plgId );
+        }
+    dog-> ReportCleanExitL();
+    CleanupStack::PopAndDestroy( dog );
+    EUNIT_ASSERT_DESC( ETrue, "Wow, the test ran here without a crash!");
+    EUNIT_PRINT( _L("CheckHeapL finished.") );
+    }
+
+
+void T_CGSPluginInterface::T_CGSPluginInterface__CGSPluginInterfaceL(  )
+    {
+//    iCGSPluginInterface->~CGSPluginInterface( );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_GetCaptionLL(  )
+    {
+    // iCGSPluginInterface->GetCaptionL( <add parameters here > );
+    EUNIT_PRINT( _L("Caption test...") );
+    EUNIT_ASSERT_DESC( /*EFalse*/ETrue, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_GetValueL(  )
+    {
+    // iCGSPluginInterface->GetValue( <add parameters here > );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_HandleSelectionL(  )
+    {
+    // iCGSPluginInterface->HandleSelection( <add parameters here > );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_ItemTypeL(  )
+    {
+    iCGSPluginInterface->ItemType( );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_MenuActivationItemL(  )
+    {
+    iCGSPluginInterface->MenuActivationItem( );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_CreateIconLL(  )
+    {
+    // iCGSPluginInterface->CreateIconL( <add parameters here > );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_PluginProviderCategoryL(  )
+    {
+    iCGSPluginInterface->PluginProviderCategory( );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_CustomOperationLL(  )
+    {
+    // iCGSPluginInterface->CustomOperationL( <add parameters here > );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_VisibleL(  )
+    {
+    iCGSPluginInterface->Visible( );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_ResetSelectedItemIndexL(  )
+    {
+    iCGSPluginInterface->ResetSelectedItemIndex( );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+void T_CGSPluginInterface::T_CGSPluginInterface_SetOrderL(  )
+    {
+    // iCGSPluginInterface->SetOrder( <add parameters here > );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+
+
+//  TEST TABLE
+EUNIT_BEGIN_TEST_TABLE(
+    T_CGSPluginInterface,
+    "Add test suite description here.",
+    "UNIT" )
+
+EUNIT_TEST(
+    "~CGSPluginInterface - test0",
+    "CGSPluginInterface",
+    "~CGSPluginInterface - test0",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface__CGSPluginInterfaceL, Teardown)
+
+EUNIT_TEST(
+    "GetCaptionL - test1",
+    "CGSPluginInterface",
+    "GetCaptionL - test1",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_GetCaptionLL, Teardown)
+
+EUNIT_TEST(
+    "GetValue - test2",
+    "CGSPluginInterface",
+    "GetValue - test2",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_GetValueL, Teardown)
+
+EUNIT_TEST(
+    "HandleSelection - test3",
+    "CGSPluginInterface",
+    "HandleSelection - test3",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_HandleSelectionL, Teardown)
+
+EUNIT_TEST(
+    "ItemType - test4",
+    "CGSPluginInterface",
+    "ItemType - test4",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_ItemTypeL, Teardown)
+
+EUNIT_TEST(
+    "MenuActivationItem - test5",
+    "CGSPluginInterface",
+    "MenuActivationItem - test5",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_MenuActivationItemL, Teardown)
+
+EUNIT_TEST(
+    "CreateIconL - test6",
+    "CGSPluginInterface",
+    "CreateIconL - test6",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_CreateIconLL, Teardown)
+
+EUNIT_TEST(
+    "PluginProviderCategory - test7",
+    "CGSPluginInterface",
+    "PluginProviderCategory - test7",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_PluginProviderCategoryL, Teardown)
+
+EUNIT_TEST(
+    "CustomOperationL - test8",
+    "CGSPluginInterface",
+    "CustomOperationL - test8",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_CustomOperationLL, Teardown)
+
+EUNIT_TEST(
+    "Visible - test9",
+    "CGSPluginInterface",
+    "Visible - test9",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_VisibleL, Teardown)
+
+EUNIT_TEST(
+    "ResetSelectedItemIndex - test10",
+    "CGSPluginInterface",
+    "ResetSelectedItemIndex - test10",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_ResetSelectedItemIndexL, Teardown)
+
+EUNIT_TEST(
+    "SetOrder - test11",
+    "CGSPluginInterface",
+    "SetOrder - test11",
+    "FUNCTIONALITY",
+    SetupL, T_CGSPluginInterface_SetOrderL, Teardown)
+
+EUNIT_TEST(
+        "Check heap - test12",
+        "CGSPluginInterface",
+        "Check heap - test12",
+        "FUNCTIONALITY",
+        SetupL, T_CGSPluginInterface_CheckHeapL, Teardown)
+
+EUNIT_TEST(
+        "Reset blacklist - test13",
+        "CGSPluginInterface",
+        "Reset blacklist - test13",
+        "FUNCTIONALITY",
+        SetupL, T_CGSPluginInterface_ResetBlacklistL, Teardown)
+
+        EUNIT_TEST(
+        "Set to blacklist - test14",
+        "CGSPluginInterface",
+        "Set to blacklist - test14",
+        "FUNCTIONALITY",
+        SetupL, T_CGSPluginInterface_SetToBlacklistL, Teardown)
+
+        
+
+EUNIT_END_TEST_TABLE
+
+
+
+
+
+
+
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef __T_CGSPLUGININTERFACE_H__
+#define __T_CGSPLUGININTERFACE_H__
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+
+
+//  INTERNAL INCLUDES
+#include <GSPluginInterface.h>
+
+//  FORWARD DECLARATIONS
+
+
+//  CLASS DEFINITION
+
+/**
+ * Utility go through all ECOM plugins for a certain interface.
+ */
+NONSHARABLE_CLASS( CGSPluginIndexer ) : public CBase
+    {
+    public:
+
+        /**
+         * @param aInterface Interface Id for which the plugins should be 
+         * listed.
+         */
+        static CGSPluginIndexer* NewL( TUid aInterface );
+        
+        ~CGSPluginIndexer();
+        void ConstructL();
+
+        /**
+         * @return ETrue if has still items and NextUid() can be called.
+         */
+        TBool HasNext();
+        
+        /**
+         * @return Next Uid of the listed plugins.
+         */
+        TUid NextUid();
+        
+        /**
+         * Resets the interator location to the first item [0].
+         */
+        void ResetIndex();
+        
+        /**
+         * @return Current position in the list.
+         */
+        TInt Index();
+        
+        /**
+         * @return Number of items in the list.
+         */
+        TInt Count();
+
+    private:
+    
+        CGSPluginIndexer( TUid aInterface );
+        TUid iInterfaceUid;
+        TInt iIndex;
+        RImplInfoPtrArray iImplInfoArray;
+    };
+
+
+/**
+ * Auto-generated EUnit test suite
+ *
+ */
+NONSHARABLE_CLASS( T_CGSPluginInterface )
+	: public CEUnitTestSuiteClass
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static T_CGSPluginInterface* NewL();
+        static T_CGSPluginInterface* NewLC();
+        /**
+         * Destructor
+         */
+        ~T_CGSPluginInterface();
+
+    private:    // Constructors and destructors
+
+        T_CGSPluginInterface();
+        void ConstructL();
+
+    private:    // New methods
+
+         void SetupL();
+
+         void Teardown();
+
+         /**
+          * Functions for testing memory leaks...
+          */
+         void T_CGSPluginInterface_CheckHeapL();
+         void T_CGSPluginInterface_ResetBlacklistL();
+         void T_CGSPluginInterface_SetToBlacklistL();
+  
+         void T_CGSPluginInterface__CGSPluginInterfaceL();
+
+         void T_CGSPluginInterface_GetCaptionLL();
+
+         void T_CGSPluginInterface_GetValueL();
+
+         void T_CGSPluginInterface_HandleSelectionL();
+
+         void T_CGSPluginInterface_ItemTypeL();
+
+         void T_CGSPluginInterface_MenuActivationItemL();
+
+         void T_CGSPluginInterface_CreateIconLL();
+
+         void T_CGSPluginInterface_PluginProviderCategoryL();
+
+         void T_CGSPluginInterface_CustomOperationLL();
+
+         void T_CGSPluginInterface_VisibleL();
+
+         void T_CGSPluginInterface_ResetSelectedItemIndexL();
+
+         void T_CGSPluginInterface_SetOrderL();
+
+
+    private:    // Data
+
+        CGSPluginInterface* iCGSPluginInterface;
+        CGSPluginIndexer* iPluginIndexer;
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  __T_CGSPLUGININTERFACE_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface_DllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "T_CGSPluginInterface.h"
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return T_CGSPluginInterface::NewL();
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll( TDllReason )
+	{
+	return KErrNone;
+	}
+#endif
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/private/T_CGSPluginInterface.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+
+TARGET          		    T_CGSPluginInterface.dll
+TARGETTYPE      		    dll
+UID             		    0x1000af5a 0x01700000
+
+CAPABILITY              ALL -TCB //-DRM
+VENDORID                0x00000000
+
+SOURCEPATH              Src
+SOURCE                  T_CGSPluginInterface.cpp
+
+// Sources required by the test suite
+SOURCEPATH              Src
+SOURCE                  T_CGSPluginInterface_DllMain.cpp
+
+USERINCLUDE             Src
+
+// User include folders required by the tested code
+USERINCLUDE             ../../../../devmngt_dom/settings_plugin_api/inc
+USERINCLUDE             ../../GSFramework/inc\
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE           /epoc32/include/Digia/EUnit
+SYSTEMINCLUDE           /epoc32/include/ecom
+
+LIBRARY                 EUnit.lib
+LIBRARY                 EUnitUtil.lib
+LIBRARY                 euser.lib
+LIBRARY 				        GSFramework.lib
+LIBRARY 				        GSEcomPlugin.lib
+LIBRARY 				        ecom.lib
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/private/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+    ARMV5 WINSCW
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+
+PRJ_TESTMMPFILES
+T_CGSPluginInterface.mmp
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/private/move_T_GSPluginInterface.bat	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,17 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+copy \epoc32\RELEASE\winscw\udeb\T_CGSPluginInterface.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_CGSLauncherU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,2 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_GSFrameworku.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSBackgroundImageU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,2 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSListBoxu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/MT_CGSLauncherU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/MT_GSFrameworku.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSBackgroundImageU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSListBoxu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,304 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "T_GSBackgroundImage.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <e32base.h>
+
+//  INTERNAL INCLUDES
+//#include "BackgroundImage.cpp"
+
+// CONSTANTS
+_LIT( KGSTestEmptyString, "" );
+_LIT( KGSTestDestinationPath, "c:\\data\\bin\\test_path");
+
+// CONSTRUCTION
+T_GSBackgroundImage* T_GSBackgroundImage::NewL()
+    {
+    T_GSBackgroundImage* self = T_GSBackgroundImage::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+T_GSBackgroundImage* T_GSBackgroundImage::NewLC()
+    {
+    T_GSBackgroundImage* self = new( ELeave ) T_GSBackgroundImage();
+    CleanupStack::PushL( self );
+
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+T_GSBackgroundImage::~T_GSBackgroundImage()
+    {
+    }
+
+// Default constructor
+T_GSBackgroundImage::T_GSBackgroundImage()
+    {
+    }
+
+// Second phase construct
+void T_GSBackgroundImage::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+//  METHODS
+
+
+void T_GSBackgroundImage::EmptySetupL(  )
+    {
+    }
+
+void T_GSBackgroundImage::EmptyTeardown(  )
+	{
+	}
+	
+void T_GSBackgroundImage::SetupBackgroundImageL()
+    {
+    iFs.Connect();
+    iCGSBackgroundImage = CGSBackgroundImage::NewL();
+    }
+    
+void T_GSBackgroundImage::SetupBackgroundImageAndAsyncHandlerL()
+    {
+    iFs.Connect();
+    iCGSBackgroundImage = CGSBackgroundImage::NewL();
+    iImgHandler = CGSAsyncImageHandling::NewL( iFs,
+                this, KGSTestDestinationPath );
+    }
+
+void T_GSBackgroundImage::Teardown(  )
+    {
+    if( iCGSBackgroundImage )
+        {
+        delete iCGSBackgroundImage;
+        iCGSBackgroundImage = NULL;
+        }
+    iFs.Close();
+    
+    if( iImgHandler )
+        {
+        iImgHandler->Cancel();
+        delete iImgHandler;
+        iImgHandler = NULL;
+        }
+    }
+    
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_NewL(  )
+    {
+    CGSBackgroundImage* image = CGSBackgroundImage::NewL();
+    CleanupStack::PushL( image );
+    EUNIT_ASSERT( image != NULL );
+    CleanupStack::PopAndDestroy( image );
+    }
+    
+void T_GSBackgroundImage::T_Global_BackgroundImage_GetPlnsStatus()
+    {
+    TInt returnValue;
+    EUNIT_ASSERT_NO_LEAVE( returnValue = iCGSBackgroundImage->GetPlnsStatus() );
+    EUNIT_PRINT( _L("returnValue = %d"), returnValue );
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_BackgroundImageL()
+    {
+    TInt returnValue;
+    EUNIT_ASSERT_NO_LEAVE( returnValue = iCGSBackgroundImage->BackgroundImageL() );
+    EUNIT_PRINT( _L("returnValue = %d"), returnValue );
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImageL()
+    {
+    TInt setValue = 1;
+    EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->SetBackgroundImageL( 
+                                                           setValue ) );
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImagePathL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->SetBackgroundImagePathL( 
+            KGSTestEmptyString ) );
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImagePath2L()
+    {
+    TInt desLenght = 25;
+    RBuf rbuf;
+    rbuf.CreateL( KGSTestDestinationPath );
+    rbuf.CleanupClosePushL();
+    //TBuf<desLenght> destinationPath( KGSTestDestinationPath );
+    EUNIT_ASSERT_NO_LEAVE(iCGSBackgroundImage->SetBackgroundImagePathL( 
+            KGSTestEmptyString, rbuf ) );
+    CleanupStack::PopAndDestroy();
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImagePath3L()
+    {
+    TGSWallpaperType wallType = EGSWallpaperIdle;
+    RBuf rbuf;
+    rbuf.CreateL( KGSTestDestinationPath );
+    rbuf.CleanupClosePushL();
+    EUNIT_ASSERT_NO_LEAVE(iCGSBackgroundImage->SetBackgroundImagePathL( 
+            KGSTestEmptyString, rbuf, wallType ) );
+    CleanupStack::PopAndDestroy();
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_CreateImageHandlingAsyncObjectL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iImgHandler = CGSAsyncImageHandling::NewL( iFs,
+            this, KGSTestDestinationPath ) );
+    }
+
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_SetWelcomeNoteImageL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->
+            SetWelcomeNoteImageL( KGSTestDestinationPath, *iImgHandler ) );
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_SetVtStillImagePathL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->SetVTStillImagePathL( 
+            KGSTestDestinationPath, *iImgHandler ) );
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_IsPersonalisationApplicationL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->
+            IsPersonalisationApplicationL() );
+    }
+
+void T_GSBackgroundImage::T_Global_BackgroundImage_DeleteImageL()
+    {
+    EUNIT_ASSERT_LEAVE( iCGSBackgroundImage->
+            DeleteImageL( KGSTestDestinationPath ) );
+    }
+
+void T_GSBackgroundImage::ImageHandlingCompleteL( TInt /*aError*/ )
+    {
+    
+    }
+
+//  TEST TABLE
+EUNIT_BEGIN_TEST_TABLE(
+    T_GSBackgroundImage,
+    "Testing BackgroundImage.dll functionality",
+    "UNIT" )
+
+EUNIT_TEST(
+    "BackgroundImage - NewL construction", //case description
+    "CGSBackgroundImage",                   //class being tested
+    "NewL",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    EmptySetupL, T_Global_BackgroundImage_NewL, EmptyTeardown )
+
+EUNIT_TEST(
+    "BackgroundImage - GetPlnsStatus()",
+    "CGSBackgroundImage",                
+    "GetPlnsStatus",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, T_Global_BackgroundImage_GetPlnsStatus, Teardown )    
+
+EUNIT_TEST(
+    "BackgroundImage - BackgroundImage()",
+    "CGSBackgroundImage",                
+    "BackgroundImage",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, T_Global_BackgroundImage_BackgroundImageL, Teardown )
+    
+EUNIT_TEST(
+    "BackgroundImage - SetBackgroundImageL()",
+    "CGSBackgroundImage",                
+    "SetBackgroundImageL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImageL, Teardown )
+    
+EUNIT_TEST(
+    "BackgroundImage - SetBackgroundImagePathL()",
+    "CGSBackgroundImage",                
+    "SetBackgroundImagePathL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImagePathL, Teardown )
+    
+EUNIT_TEST(
+    "BackgroundImage - SetBackgroundImagePath2L()",
+    "CGSBackgroundImage",                
+    "Overloaded version of SetBackgroundImagePathL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImagePath2L, Teardown ) 
+    
+EUNIT_TEST(
+    "BackgroundImage - SetBackgroundImagePath3L()",
+    "CGSBackgroundImage",                
+    "Second overloaded version of SetBackgroundImagePathL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImagePath3L, Teardown )
+    
+EUNIT_TEST(
+    "BackgroundImage - IsPersonalisationApplicationL()",
+    "CGSBackgroundImage",                
+    "IsPersonalisationApplicationL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, 
+        T_Global_BackgroundImage_IsPersonalisationApplicationL, Teardown )
+        
+EUNIT_TEST(
+    "BackgroundImage - DeleteImageL()",
+    "CGSBackgroundImage",                
+    "DeleteImageL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, T_Global_BackgroundImage_DeleteImageL, Teardown )        
+    
+EUNIT_TEST(
+    "BackgroundImage - Creation of AsyncImageHandler()",
+    "CGSAsyncImageHandling",                
+    "NewL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageL, 
+        T_Global_BackgroundImage_CreateImageHandlingAsyncObjectL, Teardown ) 
+
+EUNIT_TEST(
+    "BackgroundImage - SetWelcomeNoteImageL()",
+    "CGSBackgroundImage",                
+    "SetWelcomeNoteImageL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageAndAsyncHandlerL, 
+        T_Global_BackgroundImage_SetWelcomeNoteImageL, Teardown )
+        
+EUNIT_TEST(
+    "BackgroundImage - SetVtStillImagePathL()",
+    "CGSBackgroundImage",                
+    "SetVtStillImagePathL",                     
+    "FUNCTIONALITY",                     
+    SetupBackgroundImageAndAsyncHandlerL, 
+        T_Global_BackgroundImage_SetVtStillImagePathL, Teardown )      
+        
+EUNIT_END_TEST_TABLE
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef __T_GSBACKGROUNDIMAGE_H__
+#define __T_GSBACKGROUNDIMAGE_H__
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include <BackgroundImage.h>
+#include <f32file.h>
+#include <GsAsyncImageHandling.h>
+#include <MGsAsyncImageHandlingObserver.h>
+
+//  INTERNAL INCLUDES
+//#include "BackgroundImage.cpp"
+
+//  FORWARD DECLARATIONS
+
+
+//  CLASS DEFINITION
+NONSHARABLE_CLASS( T_GSBackgroundImage )
+	: public CEUnitTestSuiteClass,
+	  public MGSAsyncImageHandlingObserver
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static T_GSBackgroundImage* NewL();
+        static T_GSBackgroundImage* NewLC();
+        /**
+         * Destructor
+         */
+        ~T_GSBackgroundImage();
+        
+    public: //From MGSAsyncImageHandlingObserver
+        void ImageHandlingCompleteL( TInt aError );
+
+    private:    // Constructors and destructors
+
+        T_GSBackgroundImage();
+        void ConstructL();
+
+    private:    // New methods
+
+         void EmptySetupL();
+         
+         void EmptyTeardown();
+        
+         void Teardown();
+        
+         void SetupBackgroundImageL();
+         void SetupBackgroundImageAndAsyncHandlerL();
+         
+         void T_Global_BackgroundImage_NewL();
+         void T_Global_BackgroundImage_GetPlnsStatus();
+         void T_Global_BackgroundImage_BackgroundImageL();
+         void T_Global_BackgroundImage_SetBackgroundImageL();
+         void T_Global_BackgroundImage_SetBackgroundImagePathL();
+         void T_Global_BackgroundImage_SetBackgroundImagePath2L();
+         void T_Global_BackgroundImage_SetBackgroundImagePath3L();
+         void T_Global_BackgroundImage_CreateImageHandlingAsyncObjectL();
+         void T_Global_BackgroundImage_SetWelcomeNoteImageL();
+         void T_Global_BackgroundImage_SetVtStillImagePathL();
+         void T_Global_BackgroundImage_IsPersonalisationApplicationL();
+         void T_Global_BackgroundImage_DeleteImageL();
+        
+
+    private:    // Data
+		
+        CGSBackgroundImage* iCGSBackgroundImage;
+        CGSAsyncImageHandling* iImgHandler;
+        RFs iFs;
+        EUNIT_DECLARE_TEST_TABLE; 
+
+    };
+
+#endif      //  __T_GSBACKGROUNDIMAGE_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage_DllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "T_GSBackgroundImage.h"
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return T_GSBackgroundImage::NewL();
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll( TDllReason )
+	{
+	return KErrNone;
+	}
+#endif
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1315 @@
+/*
+* Copyright (c) 2002 - 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "MT_GSFramework.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+
+//#include <..\..\..\..\GSFramework\src\GSParentContainer.cpp>
+#include <APGCLI.H>	// RApaLsSession
+
+#include "TestGSPlugin.h"
+
+
+//  INTERNAL INCLUDES
+
+const TUid KTestActiveViewId = {  0x10 };
+const TUid KTestWhateverPubSubId = {  0x00 };
+const TInt KTestWhateverPubSubKey = 0;
+
+
+// CONSTRUCTION
+MT_GSFramework* MT_GSFramework::NewL()
+    {
+    MT_GSFramework* self = MT_GSFramework::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_GSFramework* MT_GSFramework::NewLC()
+    {
+    MT_GSFramework* self = new( ELeave ) MT_GSFramework();
+    CleanupStack::PushL( self );
+
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+MT_GSFramework::~MT_GSFramework()
+    {
+    }
+
+// Default constructor
+MT_GSFramework::MT_GSFramework()
+    {
+    }
+
+// Second phase construct
+void MT_GSFramework::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+void MT_GSFramework::SetupNone()
+    {
+    }
+
+
+void MT_GSFramework::TeardownNone()
+    {
+    }
+
+
+
+////////////////// CGSTabHelper test cases //////////////////////////////////
+
+
+void MT_GSFramework::SetupTabHelperL(  )
+    {
+    iCGSTabHelper = CGSTabHelper::NewL();
+    iPlugins = 	new (ELeave) CArrayPtrFlat<CGSPluginInterface>(2);
+    iTabbedViews = 	new (ELeave) CArrayPtrFlat<MGSTabbedView>(2);
+    }
+
+
+void MT_GSFramework::TeardownTabHelper()
+    {
+    delete iCGSTabHelper;
+    iCGSTabHelper = NULL;
+    delete iPlugins;
+    iPlugins = NULL;
+    delete iTabbedViews;
+    iTabbedViews = NULL;
+    }
+
+
+void MT_GSFramework::T_CGSTabHelper_NewLL()
+    {
+    CGSTabHelper* ptr = CGSTabHelper::NewL();
+    EUNIT_ASSERT( ptr );
+    delete ptr;
+    }
+
+void MT_GSFramework::T_CGSTabHelper_NewLCL()
+    {
+    CGSTabHelper* ptr = CGSTabHelper::NewLC();
+    EUNIT_ASSERT( ptr );
+    CleanupStack::PopAndDestroy();
+    }
+
+
+
+void MT_GSFramework::T_CGSTabHelper__CGSTabHelperL(  )
+    {
+    RHeap heap = User::Heap();
+    TInt block = 0;
+    TInt after;
+    CGSTabHelper* th;
+
+    TInt before = heap.Available( block );
+
+    th = CGSTabHelper::NewL();
+    delete th;
+
+    after = heap.Available( block );
+    TInt delta = before - after;
+
+    EUNIT_ASSERT_DESC( before <= after, "Possible heap memory leak");
+    }
+
+void MT_GSFramework::T_CGSTabHelper_CreateTabGroupLL(  )
+    {
+    iCGSTabHelper->CreateTabGroupL( KTestActiveViewId, this );
+    EUNIT_ASSERT_DESC( ETrue, "Tab group pseudo creation done");
+    }
+
+void MT_GSFramework::T_CGSTabHelper_CreateTabGroupL2L(  )
+    {
+    iCGSTabHelper->CreateTabGroupL( KTestActiveViewId, iPlugins );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far wihout panic?");
+    }
+
+void MT_GSFramework::T_CGSTabHelper_CreateTabGroupL3L(  )
+    {
+    iCGSTabHelper->CreateTabGroupL( KTestActiveViewId, iTabbedViews );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far without panic?");
+    }
+
+void MT_GSFramework::T_CGSTabHelper_RemoveTabGroupL(  )
+    {
+    iCGSTabHelper->RemoveTabGroup();
+    EUNIT_ASSERT_DESC( ETrue, "Run this far without panic?");
+    }
+
+void MT_GSFramework::T_CGSTabHelper_TabChangedLL(  )
+    {
+    TInt tabIndex = 0;
+    iCGSTabHelper->TabChangedL( tabIndex );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far without panic?");
+    }
+
+// MGSTabbedViewOwner
+CArrayPtrFlat<CGSPluginInterface>* MT_GSFramework::TabbedViews()
+	{
+	return iPlugins;
+	}
+
+// MGSTabbedViewOwner
+void MT_GSFramework::TabChangedL( TUid /*selectedTabUid*/ )
+	{
+
+	}
+
+// MGSPluginLoadObserver
+void MT_GSFramework::HandlePluginLoaded( KGSPluginLoaderStatus aStatus )
+    {
+
+    }
+
+
+/////////////////////// CGSPluginLoader test cases ///////////////////////////////////
+void MT_GSFramework::SetupPluginLoaderL()
+    {
+    iPlugins =  new (ELeave) CArrayPtrFlat<CGSPluginInterface>(2);
+
+    CAknViewAppUi* appUi = (CAknViewAppUi*)CEikonEnv::Static()->EikAppUi();
+    iCGSPluginLoader = CGSPluginLoader::NewL( appUi );
+    }
+
+void MT_GSFramework::TearDownPluginLoader()
+    {
+    delete iCGSPluginLoader;
+    iCGSPluginLoader = NULL;
+
+    delete iPlugins;
+    iPlugins = NULL;
+    }
+
+
+void MT_GSFramework::T_CGSPluginLoader_NewL()
+    {
+    CAknViewAppUi* appUi = (CAknViewAppUi*)CEikonEnv::Static()->EikAppUi();
+    iCGSPluginLoader = CGSPluginLoader::NewL( appUi );
+    delete iCGSPluginLoader;
+    iCGSPluginLoader = NULL;
+
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPluginLoader__CGSPluginLoader()
+    {
+    CAknViewAppUi* appUi = (CAknViewAppUi*)CEikonEnv::Static()->EikAppUi();
+    iCGSPluginLoader = CGSPluginLoader::NewL( appUi );
+    delete iCGSPluginLoader;
+    iCGSPluginLoader = NULL;
+
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPluginLoader_LoadAsyncL()
+    {
+    iCGSPluginLoader->LoadAsyncL( KGSPluginInterfaceUid,
+                                  KTestActiveViewId,
+                                  iPlugins );
+
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPluginLoader_SetObserver()
+    {
+    iCGSPluginLoader->SetObserver( this );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPluginLoader_AbortAsyncLoad()
+    {
+    iCGSPluginLoader->AbortAsyncLoad();
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPluginLoader_SortPluginsL()
+    {
+    iCGSPluginLoader->SortPluginsL( iPlugins );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+
+
+/////////////// CGSParentContainer test cases //////////////////////////////
+
+
+// CGSParentContainer
+void MT_GSFramework::SetupParentContainerL()
+	{
+//    iGSParentContainer = new (ELeave) CGSParentContainer();
+//    iGSParentContainer->ConstructL();
+	}
+
+
+void MT_GSFramework::TearDownParentContainer()
+	{
+//	delete iGSParentContainer;
+//    iGSParentContainer = NULL;
+	}
+
+
+// CGSParentContainer test cases:
+void MT_GSFramework::T_CGSParentContainer_FocusChanged()
+	{
+//    iGSParentContainer->FocusChanged( ENoDrawNow );
+#pragma message("TODO: implement real test case!")
+    EUNIT_ASSERT_DESC( EFalse, "Not implemented.");
+	}
+
+
+///////////////////// CGSPubSubsListener test cases ///////////////////////
+
+void MT_GSFramework::SetupPubSubsListenerL()
+    {
+    iCGSPubSubsListener = CGSPubSubsListener::NewL( KTestWhateverPubSubId,
+                                                    KTestWhateverPubSubKey,
+                                                    this );
+    }
+
+void MT_GSFramework::TearDownPubSubsListener()
+    {
+    delete iCGSPubSubsListener;
+    iCGSPubSubsListener = NULL;
+    }
+
+
+void MT_GSFramework::T_CGSPubSubsListener_NewL()
+    {
+    CGSPubSubsListener* psl = CGSPubSubsListener::NewL( KTestWhateverPubSubId,
+            KTestWhateverPubSubKey,
+            this );
+    delete psl;
+    psl = NULL;
+
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPubSubsListener__CGSPubSubsListener()
+    {
+    CGSPubSubsListener* psl = CGSPubSubsListener::NewL( KTestWhateverPubSubId,
+            KTestWhateverPubSubKey,
+            this );
+    delete psl;
+    psl = NULL;
+
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPubSubsListener_Get1()
+    {
+    TInt val = 0;
+    iCGSPubSubsListener->Get( val );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPubSubsListener_Get2()
+    {
+    TBuf8<25> buf;
+    iCGSPubSubsListener->Get( buf );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+void MT_GSFramework::T_CGSPubSubsListener_Get3()
+    {
+    TBuf16<25> buf;
+    iCGSPubSubsListener->Get( buf );
+    EUNIT_ASSERT_DESC( ETrue, "Run this far?");
+    }
+
+
+// From MGSSettingPSObserver
+void MT_GSFramework::HandleNotifyPSL( const TUid aUid,
+                                      const TInt& aKey,
+                                      const TRequestStatus& aStatus )
+    {
+
+    }
+
+// ------------------------------- Launch Gs application test cases ---------------------------------------//
+
+void MT_GSFramework::SetupLaunch()
+    {
+    iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
+
+    // Launch Gs application...
+    RApaLsSession lsSession;
+    User::LeaveIfError( lsSession.Connect() );
+    CleanupClosePushL( lsSession );
+
+	TApaAppInfo appInfo;
+	TUid uid;
+	uid.iUid = 0x100058EC;	// Gs application uid
+	User::LeaveIfError( lsSession.GetAppInfo(appInfo, uid) );
+    TFileName appName = appInfo.iFullName;
+
+    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+    cmdLine->SetExecutableNameL( appName );
+    cmdLine->SetCommandL( EApaCommandRun );
+    User::LeaveIfError( lsSession.StartApp( *cmdLine ) );
+
+    CleanupStack::PopAndDestroy( cmdLine );
+    CleanupStack::PopAndDestroy();	// lsSession
+    }
+
+
+void MT_GSFramework::TeardownLaunch()
+    {
+    if ( !iPeriodic->IsActive() )
+    	{
+	    iPeriodic->Start( 2000000, 1000000, TCallBack( CloseTopMostWindow, static_cast<TAny*>( this ) ) );
+    	}
+
+    CActiveScheduler::Start();
+
+	// Close the error note
+	ikeySimulateCase = 0;
+	iKeyNumber = 0;
+    if ( !iPeriodic->IsActive() )
+    	{
+	    iPeriodic->Start( 2000000, 500000, TCallBack( SimulateKeyEvent, static_cast<TAny*>( this ) ) );
+    	}
+
+    CActiveScheduler::Start();
+
+    if ( iPeriodic )
+        {
+        iPeriodic->Cancel();
+        }
+    delete iPeriodic;
+    }
+
+
+TBool MT_GSFramework::GetKeyCodeCase0( TKeyCode& aKeyCode )
+	{
+	TBool ret = ETrue;
+    iKeyNumber++;
+
+    switch ( iKeyNumber )
+    	{
+    	case 1:
+    		aKeyCode = EKeyOK;
+    		break;
+    	default:
+    		ret = EFalse;
+    	}
+
+    return ret;
+	}
+
+
+TInt MT_GSFramework::CloseTopMostWindow( TAny* aPtr )
+    {
+    MT_GSFramework* instL = static_cast<MT_GSFramework*>( aPtr );
+    instL->DoCloseTopMostWindowL();
+
+    CActiveScheduler::Stop();
+	return KErrNone;
+    }
+
+void MT_GSFramework::DoCloseTopMostWindowL()
+	{
+	RWsSession* ws = &CCoeEnv::Static()->WsSession();
+
+    // Get a list of IDs of the all the window groups
+    CArrayFixFlat<TInt>* windowList = new CArrayFixFlat<TInt>(4);
+    CleanupStack::PushL(windowList);
+    // Get a list of window group IDs
+    User::LeaveIfError(ws->WindowGroupList(0, windowList));
+
+    // Get the top most window group
+    TInt wgId = (*windowList)[0];
+
+	CleanupStack::PopAndDestroy(); // windowList
+
+	TApaTask task(*ws);
+	task.SetWgId(wgId);
+	task.SendSystemEvent(EApaSystemEventShutdown);
+
+	iPeriodic->Cancel();
+	}
+
+TInt MT_GSFramework::SimulateKeyEvent( TAny* aPtr )
+    {
+    MT_GSFramework* instL = static_cast<MT_GSFramework*>( aPtr );
+
+    instL->DoSimulateKeyEventL();
+
+	return KErrNone;
+    }
+
+void MT_GSFramework::DoSimulateKeyEventL()
+	{
+	TKeyCode keyCode;
+	TBool hasKey;
+
+	switch ( ikeySimulateCase )
+		{
+		case 0:
+			hasKey = GetKeyCodeCase0( keyCode );
+			break;
+		case 1:
+			hasKey = GetKeyCodeCase1( keyCode );
+			break;
+		case 2:
+			hasKey = GetKeyCodeCase2( keyCode );
+			break;
+		case 3:
+			hasKey = GetKeyCodeCase3( keyCode );
+			break;
+		case 4:
+			hasKey = GetKeyCodeCase4( keyCode );
+			break;
+		default:
+			hasKey = EFalse;
+		}
+
+	if ( hasKey )
+		{
+	    TKeyEvent event;
+	    event.iCode = keyCode;
+	    event.iScanCode = 0;
+	    event.iRepeats = 0;
+	    event.iModifiers = 0;
+
+		TWsEvent wsEvent;
+		*( wsEvent.Key() ) = event;
+		wsEvent.SetType( EEventKey );
+		wsEvent.SetTimeNow();
+
+		RWsSession*	ws = &CCoeEnv::Static()->WsSession();
+
+		TInt wgId = ws->GetFocusWindowGroup();
+		ws->SendEventToWindowGroup( wgId, wsEvent );
+		}
+	else
+		{
+		iPeriodic->Cancel();
+		CActiveScheduler::Stop();
+		}
+	}
+void MT_GSFramework::LaunchGsApp1L()
+	{
+	ikeySimulateCase = 1;
+	iKeyNumber = 0;
+    if ( !iPeriodic->IsActive() )
+    {
+    iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast<TAny*>( this ) ) );
+    }
+
+    CActiveScheduler::Start();
+	}
+
+TBool MT_GSFramework::GetKeyCodeCase1( TKeyCode& aKeyCode )
+	{
+	TBool ret = ETrue;
+    iKeyNumber++;
+
+    switch ( iKeyNumber )
+    	{
+    	case 1:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 2:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 3:
+    		aKeyCode = EKeyUpArrow;
+    		break;
+    	case 4:
+    		aKeyCode = EKeyEnter;	// Phone
+    		break;
+    	case 5:
+    		aKeyCode = EKeyEnter;	// Date & time
+    		break;
+    	case 6:
+    		aKeyCode = EKeyEnter;	// Time
+    		break;
+    	case 7:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 8:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 9:
+    		aKeyCode = EKeyEnter;	// Time Zone
+    		break;
+    	case 10:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 11:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 12:
+    		aKeyCode = EKeyEnter;	// Date
+    		break;
+    	case 13:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 14:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 15:
+    		aKeyCode = EKeyEnter;	// Date format
+    		break;
+    	case 16:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 17:
+    		aKeyCode = EKeyCBA1;
+    		break;
+     	case 18:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 19:
+    		aKeyCode = EKeyEnter;	// Date separator
+    		break;
+    	case 20:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 21:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 22:
+    		aKeyCode = EKeyEnter;	// Time format
+    		break;
+    	case 23:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 24:
+    		aKeyCode = EKeyEnter;	// Time separator
+    		break;
+    	case 25:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 26:
+    		aKeyCode = EKeyEnter;	// Clock type
+    		break;
+    	case 27:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 28:
+    		aKeyCode = EKeyEnter;	// Clock Alarm Tone
+    		break;
+     	case 29:
+     		User::After(2000000);
+    		aKeyCode = EKeyCBA2;
+    		break;
+     	case 30:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 31:
+    		aKeyCode = EKeyEnter;	// Alarm Snooze Time
+    		break;
+     	case 32:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 33:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 34:
+    		aKeyCode = EKeyEnter;	// Workdays
+    		break;
+     	case 35:
+    		aKeyCode = EKeyCBA2;
+    		break;
+     	case 36:
+    		aKeyCode = EKeyCBA2;
+    		break;
+     	case 37:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	default:
+    		ret = EFalse;
+    	}
+
+    return ret;
+	}
+
+void MT_GSFramework::LaunchGsApp2L()
+	{
+	ikeySimulateCase = 2;
+	iKeyNumber = 0;
+    if ( !iPeriodic->IsActive() )
+    {
+    iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast<TAny*>( this ) ) );
+    }
+
+    CActiveScheduler::Start();
+	}
+
+TBool MT_GSFramework::GetKeyCodeCase2( TKeyCode& aKeyCode )
+	{
+	TBool ret = ETrue;
+    iKeyNumber++;
+
+    switch ( iKeyNumber )
+    	{
+    	case 1:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 2:
+    		aKeyCode = EKeyEnter;	// phone
+    		break;
+    	case 3:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 4:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 5:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 6:
+    		aKeyCode = EKeyEnter;	// Display
+    		break;
+    	case 7:
+    		aKeyCode = EKeyEnter;	// Light sensor
+    		break;
+     	case 8:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 9:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 10:
+    		aKeyCode = EKeyEnter;	// Display text size
+    		break;
+    	case 11:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 12:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 13:
+    		aKeyCode = EKeyEnter;	// Screen save time-out
+    		break;
+    	case 14:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 15:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 16:
+    		aKeyCode = EKeyEnter;	// Welcome note or image
+    		break;
+    	case 17:
+    		aKeyCode = EKeyCBA1;
+    		break;
+     	case 18:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+     	case 19:
+    		aKeyCode = EKeyEnter;	// Backlight time-out
+    		break;
+    	case 20:
+    		aKeyCode = EKeyCBA2;
+    		break;
+     	case 21:
+    		aKeyCode = EKeyCBA2;
+    		break;
+     	case 22:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	default:
+    		ret = EFalse;
+    	}
+
+    return ret;
+	}
+
+void MT_GSFramework::LaunchGsApp3L()
+	{
+	ikeySimulateCase = 3;
+	iKeyNumber = 0;
+    if ( !iPeriodic->IsActive() )
+    {
+    iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast<TAny*>( this ) ) );
+    }
+
+    CActiveScheduler::Start();
+	}
+
+TBool MT_GSFramework::GetKeyCodeCase3( TKeyCode& aKeyCode )
+	{
+	TBool ret = ETrue;
+    iKeyNumber++;
+
+    switch ( iKeyNumber )
+    	{
+    	case 1:
+    		aKeyCode = EKeyEnter;	// open Persional
+    		break;
+    	case 2:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 3:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 4:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 5:
+    		aKeyCode = EKeyEnter;	// open Standby
+    		break;
+    	case 6:
+    		aKeyCode = EKeyEnter;	// open Shortcut
+    		break;
+    	case 7:
+    		aKeyCode = EKeyEnter;	// open Lift idle softkey
+    		break;
+     	case 8:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 9:
+    		aKeyCode = EKeyCBA2;
+    		break;
+/*    	case 10:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 11:
+    		aKeyCode = EKeyCBA2;
+    		break;*/
+    	default:
+    		ret = EFalse;
+    	}
+
+    return ret;
+	}
+
+void MT_GSFramework::LaunchGsApp4L()
+	{
+	ikeySimulateCase = 4;
+	iKeyNumber = 0;
+    if ( !iPeriodic->IsActive() )
+    {
+    iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast<TAny*>( this ) ) );
+    }
+
+    CActiveScheduler::Start();
+	}
+
+TBool MT_GSFramework::GetKeyCodeCase4( TKeyCode& aKeyCode )
+	{
+	TBool ret = ETrue;
+    iKeyNumber++;
+
+    switch ( iKeyNumber )
+    	{
+    	case 1:
+    		aKeyCode = EKeyEnter;	// open Persional
+    		break;
+    	case 2:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 3:
+    		aKeyCode = EKeyDownArrow;
+    		break;
+    	case 4:
+    		aKeyCode = EKeyEnter;	// open Standby
+    		break;
+    	case 5:
+    		aKeyCode = EKeyEnter;	// open Shortcut
+    		break;
+    	case 6:
+    		aKeyCode = EKeyEnter;	// open Lift idle softkey
+    		break;
+     	case 7:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 8:
+    		aKeyCode = EKeyCBA2;
+    		break;
+/*    	case 10:
+    		aKeyCode = EKeyCBA2;
+    		break;
+    	case 11:
+    		aKeyCode = EKeyCBA2;
+    		break;*/
+    	default:
+    		ret = EFalse;
+    	}
+
+    return ret;
+	}
+
+// ----------------------------- CGSBaseView test cases ------------------------------------ //
+void MT_GSFramework::SetupCGSBaseViewL()
+	{
+	iTestBaseView = CTestGSBaseView::NewL();
+	}
+
+void MT_GSFramework::TeardownCGSBaseView()
+	{
+	delete iTestBaseView;
+	iTestBaseView = NULL;
+	}
+
+void MT_GSFramework::MT_CGSBaseView_SetCurrentItemL()
+	{
+	iTestBaseView->SetCurrentItem( 0 );
+	}
+
+void MT_GSFramework::MT_CGSBaseView_ContainerL()
+	{
+	iTestBaseView->Container();
+	}
+
+void MT_GSFramework::MT_CGSBaseView_SetNaviPaneLL()
+	{
+	iTestBaseView->SetNaviPaneL();
+	}
+
+void MT_GSFramework::MT_CGSBaseView_CreateNaviPaneContextLL()
+	{
+	iTestBaseView->CreateNaviPaneContextL( 1 );
+	}
+
+
+
+
+// -------------------------------	CGSParentPlugin test cases -------------------------------- //
+void MT_GSFramework::SetupCGSParentPluginL()
+	{
+	iParentPlugin = static_cast<CGSParentPlugin*> ( CTestGSPlugin::NewL() );
+	}
+
+void MT_GSFramework::TeardownCGSParentPlugin()
+	{
+	delete iParentPlugin;
+	iParentPlugin = NULL;
+	}
+
+
+void MT_GSFramework::MT_CGSParentPlugin_UpperLevelViewUidL()
+	{
+	EUNIT_ASSERT_NO_LEAVE( iParentPlugin->UpperLevelViewUid() );
+	}
+
+void MT_GSFramework::MT_CGSParentPlugin_UpdateViewL()
+	{
+	EUNIT_ASSERT_NO_LEAVE( iParentPlugin->UpdateView() );
+	}
+
+void MT_GSFramework::MT_CGSParentPlugin_SetOptionFlagsL()
+	{
+	TBitFlags optionFlags;
+	EUNIT_ASSERT_NO_LEAVE( iParentPlugin->SetOptionFlags( optionFlags ) );
+	}
+
+void MT_GSFramework::MT_CGSParentPlugin_OptionFlagsL()
+	{
+	EUNIT_ASSERT_NO_LEAVE( iParentPlugin->OptionFlags() );
+	}
+
+void MT_GSFramework::MT_CGSParentPlugin_GetHelpContextL()
+	{
+	TCoeHelpContext context;
+	EUNIT_ASSERT_NO_LEAVE( iParentPlugin->GetHelpContext( context ) );
+	}
+
+void MT_GSFramework::MT_CGSParentPlugin_SelectedPluginL()
+	{
+	CGSPluginInterface* plug = iParentPlugin->SelectedPlugin();
+	EUNIT_ASSERT( plug == NULL );
+	}
+
+void MT_GSFramework::MT_CGSParentPlugin_TransferDynamicPluginLL()
+	{
+	TRAPD( err, iParentPlugin->TransferDynamicPluginL( NULL ) )
+	EUNIT_PRINT( _L("error = %d"), err );
+	}
+
+// ---------------------------- CGSPluginInterface test cases -------------------------- //
+void MT_GSFramework::MT_CGSPluginInterface_ItemTypeL()
+	{
+	CGSPluginInterface* plugInterface = static_cast<CGSPluginInterface*> ( iParentPlugin );
+	EUNIT_ASSERT_NO_LEAVE( plugInterface->ItemType() );
+	}
+
+void MT_GSFramework::MT_CGSPluginInterface_HandleSelectionL()
+	{
+	CGSPluginInterface* plugInterface = static_cast<CGSPluginInterface*> ( iParentPlugin );
+	TGSSelectionTypes selectionType = EGSSelectionBySelectionKey;
+	EUNIT_ASSERT_NO_LEAVE( plugInterface->HandleSelection( selectionType ) );
+	}
+
+void MT_GSFramework::MT_CGSPluginInterface_PluginProviderCategoryL()
+	{
+	CGSPluginInterface* plugInterface = static_cast<CGSPluginInterface*> ( iParentPlugin );
+	EUNIT_ASSERT_NO_LEAVE( plugInterface->PluginProviderCategory() );
+	}
+
+void MT_GSFramework::MT_CGSPluginInterface_CustomOperationLL()
+	{
+	CGSPluginInterface* plugInterface = static_cast<CGSPluginInterface*> ( iParentPlugin );
+	TAny* any = plugInterface->CustomOperationL( NULL, NULL );
+	EUNIT_ASSERT( any == NULL );
+	}
+
+void MT_GSFramework::MT_CGSPluginInterface_SetOrderL()
+	{
+	CGSPluginInterface* plugInterface = static_cast<CGSPluginInterface*> ( iParentPlugin );
+	EUNIT_ASSERT_NO_LEAVE( plugInterface->SetOrder( 0 ) );
+	}
+
+void MT_GSFramework::MT_CGSPluginInterface_CreateIconLL()
+	{
+	CGSPluginInterface* plugInterface = static_cast<CGSPluginInterface*> ( iParentPlugin );
+	CGulIcon* icon = plugInterface->CreateIconL( KGSIconTypeLbxItem );
+	CleanupStack::PushL( icon );
+	EUNIT_ASSERT( icon != NULL );
+	CleanupStack::PopAndDestroy( icon );
+	}
+
+
+void MT_GSFramework::MT_CGSPluginInterface_GetEcomDestructorKey()
+	{
+	CGSPluginInterface* plugInterface = static_cast<CGSPluginInterface*> ( iParentPlugin );
+	TUid dTorID;
+	EUNIT_ASSERT_NO_LEAVE( dTorID = plugInterface->GetEcomDestructorKey() );
+	}
+
+
+
+/**
+ * @param text1 Textual description of the test case.
+ * @param text2 The class to be tested.
+ * @param text3 The method to be tested.
+ * @param text4 Test case type: refer to EUnit User Manual for correct values.
+ * @param setupFunc Test setup function.
+ * @param runFunc Test run function.
+ * @param teardownFunc Test teardown function.
+ */
+
+//  TEST TABLE
+EUNIT_BEGIN_TEST_TABLE(
+    MT_GSFramework,
+    "Tests for GSFramework.dll.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "#1 launch Gs application",
+    "Settings framework classes",
+    "settings framework api",
+    "FUNCTIONALITY",
+    SetupLaunch, LaunchGsApp1L, TeardownLaunch)
+
+EUNIT_TEST(
+    "#2 launch Gs application",
+    "Settings framework classes",
+    "settings framework api",
+    "FUNCTIONALITY",
+    SetupLaunch, LaunchGsApp2L, TeardownLaunch)
+
+EUNIT_TEST(
+    "#3 launch Gs application",
+    "Settings framework classes",
+    "settings framework api",
+    "FUNCTIONALITY",
+    SetupLaunch, LaunchGsApp3L, TeardownLaunch)
+
+EUNIT_TEST(
+    "#4 launch Gs application",
+    "Settings framework classes",
+    "settings framework api",
+    "FUNCTIONALITY",
+    SetupLaunch, LaunchGsApp4L, TeardownLaunch)
+
+EUNIT_TEST(
+    "GSBsView:SetCurrentItem",
+    "CGSBaseView",
+    "SetCurrentItem",
+    "FUNCTIONALITY",
+    SetupCGSBaseViewL, MT_CGSBaseView_SetCurrentItemL, TeardownCGSBaseView)
+
+EUNIT_TEST(
+    "GSBsView:Container",
+    "CGSBaseView",
+    "Container",
+    "FUNCTIONALITY",
+    SetupCGSBaseViewL, MT_CGSBaseView_ContainerL, TeardownCGSBaseView)
+
+EUNIT_TEST(
+    "GSBsView:SetNaviPaneL",
+    "CGSBaseView",
+    "SetNaviPaneL",
+    "FUNCTIONALITY",
+    SetupCGSBaseViewL, MT_CGSBaseView_SetNaviPaneLL, TeardownCGSBaseView)
+
+EUNIT_TEST(
+    "GSBsView:CreateNaviPaneContextL",
+    "CGSBaseView",
+    "CreateNaviPaneContextL",
+    "FUNCTIONALITY",
+    SetupCGSBaseViewL, MT_CGSBaseView_CreateNaviPaneContextLL, TeardownCGSBaseView)
+
+EUNIT_TEST(
+    "GSPrntPlg:UpperLevelViewUid",
+    "CGSParentPlugin",
+    "UpperLevelViewUid",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSParentPlugin_UpperLevelViewUidL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPrntPlg:UpdateView",
+    "CGSParentPlugin",
+    "UpdateView",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSParentPlugin_UpdateViewL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPrntPlg:SetOptionFlags",
+    "CGSParentPlugin",
+    "SetOptionFlags",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSParentPlugin_SetOptionFlagsL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPrntPlg:OptionFlags",
+    "CGSParentPlugin",
+    "OptionFlags",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSParentPlugin_OptionFlagsL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPrntPlg:GetHelpContext",
+    "CGSParentPlugin",
+    "GetHelpContext",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSParentPlugin_GetHelpContextL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPrntPlg:SelectedPlugin",
+    "CGSParentPlugin",
+    "SelectedPlugin",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSParentPlugin_SelectedPluginL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPrntPlg:TransferDynamicPluginL",
+    "CGSParentPlugin",
+    "TransferDynamicPluginL",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSParentPlugin_TransferDynamicPluginLL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPlgIF:ItemType",
+    "CGSPluginInterface",
+    "ItemType",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSPluginInterface_ItemTypeL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPlgIF:HandleSelection",
+    "CGSPluginInterface",
+    "HandleSelection",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSPluginInterface_HandleSelectionL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPlgIF:PluginProviderCategory",
+    "CGSPluginInterface",
+    "PluginProviderCategory",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSPluginInterface_PluginProviderCategoryL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPlgIF:CustomOperationL",
+    "CGSPluginInterface",
+    "CustomOperationL",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSPluginInterface_CustomOperationLL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPlgIF:SetOrder",
+    "CGSPluginInterface",
+    "SetOrder",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSPluginInterface_SetOrderL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPlgIF:CreateIconL",
+    "CGSPluginInterface",
+    "CreateIconL",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSPluginInterface_CreateIconLL, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSPlgIF:GetEcomDestructorKey",
+    "CGSPluginInterface",
+    "GetEcomDestructorKey",
+    "FUNCTIONALITY",
+    SetupCGSParentPluginL, MT_CGSPluginInterface_GetEcomDestructorKey, TeardownCGSParentPlugin)
+
+EUNIT_TEST(
+    "GSTabHlpr:~CGSTabHelper",
+    "CGSTabHelper",
+    "~CGSTabHelper",
+    "FUNCTIONALITY",
+    SetupTabHelperL, T_CGSTabHelper__CGSTabHelperL, TeardownTabHelper)
+
+EUNIT_TEST(
+    "GSTabHlpr:CreateTabGroupL",
+    "CGSTabHelper",
+    "CreateTabGroupL",
+    "FUNCTIONALITY",
+    SetupTabHelperL, T_CGSTabHelper_CreateTabGroupLL, TeardownTabHelper)
+
+EUNIT_TEST(
+    "GSTabHlpr:CreateTabGroupL2",
+    "CGSTabHelper",
+    "CreateTabGroupL2",
+    "FUNCTIONALITY",
+    SetupTabHelperL, T_CGSTabHelper_CreateTabGroupL2L, TeardownTabHelper)
+
+EUNIT_TEST(
+    "GSTabHlpr:CreateTabGroupL3",
+    "CGSTabHelper",
+    "CreateTabGroupL3",
+    "FUNCTIONALITY",
+    SetupTabHelperL, T_CGSTabHelper_CreateTabGroupL3L, TeardownTabHelper)
+
+EUNIT_TEST(
+    "GSTabHlpr:RemoveTabGroupL",
+    "CGSTabHelper",
+    "RemoveTabGroupL",
+    "FUNCTIONALITY",
+    SetupTabHelperL, T_CGSTabHelper_RemoveTabGroupL, TeardownTabHelper)
+
+EUNIT_TEST(
+    "GSTabHlpr:TabChangedL",
+    "CGSTabHelper",
+    "TabChangedL",
+    "FUNCTIONALITY",
+    SetupTabHelperL, T_CGSTabHelper_TabChangedLL, TeardownTabHelper)
+
+EUNIT_TEST(
+    "GSTabHlpr:NewL",
+    "CGSTabHelper",
+    "NewL",
+    "FUNCTIONALITY",
+    SetupNone, T_CGSTabHelper_NewLL, TeardownNone)
+
+EUNIT_TEST(
+    "GSTabHlpr:NewLC",
+    "CGSTabHelper",
+    "NewLC",
+    "FUNCTIONALITY",
+    SetupNone, T_CGSTabHelper_NewLCL, TeardownNone)
+/*
+EUNIT_TEST(
+    "FocusChanged",
+    "CGSParentContainer",
+    "FocusChanged",
+    "FUNCTIONALITY",
+    SetupParentContainerL, T_CGSParentContainer_FocusChanged, TearDownParentContainer)
+*/
+
+EUNIT_TEST(
+    "GSPlgLdr:NewL",
+    "CGSPluginLoader",
+    "NewL",
+    "FUNCTIONALITY",
+    SetupNone, T_CGSPluginLoader_NewL, TeardownNone)
+
+EUNIT_TEST(
+    "GSPlgLdr:Destructor",
+    "CGSPluginLoader",
+    "~CGSPluginLoader",
+    "FUNCTIONALITY",
+    SetupNone, T_CGSPluginLoader__CGSPluginLoader, TeardownNone)
+
+EUNIT_TEST(
+    "GSPlgLdr:LoadAsyncL",
+    "CGSPluginLoader",
+    "LoadAsyncL",
+    "FUNCTIONALITY",
+    SetupPluginLoaderL, T_CGSPluginLoader_LoadAsyncL, TearDownPluginLoader)
+
+EUNIT_TEST(
+    "GSPlgLdr:SetObserver",
+    "CGSPluginLoader",
+    "SetObserver",
+    "FUNCTIONALITY",
+    SetupPluginLoaderL, T_CGSPluginLoader_SetObserver, TearDownPluginLoader)
+
+EUNIT_TEST(
+    "GSPlgLdr:AbortAsyncLoad",
+    "CGSPluginLoader",
+    "AbortAsyncLoad",
+    "FUNCTIONALITY",
+    SetupPluginLoaderL, T_CGSPluginLoader_AbortAsyncLoad, TearDownPluginLoader)
+
+EUNIT_TEST(
+    "GSPlgLdr:SortPluginsL",
+    "CGSPluginLoader",
+    "SortPluginsL",
+    "FUNCTIONALITY",
+    SetupPluginLoaderL, T_CGSPluginLoader_SortPluginsL, TearDownPluginLoader)
+
+EUNIT_TEST(
+    "GSPSLsnr:NewL",
+    "CGSPubSubsListener",
+    "NewL",
+    "FUNCTIONALITY",
+    SetupNone, T_CGSPubSubsListener_NewL, TeardownNone)
+
+EUNIT_TEST(
+    "GSPSLsnr:CGSPubSubsListener",
+    "CGSPubSubsListener",
+    "~CGSPubSubsListener",
+    "FUNCTIONALITY",
+    SetupNone, T_CGSPubSubsListener__CGSPubSubsListener, TeardownNone)
+
+EUNIT_TEST(
+    "GSPSLsnr:Get1",
+    "CGSPubSubsListener",
+    "Get1",
+    "FUNCTIONALITY",
+    SetupPubSubsListenerL, T_CGSPubSubsListener_Get1, TearDownPubSubsListener)
+
+EUNIT_TEST(
+    "GSPSLsnr:Get2",
+    "CGSPubSubsListener",
+    "Get2",
+    "FUNCTIONALITY",
+    SetupPubSubsListenerL, T_CGSPubSubsListener_Get2, TearDownPubSubsListener)
+
+EUNIT_TEST(
+    "GSPSLsnr:Get3",
+    "CGSPubSubsListener",
+    "Get3",
+    "FUNCTIONALITY",
+    SetupPubSubsListenerL, T_CGSPubSubsListener_Get3, TearDownPubSubsListener)
+
+EUNIT_END_TEST_TABLE
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef __MT_GSFRAMEWORK_H__
+#define __MT_GSFRAMEWORK_H__
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include <GSTabHelper.h>
+#include <GSPluginLoader.h>
+#include <GSPubSubsListener.h>
+#include <MGSSettingPSObserver.h>
+#include <GSParentPlugin.h>
+
+//  INTERNAL INCLUDES
+#include "TestGSBaseView.h"
+
+//  FORWARD DECLARATIONS
+
+
+//  CLASS DEFINITION
+NONSHARABLE_CLASS( MT_GSFramework )
+  : public CEUnitTestSuiteClass, MGSTabbedViewOwner, MGSPluginLoadObserver, MGSSettingPSObserver
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static MT_GSFramework* NewL();
+        static MT_GSFramework* NewLC();
+        /**
+         * Destructor
+         */
+        ~MT_GSFramework();
+
+    public:
+        // From MGSTabbedViewOwner
+      CArrayPtrFlat<CGSPluginInterface>* TabbedViews();
+      void TabChangedL( TUid selectedTabUid );
+
+      // From MGSPluginLoadObserver
+        void HandlePluginLoaded( KGSPluginLoaderStatus aStatus );
+
+        // From MGSSettingPSObserver
+        void HandleNotifyPSL( const TUid aUid,
+                              const TInt& aKey,
+                              const TRequestStatus& aStatus );
+
+
+    private:    // Constructors and destructors
+
+        MT_GSFramework();
+        void ConstructL();
+
+    private:
+    // Test setup and teardown functions
+
+    // CGSTabHelper
+         void SetupTabHelperL();
+         void TeardownTabHelper();
+
+    // CGSTabHelper test cases
+         void T_CGSTabHelper_NewLL();
+         void T_CGSTabHelper_NewLCL();
+         //~Destructor
+         void T_CGSTabHelper__CGSTabHelperL();
+         void T_CGSTabHelper_CreateTabGroupLL();
+         void T_CGSTabHelper_CreateTabGroupL2L();
+         void T_CGSTabHelper_CreateTabGroupL3L();
+         void T_CGSTabHelper_RemoveTabGroupL();
+         void T_CGSTabHelper_TabChangedLL();
+
+     // CGSParentContainer test cases
+         void SetupParentContainerL();
+         void TearDownParentContainer();
+
+         void T_CGSParentContainer_FocusChanged();
+
+     // CGSPluginLoader test cases
+         void SetupPluginLoaderL();
+         void TearDownPluginLoader();
+
+         void T_CGSPluginLoader_NewL();
+         void T_CGSPluginLoader__CGSPluginLoader();
+         void T_CGSPluginLoader_LoadAsyncL();
+         void T_CGSPluginLoader_SetObserver();
+         void T_CGSPluginLoader_AbortAsyncLoad();
+         void T_CGSPluginLoader_SortPluginsL();
+
+
+     // CGSPubSubsListener test cases
+         void SetupPubSubsListenerL();
+         void TearDownPubSubsListener();
+
+         void T_CGSPubSubsListener_NewL();
+         void T_CGSPubSubsListener__CGSPubSubsListener();
+         void T_CGSPubSubsListener_Get1();
+         void T_CGSPubSubsListener_Get2();
+         void T_CGSPubSubsListener_Get3();
+
+
+     // Empty Setup & TearDown
+         void SetupNone();
+         void TeardownNone();
+
+
+         void SetupLaunch();
+         void TeardownLaunch();
+
+     static TInt CloseTopMostWindow( TAny* aPtr );
+     void DoCloseTopMostWindowL();
+
+     void LaunchGsApp1L();
+     TBool GetKeyCodeCase1( TKeyCode& aKeyCode );
+
+     void LaunchGsApp2L();
+     TBool GetKeyCodeCase2( TKeyCode& aKeyCode );
+
+     void LaunchGsApp3L();
+     TBool GetKeyCodeCase3( TKeyCode& aKeyCode );
+
+     void LaunchGsApp4L();
+     TBool GetKeyCodeCase4( TKeyCode& aKeyCode );
+
+     static TInt SimulateKeyEvent( TAny* aPtr );
+     void DoSimulateKeyEventL();
+
+     TBool GetKeyCodeCase0( TKeyCode& aKeyCode );
+
+
+     // CGSBaseView test cases
+     void SetupCGSBaseViewL();
+     void TeardownCGSBaseView();
+     void MT_CGSBaseView_SetCurrentItemL();
+     void MT_CGSBaseView_ContainerL();
+     void MT_CGSBaseView_SetNaviPaneLL();
+     void MT_CGSBaseView_CreateNaviPaneContextLL();
+
+     // CGSParentPlugin test cases
+     void SetupCGSParentPluginL();
+     void TeardownCGSParentPlugin();
+     void MT_CGSParentPlugin_UpperLevelViewUidL();
+     void MT_CGSParentPlugin_UpdateViewL();
+     void MT_CGSParentPlugin_SetOptionFlagsL();
+     void MT_CGSParentPlugin_OptionFlagsL();
+     void MT_CGSParentPlugin_GetHelpContextL();
+     void MT_CGSParentPlugin_SelectedPluginL();
+     void MT_CGSParentPlugin_TransferDynamicPluginLL();
+
+     // CGSPluginInterface test cases
+     void MT_CGSPluginInterface_ItemTypeL();
+     void MT_CGSPluginInterface_HandleSelectionL();
+     void MT_CGSPluginInterface_PluginProviderCategoryL();
+     void MT_CGSPluginInterface_CustomOperationLL();
+     void MT_CGSPluginInterface_SetOrderL();
+     void MT_CGSPluginInterface_CreateIconLL();
+     void MT_CGSPluginInterface_GetEcomDestructorKey();
+
+
+    private:    // Data
+
+      // For CGSTabHelper
+        CGSTabHelper* iCGSTabHelper;
+      CArrayPtrFlat<CGSPluginInterface>* iPlugins;
+        CArrayPtrFlat<MGSTabbedView>* iTabbedViews;
+
+        // For CGSPluginLoader
+        CGSPluginLoader* iCGSPluginLoader;
+
+        // For CGSPubSubsListener
+        CGSPubSubsListener* iCGSPubSubsListener;
+
+        // For launching Gs application test cases
+        CPeriodic* iPeriodic;
+        TInt ikeySimulateCase;
+        TInt iKeyNumber;
+
+        // For CTestGSBaseView
+        CTestGSBaseView* iTestBaseView;
+
+        // For CGSParentPlugin
+        CGSParentPlugin* iParentPlugin;
+
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  __MT_GSFRAMEWORK_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework_DllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "MT_GSFramework.h"
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return MT_GSFramework::NewL();
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll( TDllReason )
+	{
+	return KErrNone;
+	}
+#endif
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#include "TestGSBaseView.h"
+
+
+	
+// CONSTRUCTION
+CTestGSBaseView* CTestGSBaseView::NewL()
+    {
+    CTestGSBaseView* self = CTestGSBaseView::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+CTestGSBaseView* CTestGSBaseView::NewLC()
+    {
+    CTestGSBaseView* self = new( ELeave ) CTestGSBaseView();
+    CleanupStack::PushL( self );
+
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor 
+CTestGSBaseView::~CTestGSBaseView()
+    {
+    }
+
+// Default constructor
+CTestGSBaseView::CTestGSBaseView()
+    {
+    }
+
+// Second phase construct
+void CTestGSBaseView::ConstructL()
+    {
+    }
+
+//  METHODS
+
+void CTestGSBaseView::NewContainerL()
+    {
+    }
+
+void CTestGSBaseView::HandleListBoxSelectionL()
+    {
+    }
+    
+void CTestGSBaseView::GetCaptionL( TDes& aCaption ) const
+	{
+	
+	}
+
+TUid CTestGSBaseView::Id() const
+	{
+	
+	}
+	
+void CTestGSBaseView::SetNaviPaneL()
+	{
+	CGSBaseView::SetNaviPaneL();
+	}
+	
+void CTestGSBaseView::CreateNaviPaneContextL( TInt aResourceId )
+	{
+	CGSBaseView::CreateNaviPaneContextL( aResourceId );
+	}
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef TESTGSBASEVIEW_H
+#define TESTGSBASEVIEW_H
+
+// INCLUDES
+#include    <GSBaseView.h>
+
+
+
+// CLASS DECLARATION
+
+class CTestGSBaseView : public CGSBaseView
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static CTestGSBaseView* NewL();
+        static CTestGSBaseView* NewLC();
+        /**
+         * Destructor
+         */
+        ~CTestGSBaseView();
+
+        
+    public: // From CGSBaseView
+    
+    	void SetNaviPaneL();
+    	
+    	void CreateNaviPaneContextL( TInt aResourceId );
+    	
+    private:    // Constructors and destructors
+
+        CTestGSBaseView();
+        void ConstructL();
+        
+
+
+    protected: 
+
+        void NewContainerL();
+
+
+    private:
+
+        void HandleListBoxSelectionL();
+        
+        void GetCaptionL( TDes& aCaption ) const;
+        
+		TUid Id() const;
+
+    };
+
+#endif // TESTGSBASEVIEW_H
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "TestGSPlugin.h"
+
+
+	
+// CONSTRUCTION
+CTestGSPlugin* CTestGSPlugin::NewL()
+    {
+    CTestGSPlugin* self = CTestGSPlugin::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+CTestGSPlugin* CTestGSPlugin::NewLC()
+    {
+    CTestGSPlugin* self = new( ELeave ) CTestGSPlugin();
+    CleanupStack::PushL( self );
+
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor 
+CTestGSPlugin::~CTestGSPlugin()
+    {
+    }
+
+// Default constructor
+CTestGSPlugin::CTestGSPlugin()
+    {
+    }
+
+// Second phase construct
+void CTestGSPlugin::ConstructL()
+    {
+    }
+
+
+void CTestGSPlugin::GetCaptionL( TDes& aCaption ) const
+	{
+	
+	}
+
+TUid CTestGSPlugin::Id() const
+	{
+	
+	}
+	
+//  END OF FILE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef TESTGSPLUGIN_H
+#define TESTGSPLUGIN_H
+
+// INCLUDES
+#include    <GSParentPlugin.h>
+
+
+
+// CLASS DECLARATION
+
+class CTestGSPlugin : public CGSParentPlugin
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static CTestGSPlugin* NewL();
+        static CTestGSPlugin* NewLC();
+        /**
+         * Destructor
+         */
+        ~CTestGSPlugin();
+
+        
+    public:
+    
+    	void GetCaptionL( TDes& aCaption ) const;
+    	
+    	TUid Id() const;
+    	
+    private:    // Constructors and destructors
+
+        CTestGSPlugin();
+        void ConstructL();
+
+    };
+
+#endif // TESTGSPLUGIN_H
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,548 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "T_GSListBox.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <e32base.h>
+#include <barsread.h> //TResourceReader
+#include <coemain.h>
+#include <AknRadioButtonSettingPage.h>
+#include <GsNetworkPluginRsc.rsg>           //for resource IDs
+
+
+//  INTERNAL INCLUDES
+//#include "ListBox.cpp"
+
+// CONSTANTS
+_LIT( KGSTestCaption, "Test caption" );
+const TInt KGSTestLocalFeatureId = 0;
+
+// CONSTRUCTION
+T_GSListBox* T_GSListBox::NewL()
+    {
+    T_GSListBox* self = T_GSListBox::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+T_GSListBox* T_GSListBox::NewLC()
+    {
+    T_GSListBox* self = new( ELeave ) T_GSListBox();
+    CleanupStack::PushL( self );
+
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+T_GSListBox::~T_GSListBox()
+    {
+    }
+
+// Default constructor
+T_GSListBox::T_GSListBox()
+    {
+    }
+
+// Second phase construct
+void T_GSListBox::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+//  METHODS
+
+
+void T_GSListBox::SetupL(  )
+    {
+    
+    }
+
+void T_GSListBox::SetupResourceL()
+    {
+	iOffset = CCoeEnv::Static()->AddResourceFileL( _L("Z:\\resource\\GSNetworkPluginRsc.rsc") ); 
+    }
+
+
+void T_GSListBox::Teardown(  )
+    {
+    if( iListboxEntry )
+        {
+        delete iListboxEntry;
+        iListboxEntry = NULL;
+        }
+    if( iItemTextArray )
+        {
+        delete iItemTextArray;
+        iItemTextArray = NULL;
+        }
+    if( iRBSPArray )
+        {
+        delete iRBSPArray;
+        iRBSPArray = NULL;
+        }
+        
+    if ( iLBITextArray )
+    	{
+    	delete iLBITextArray;
+    	iLBITextArray = NULL;
+    	}
+        
+	if ( iOffset )
+		{
+		CCoeEnv::Static()->DeleteResourceFile( iOffset );
+		iOffset = 0;		
+		}
+    }
+
+// CGSListboxEntry test cases
+
+void T_GSListBox::SetupListBoxEntryL()
+    {
+    SetupResourceL();
+
+    TResourceReader resReader;
+    CCoeEnv::Static()->CreateResourceReaderLC( resReader, R_NETSL_NETSELECTMODE_LBX );
+    // Just read, not actually needed anywhere
+    resReader.ReadInt16();
+    
+    iListboxEntry = CGSListboxEntry::NewLC( resReader );
+    EUNIT_ASSERT( iListboxEntry != NULL );
+    CleanupStack::Pop( iListboxEntry );
+    
+    CleanupStack::PopAndDestroy();
+    }
+
+void T_GSListBox::T_Global_GSListBox_NewLC()
+    {
+    TResourceReader resReader;
+    CCoeEnv::Static()->CreateResourceReaderLC( resReader, R_NETSL_NETSELECTMODE_LBX );
+    // Just read, not actually needed anywhere
+    resReader.ReadInt16();
+    
+    iListboxEntry = CGSListboxEntry::NewLC( resReader );
+    EUNIT_ASSERT( iListboxEntry != NULL );
+    CleanupStack::Pop( iListboxEntry );
+    
+    CleanupStack::PopAndDestroy();
+    }
+
+void T_GSListBox::T_Global_GSListBox_New2LC()
+    {
+    TInt localFeatureId = 0;
+    iListboxEntry = CGSListboxEntry::NewLC( localFeatureId );
+    EUNIT_ASSERT( iListboxEntry != NULL );
+    CleanupStack::Pop();
+    }
+
+void T_GSListBox::T_Global_GSListBox_New3LC()
+    {
+    TInt localFeatureId = 0;
+    TUint32 resourceId = R_NETSL_NETSELECTMODE_LBX;
+    iListboxEntry = CGSListboxEntry::NewLC( resourceId, *CCoeEnv::Static(), localFeatureId );
+    EUNIT_ASSERT( iListboxEntry != NULL );
+    CleanupStack::Pop();
+    }
+
+void T_GSListBox::T_Global_GSListBox_FeatureIdL()
+    {
+    TInt localFeatureId;
+    EUNIT_ASSERT_NO_LEAVE( localFeatureId = iListboxEntry->FeatureId() );
+    }
+
+void T_GSListBox::T_Global_GSListBox_TypeL()
+    {
+    TInt type;
+    EUNIT_ASSERT_NO_LEAVE( type = iListboxEntry->Type() );
+    }
+
+void T_GSListBox::T_Global_GSListBox_CaptionL()
+    {
+    //Here we can add comparision of the returned string to the
+    //previously saved one
+    EUNIT_ASSERT_NO_LEAVE( iListboxEntry->Caption() );
+    }
+
+void T_GSListBox::T_Global_GSListBox_SetDynamicTextL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iListboxEntry->SetDynamicTextL( KGSTestCaption ) );
+    }
+
+void T_GSListBox::T_Global_GSListBox_SetDynamicTextDoublePaneL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iListboxEntry->SetDynamicTextDoublePaneL( KGSTestCaption ) );
+    }
+
+
+// CGSItemTextArray test cases
+
+void T_GSListBox::SetupGSItemTextArrayL()
+    {
+    SetupResourceL();
+    iItemTextArray = 
+            CGSItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, *CCoeEnv::Static() );
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_SetupL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray = 
+        CGSItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, *CCoeEnv::Static() ) ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_MdcaCountL()
+    {
+    TInt itemCount = 0;
+    EUNIT_ASSERT_NO_LEAVE( itemCount = iItemTextArray->MdcaCount() ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_MdcaPointL()
+    {
+    TInt itemIndex = 0;
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->MdcaPoint( itemIndex ) ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_SetDynamicTextL()
+    {
+    TInt featureId = 1;
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->SetDynamicTextL( 
+            featureId, KGSTestCaption ) ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_SetDynamicTextDoublePaneL()
+    {
+    TInt featureId = 1;
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->SetDynamicTextDoublePaneL( 
+            featureId, KGSTestCaption ) ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_SetItemVisibilityL()
+    {
+    TInt featureId = 1;
+    CGSItemTextArray::TVisibility itemVisibility = CGSItemTextArray::EVisible;
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->SetItemVisibilityL( 
+            featureId, itemVisibility ) ); 
+    }
+    
+void T_GSListBox::T_Global_GSItemTextArray_CurrentFeatureL()
+    {
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->CurrentFeature() ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_IndexForFeatureIdL()
+    {
+    TInt featureId = 4;
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->IndexForFeatureIdL( 
+            featureId ) ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_FeatureIdByIndexL()
+    {
+    TInt itemIndex = 5;
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->FeatureIdByIndex( 
+            itemIndex ) ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_FeatureByIdL()
+    {
+    TInt featureId = 6;
+    EUNIT_ASSERT_NO_LEAVE( iItemTextArray->FeatureByIdL( 
+            featureId ) ); 
+    }
+
+void T_GSListBox::T_Global_GSItemTextArray_GetItemCaptionFromFeatureIdLC()
+    {
+    TInt featureId = 6;
+    HBufC* itemCaption;
+    itemCaption = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( 
+            R_NETSL_NETSELECTMODE_LBX, featureId, *CCoeEnv::Static() );
+    CleanupStack::PopAndDestroy();
+    }
+
+
+// CGSRadioButtonSettingPageItemTextArray test cases
+
+void T_GSListBox::T_Global_GSRBSPItemTextArray_NewL()
+    {
+    CGSRadioButtonSettingPageItemTextArray* itemArray = 
+        CGSRadioButtonSettingPageItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, *CCoeEnv::Static(), NULL );
+    CleanupStack::PushL( itemArray );
+    EUNIT_ASSERT( itemArray );
+    CleanupStack::PopAndDestroy();
+    }
+
+void T_GSListBox::Setup_GSRBSPItemTextArrayL()
+    {
+    SetupResourceL();
+    
+    iRBSPArray = CGSRadioButtonSettingPageItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, 
+                *CCoeEnv::Static(), NULL );
+    }
+
+void T_GSListBox::T_Global_GSRBSPItemTextArray_CurrentFeatureL()
+    {
+    EUNIT_ASSERT_PANIC( iRBSPArray->CurrentFeature(), "GSEngItemArray", 0 );
+    }
+
+void T_GSListBox::T_Global_GSRBSPItemTextArray_SetRadioButtonSettingPageL()
+    {
+    TUint32 resId = 1;
+    TInt currentItem = 0;
+    CAknRadioButtonSettingPage* dlg = new (ELeave ) CAknRadioButtonSettingPage(
+                                          resId, 
+                                          currentItem, iItemTextArray );
+    CleanupStack::PushL( dlg );
+    EUNIT_ASSERT_NO_LEAVE( iRBSPArray->SetRadioButtonSettingPage( *dlg ) );
+    CleanupStack::PopAndDestroy();
+    }
+
+
+// CGSListBoxItemTextArray test cases
+
+void T_GSListBox::Setup_CGSLBITextArrayL()
+    {
+    SetupResourceL();
+    TUint32 resId = R_NETSL_NETSELECTMODE_LBX;
+    iLBITextArray = CGSListBoxItemTextArray::NewL( 
+            resId, *iListBox, *CCoeEnv::Static() );
+    }
+
+void T_GSListBox::T_Global_CGSLBITextArray_NewL()
+    {
+    TUint32 resId = R_NETSL_NETSELECTMODE_LBX;
+    EUNIT_ASSERT_NO_LEAVE( iLBITextArray = CGSListBoxItemTextArray::NewL( 
+                resId, *iListBox, *CCoeEnv::Static() ) );
+    }
+
+void T_GSListBox::T_Global_CGSLBITextArray_New2L()
+    {
+    TUint32 resId = R_NETSL_NETSELECTMODE_LBX;
+    TInt itemCount = 10;
+    EUNIT_ASSERT_NO_LEAVE( iLBITextArray = CGSListBoxItemTextArray::NewL( 
+                resId, *iListBox, *CCoeEnv::Static(), itemCount ) );
+    }
+
+void T_GSListBox::T_Global_CGSLBITextArray_CurrentFeatureL()
+    {
+    TInt currentFeature = 0;
+    EUNIT_ASSERT_NO_LEAVE( currentFeature = iLBITextArray->CurrentFeature() );
+    }
+
+
+//  TEST TABLE
+EUNIT_BEGIN_TEST_TABLE(
+    T_GSListBox,
+    "Testing GSListBox.dll functionality",
+    "UNIT" )
+
+
+// CGSListboxEntry test cases
+EUNIT_TEST(
+    "ListBox - NewL construction", //case description
+    "CGSListboxEntry",                   //class being tested
+    "NewLC",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupResourceL, T_Global_GSListBox_NewLC, Teardown )
+
+EUNIT_TEST(
+    "ListBox - NewL overloaded construction", //case description
+    "CGSListboxEntry",                   //class being tested
+    "NewLC",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupL, T_Global_GSListBox_New2LC, Teardown )
+
+EUNIT_TEST(
+    "ListBox - NewL another overloaded construction", //case description
+    "CGSListboxEntry",                   //class being tested
+    "NewLC",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupResourceL, T_Global_GSListBox_New3LC, Teardown )
+    
+EUNIT_TEST(
+    "ListBox - FeatureId()", //case description
+    "CGSListboxEntry",                   //class being tested
+    "FeatureId",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupListBoxEntryL, T_Global_GSListBox_FeatureIdL, Teardown )
+
+EUNIT_TEST(
+    "ListBox - Caption()", //case description
+    "CGSListboxEntry",                   //class being tested
+    "Caption",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupListBoxEntryL, T_Global_GSListBox_CaptionL, Teardown ) 
+    
+EUNIT_TEST(
+    "ListBox - Type()", //case description
+    "CGSListboxEntry",                   //class being tested
+    "Type",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupListBoxEntryL, T_Global_GSListBox_TypeL, Teardown )    
+
+EUNIT_TEST(
+    "ListBox - SetDynamicTextL()", //case description
+    "CGSListboxEntry",                   //class being tested
+    "SetDynamicTextL",                                 //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupListBoxEntryL, T_Global_GSListBox_SetDynamicTextL, Teardown )
+
+EUNIT_TEST(
+    "ListBox - SetDynamicTextDoublePaneL()", //case description
+    "CGSListboxEntry",                   //class being tested
+    "SetDynamicTextDoublePaneL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupListBoxEntryL, T_Global_GSListBox_SetDynamicTextDoublePaneL, Teardown )
+
+    
+// CGSItemTextArray test cases    
+
+EUNIT_TEST(
+    "CGSItemTextArray - construction()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "NewL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupResourceL, T_Global_GSItemTextArray_SetupL, Teardown )
+    
+EUNIT_TEST(
+    "CGSItemTextArray - MdcaCount()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "MdcaCount",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_MdcaCountL, Teardown )
+
+EUNIT_TEST(
+    "CGSItemTextArray - MdcaPoint()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "MdcaPoint",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_MdcaPointL, Teardown )
+
+EUNIT_TEST(
+    "CGSItemTextArray - SetDynamicTextL()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "SetDynamicTextL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_SetDynamicTextL, Teardown )
+    
+EUNIT_TEST(
+    "CGSItemTextArray - SetDynamicTextDoublePaneL()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "SetDynamicTextDoublePaneL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_SetDynamicTextDoublePaneL, Teardown )
+
+EUNIT_TEST(
+    "CGSItemTextArray - SetItemVisibilityL()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "SetItemVisibilityL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_SetItemVisibilityL, Teardown )
+    
+EUNIT_TEST(
+    "CGSItemTextArray - CurrentFeature()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "CurrentFeature",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_CurrentFeatureL, Teardown )
+        
+EUNIT_TEST(
+    "CGSItemTextArray - IndexForFeatureIdL()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "IndexForFeatureIdL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_IndexForFeatureIdL, Teardown )
+
+EUNIT_TEST(
+    "CGSItemTextArray - FeatureIdByIndex()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "FeatureIdByIndex",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_FeatureIdByIndexL, Teardown )
+
+EUNIT_TEST(
+    "CGSItemTextArray - FeatureByIdL()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "FeatureByIdL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_FeatureByIdL, Teardown )
+
+EUNIT_TEST(
+    "CGSItemTextArray - GetItemCaptionFromFeatureIdLC()", //case description
+    "CGSItemTextArray",                   //class being tested
+    "GetItemCaptionFromFeatureIdLC",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupGSItemTextArrayL, T_Global_GSItemTextArray_GetItemCaptionFromFeatureIdLC, Teardown )
+
+    
+// CGSRadioButtonSettingPageItemTextArray test cases
+    
+EUNIT_TEST(
+    "CGSRadioButtonSettingPageItemTextArray - NewL()", //case description
+    "CGSRadioButtonSettingPageItemTextArray",                   //class being tested
+    "NewL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupResourceL, T_Global_GSRBSPItemTextArray_NewL, Teardown )
+
+EUNIT_TEST(
+    "CGSRadioButtonSettingPageItemTextArray - CurrentFeatureL()", //case description
+    "CGSRadioButtonSettingPageItemTextArray",                   //class being tested
+    "CurrentFeatureL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    Setup_GSRBSPItemTextArrayL, T_Global_GSRBSPItemTextArray_CurrentFeatureL, Teardown )
+
+EUNIT_TEST(
+    "CGSRadioButtonSettingPageItemTextArray - SetRadioButtonSettingPageL()", //case description
+    "CGSRadioButtonSettingPageItemTextArray",                   //class being tested
+    "SetRadioButtonSettingPageL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    Setup_GSRBSPItemTextArrayL, T_Global_GSRBSPItemTextArray_SetRadioButtonSettingPageL, Teardown )
+    
+    
+// CGSListBoxItemTextArray test cases
+    
+EUNIT_TEST(
+    "CGSListBoxItemTextArray - NewL()", //case description
+    "CGSListBoxItemTextArray",                   //class being tested
+    "NewL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupResourceL, T_Global_CGSLBITextArray_NewL, Teardown )
+    
+EUNIT_TEST(
+    "CGSListBoxItemTextArray - another NewL()", //case description
+    "CGSListBoxItemTextArray",                   //class being tested
+    "overloaded NewL",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    SetupResourceL, T_Global_CGSLBITextArray_New2L, Teardown )
+    
+EUNIT_TEST(
+    "CGSListBoxItemTextArray - CurrentFeature()", //case description
+    "CGSListBoxItemTextArray",                   //class being tested
+    "CurrentFeature",            //method being tested
+    "FUNCTIONALITY",                        //FUNCTIONALITY, BOUNDARY, ERRORHANDLING
+    Setup_CGSLBITextArrayL, T_Global_CGSLBITextArray_CurrentFeatureL, Teardown )
+    
+EUNIT_END_TEST_TABLE
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef __T_GSLISTBOX_H__
+#define __T_GSLISTBOX_H__
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include <GSListBox.h>
+
+//  INTERNAL INCLUDES
+
+//  FORWARD DECLARATIONS
+
+
+//  CLASS DEFINITION
+NONSHARABLE_CLASS( T_GSListBox )
+	: public CEUnitTestSuiteClass
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static T_GSListBox* NewL();
+        static T_GSListBox* NewLC();
+        /**
+         * Destructor
+         */
+        ~T_GSListBox();
+
+    private:    // Constructors and destructors
+
+        T_GSListBox();
+        void ConstructL();
+
+    private:    // New methods
+
+         void SetupL();
+         void Teardown();
+         
+         // CGSListboxEntry test cases
+         void SetupListBoxEntryL();
+         void T_Global_GSListBox_NewLC();
+         void T_Global_GSListBox_New2LC();
+         void T_Global_GSListBox_New3LC();
+         void T_Global_GSListBox_FeatureIdL();
+         void T_Global_GSListBox_TypeL();
+         void T_Global_GSListBox_CaptionL();
+         void T_Global_GSListBox_SetDynamicTextL();
+         void T_Global_GSListBox_SetDynamicTextDoublePaneL();
+         
+         // CGSItemTextArray test cases
+         void SetupGSItemTextArrayL();
+         void T_Global_GSItemTextArray_SetupL();
+         void T_Global_GSItemTextArray_MdcaCountL();
+         void T_Global_GSItemTextArray_MdcaPointL();
+         void T_Global_GSItemTextArray_SetDynamicTextL();
+         void T_Global_GSItemTextArray_SetDynamicTextDoublePaneL();
+         void T_Global_GSItemTextArray_SetItemVisibilityL();
+         void T_Global_GSItemTextArray_CurrentFeatureL();
+         void T_Global_GSItemTextArray_IndexForFeatureIdL();
+         void T_Global_GSItemTextArray_FeatureIdByIndexL();
+         void T_Global_GSItemTextArray_FeatureByIdL();
+         void T_Global_GSItemTextArray_GetItemCaptionFromFeatureIdLC();
+         
+         // CGSRadioButtonSettingPageItemTextArray test cases
+         void SetupResourceL();
+         void T_Global_GSRBSPItemTextArray_NewL();
+         void Setup_GSRBSPItemTextArrayL();
+         void T_Global_GSRBSPItemTextArray_CurrentFeatureL();
+         void T_Global_GSRBSPItemTextArray_SetRadioButtonSettingPageL();
+         
+         // CGSListBoxItemTextArray test cases
+         void Setup_CGSLBITextArrayL();
+         void T_Global_CGSLBITextArray_NewL();
+         void T_Global_CGSLBITextArray_New2L();
+         void T_Global_CGSLBITextArray_CurrentFeatureL();
+         
+         
+
+    private:    // Data
+        CGSListboxEntry* iListboxEntry;
+        CGSItemTextArray* iItemTextArray;
+        CGSRadioButtonSettingPageItemTextArray* iRBSPArray;
+        CGSListBoxItemTextArray* iLBITextArray;
+        CEikListBox* iListBox;
+        
+        TInt iOffset;
+        
+        EUNIT_DECLARE_TEST_TABLE; 
+
+    };
+
+#endif      //  __T_GSLISTBOX_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox_DllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "T_GSListBox.h"
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return T_GSListBox::NewL();
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll( TDllReason )
+	{
+	return KErrNone;
+	}
+#endif
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "MT_CGSLauncher.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <GSLauncher.h>
+#include <GSFWViewUIDs.h>
+
+//  INTERNAL INCLUDES
+
+
+// CONSTRUCTION
+MT_CGSLauncher* MT_CGSLauncher::NewL()
+    {
+    MT_CGSLauncher* self = MT_CGSLauncher::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_CGSLauncher* MT_CGSLauncher::NewLC()
+    {
+    MT_CGSLauncher* self = new( ELeave ) MT_CGSLauncher();
+    CleanupStack::PushL( self );
+
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+MT_CGSLauncher::~MT_CGSLauncher()
+    {
+    }
+
+// Default constructor
+MT_CGSLauncher::MT_CGSLauncher()
+    {
+    }
+
+// Second phase construct
+void MT_CGSLauncher::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+//  METHODS
+
+void MT_CGSLauncher::EmptySetupL(  )
+    {
+    }
+    
+void MT_CGSLauncher::SetupL(  )
+    {
+    iCGSLauncher = CGSLauncher::NewL();;
+    }
+    
+
+void MT_CGSLauncher::Teardown(  )
+    {
+    if ( iCGSLauncher )
+    	{
+	    delete iCGSLauncher; 
+    	iCGSLauncher = NULL; 
+    	}
+    }
+    
+
+void MT_CGSLauncher::T_CGSLauncher_NewLL(  )
+    {
+    CGSLauncher* Launcher = CGSLauncher::NewL();
+    CleanupStack::PushL( Launcher );
+    EUNIT_ASSERT_DESC( Launcher != NULL, "An instance of CGSLauncher is not created");
+    CleanupStack::PopAndDestroy(); 
+    }
+    
+void MT_CGSLauncher::T_CGSLauncher_LaunchGSViewLL(  )
+    {
+    // iCGSLauncher->LaunchGSViewL( <add parameters here > );
+     EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real");
+    }
+    
+//----------------------------------------------------------------------------
+TBool MT_CGSLauncher::KillGSL()
+	{
+	RDebug::Print(_L("T_CGSLauncher::KillGSL()"));
+	TUid gsuid = TUid::Uid(0x100058EC);
+	TBool taskFoundAndEnded(EFalse);
+	RWsSession 		ws;
+	ws.Connect();
+	TApaTaskList 	l(ws);
+	TBool GSExist = l.FindApp(gsuid).Exists();
+	TInt i=5;
+	if ( GSExist )
+		{
+		while ( 1 )
+			{
+			RDebug::Print(_L("T_CGSLauncher::KillGSL()  trying to End GS"));
+			TApaTask 		gs = l.FindApp(gsuid);
+			if( !gs.Exists() || i-- < 0) 
+				{
+				taskFoundAndEnded = i>0 ? ETrue : EFalse;
+				break; 
+				}
+			gs.EndTask();
+			RDebug::Print(_L("T_CGSLauncher::KillGSL   Ended GS"));
+			User::After(TTimeIntervalMicroSeconds32 (100000));
+			}
+		}
+	ws.Close();
+	return taskFoundAndEnded;
+	}
+
+// ---------------------------------------------------------------------------
+//   Launches GS view, waits 8 sec and kills GS application (success criteria)
+void MT_CGSLauncher::LaunchGWView_gs_not_running(  )
+    {
+    	RDebug::Print(_L("T_CGSLauncher::T_CGSLauncher_LaunchGSViewL(  )"));
+     iCGSLauncher->LaunchGSViewL( KGSTelPluginUid,TUid::Uid(0),_L8("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") ); // telephony
+     User::After(TTimeIntervalMicroSeconds32 (8000000));
+     TBool endedSuccesfully=KillGSL();
+     EUNIT_ASSERT_DESC( endedSuccesfully, "test result");
+    }
+
+// ---------------------------------------------------------------------------
+// Launches GS view, waits 8 sec and launches other GS view. 
+// Waits 2 sec and kills GS application (success criteria)
+void MT_CGSLauncher::LaunchGWView_gs_is_running()
+	{
+ 	RDebug::Print(_L("T_CGSLauncher::LaunchGWView_gs_is_running(  )"));
+
+	iCGSLauncher->LaunchGSViewL( KGSGenPluginUid,TUid::Uid(0),_L8("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") ); // security view
+	User::After(TTimeIntervalMicroSeconds32 (8000000));
+
+	iCGSLauncher->LaunchGSViewL( KGSConPluginUid,TUid::Uid(0),KNullDesC8  ); // connection view
+	User::After(TTimeIntervalMicroSeconds32 (3000000));
+
+	TBool endedSuccesfully=KillGSL();
+	EUNIT_ASSERT_DESC( endedSuccesfully, "test result");
+	}
+	
+//  TEST TABLE
+EUNIT_BEGIN_TEST_TABLE(
+    MT_CGSLauncher,
+    "Add test suite description here.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "NewL and NewLC - test",
+    "CGSLauncher",
+    "NewL and NewLC",
+    "FUNCTIONALITY",
+    EmptySetupL, T_CGSLauncher_NewLL, Teardown)
+    
+EUNIT_TEST(
+    "Launch GS once",
+    "CGSLauncher",
+    "LaunchGSViewL",
+    "FUNCTIONALITY",
+    SetupL, LaunchGWView_gs_not_running, Teardown)
+
+EUNIT_TEST(
+    "Launch GS twice",
+    "CGSLauncher",
+    "LaunchGSViewL",
+    "FUNCTIONALITY",
+    SetupL, LaunchGWView_gs_is_running, Teardown)
+    
+
+EUNIT_END_TEST_TABLE
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef __MT_CGSLAUNCHER_H__
+#define __MT_CGSLAUNCHER_H__
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include <GSLauncher.h>
+
+//  INTERNAL INCLUDES
+
+
+//  FORWARD DECLARATIONS
+
+
+//  CLASS DEFINITION
+/**
+ * Auto-generated test suite
+ *
+ */
+NONSHARABLE_CLASS( MT_CGSLauncher )
+	: public CEUnitTestSuiteClass
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static MT_CGSLauncher* NewL();
+        static MT_CGSLauncher* NewLC();
+        /**
+         * Destructor
+         */
+        ~MT_CGSLauncher();
+
+    private:    // Constructors and destructors
+
+        MT_CGSLauncher();
+        void ConstructL();
+
+    private:    // New methods
+
+		 void EmptySetupL();
+		 
+         void SetupL();
+        
+         void Teardown();
+         
+         TBool KillGSL();
+        
+         void T_CGSLauncher_NewLL();
+        
+         void T_CGSLauncher_LaunchGSViewLL();
+         
+         void LaunchGWView_gs_not_running();
+         
+         void LaunchGWView_gs_is_running();
+        
+
+    private:    // Data
+		
+        CGSLauncher* iCGSLauncher;
+        EUNIT_DECLARE_TEST_TABLE; 
+
+    };
+
+#endif      //  __MT_CGSLAUNCHER_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher_DllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+//  CLASS HEADER
+#include "MT_CGSLauncher.h"
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return MT_CGSLauncher::NewL();
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll( TDllReason )
+	{
+	return KErrNone;
+	}
+#endif
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          MT_CGSLauncher.dll
+TARGETTYPE      dll
+UID             0x1000af5a 0x01700000
+
+CAPABILITY              ALL -TCB
+VENDORID                0x00000000
+
+SOURCEPATH              ../MT_GSLauncher
+SOURCE                  MT_CGSLauncher.cpp
+
+// Sources required by the test suite
+SOURCEPATH              ../MT_GSLauncher
+SOURCE                  MT_CGSLauncher_DllMain.cpp
+
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+
+SYSTEMINCLUDE           /epoc32/include/Digia/EUnit
+
+// System include folders required by the tested code
+SYSTEMINCLUDE           ../../../../gslauncher/inc
+
+LIBRARY                 EUnit.lib
+LIBRARY                 EUnitUtil.lib
+LIBRARY                 euser.lib
+
+LIBRARY                 gslauncher.lib
+LIBRARY					ws32.lib			// wssession
+LIBRARY					viewcli.lib
+LIBRARY     			apgrfx.lib
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+#include <platform_paths.hrh>
+
+
+
+TARGET                  MT_GSFramework.dll
+TARGETTYPE              dll
+UID                     0x1000af5a 0x01700000
+
+CAPABILITY              ALL -TCB
+VENDORID                0x00000000
+
+
+// Sources required by the test suite
+SOURCEPATH              ../GSFramework
+SOURCE                  MT_GSFramework.cpp
+SOURCE					TestGSBaseView.cpp
+SOURCE					TestGSPlugin.cpp
+SOURCE                  MT_GSFramework_DllMain.cpp
+
+// Sources that mus be compiled and included into test dll.
+//SOURCEPATH				      ../../../../GSFramework/src
+//SOURCE					        ../../../../GSFramework/src/GSParentContainer.cpp
+
+
+// User include folders required by the tested code
+USERINCLUDE             ../../../../GSFramework/inc
+USERINCLUDE             ../../../../Logger
+USERINCLUDE             ../../../../GSInteractionPlugin/inc
+
+
+// Default system include paths for middleware layer modules.
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE           /epoc32/include/Digia/EUnit
+
+
+// Utility & EUnit libraries
+LIBRARY                 EUnit.lib
+LIBRARY                 EUnitUtil.lib
+LIBRARY                 euser.lib
+LIBRARY 				cone.lib
+
+// Tested libraries
+LIBRARY 				GSFramework.lib
+LIBRARY 				GSEcomPlugin.lib
+LIBRARY					apgrfx.lib	//	RApaLsSession
+LIBRARY					apparc.lib 	//	TApaAppInfo
+LIBRARY					ws32.lib 	//	RWsSession
+LIBRARY				    avkon.lib
+LIBRARY     			eikcore.lib
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          T_GSBackgroundImage.dll
+TARGETTYPE      dll
+UID             0x1000af5a 0x01700000
+
+CAPABILITY              ALL -TCB
+VENDORID                0x00000000
+
+// Sources required by the test suite
+USERINCLUDE             ../GSBackgroundImage
+SOURCEPATH              ../GSBackgroundImage
+SOURCE                  T_GSBackgroundImage_DllMain.cpp
+SOURCE                  T_GSBackgroundImage.cpp
+
+
+SYSTEMINCLUDE           /epoc32/include
+SYSTEMINCLUDE           /epoc32/include/Digia/EUnit
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 EUnit.lib
+LIBRARY                 EUnitUtil.lib
+LIBRARY                 euser.lib
+LIBRARY                 sysutil.lib
+// Libraries required by the tested code
+LIBRARY backgroundimage.lib
+LIBRARY efsrv.lib
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          T_GSListBox.dll
+TARGETTYPE      dll
+UID             0x1000af5a 0x01700000
+
+CAPABILITY              ALL -TCB
+VENDORID                0x00000000
+
+SOURCEPATH              ../GSListBox
+SOURCE                  T_GSListBox.cpp
+
+// Sources required by the test suite
+SOURCE                  T_GSListBox_DllMain.cpp
+
+USERINCLUDE             ../GSListBox
+
+SYSTEMINCLUDE           /epoc32/include
+SYSTEMINCLUDE           /epoc32/include/Digia/EUnit
+APP_LAYER_SYSTEMINCLUDE
+
+// System include folders required by the tested code
+
+
+LIBRARY                 EUnit.lib
+LIBRARY                 EUnitUtil.lib
+LIBRARY                 euser.lib
+LIBRARY                 sysutil.lib
+// Libraries required by the tested code
+LIBRARY efsrv.lib GSListBox.lib cone.lib avkon.lib bafl.lib
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+//    ARMV5 GCCE WINSCW
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+
+PRJ_TESTMMPFILES
+MT_GSFramework.mmp
+T_GSBackgroundImage.mmp
+T_GSListBox.mmp
+MT_CGSLauncher.mmp
+
+gnumakefile copy_binaries_to_sys_dir.mk
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/group/copy_binaries_to_sys_dir.mk	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_GSFramework.dll	/f
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSBackgroundImage.dll /f
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSListBox.dll /f
+	del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_CGSLauncher.dll	/f
+
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : do_nothing
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES : do_nothing
+
+FINAL :
+	echo COPYING
+	copy \epoc32\RELEASE\winscw\udeb\MT_GSFramework.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y
+	copy \epoc32\RELEASE\winscw\udeb\T_GSBackgroundImage.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y
+	copy \epoc32\RELEASE\winscw\udeb\T_GSListBox.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y
+	copy \epoc32\RELEASE\winscw\udeb\MT_CGSLauncher.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin	/y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/group/move.cmd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+Copy \epoc32\RELEASE\winscw\udeb\MT_GSFramework.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y
+Copy \epoc32\RELEASE\winscw\udeb\T_GSBackgroundImage.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y
+Copy \epoc32\RELEASE\winscw\udeb\T_GSListBox.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y
+Copy \epoc32\RELEASE\winscw\udeb\MT_CGSLauncher.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/Gs/tsrc/public/basic/test.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<test>
+	<name>Gs - Automated Tests</name>
+    <target>
+        <device rank="none" alias="DEFAULT">
+            <property name="HARNESS" value="EUNIT" />
+            <property name="TYPE" value="Ariane" />
+        </device>
+    </target>
+    <plan name="Gs - S60 5.0 Test Plan" harness="EUNIT" enabled="true" passrate="100">
+        <session name="session" harness="EUNIT" enabled="true" passrate="100">
+            <set name="set" harness="EUNIT" enabled="true" passrate="100">
+                <target>
+                    <device rank="master" alias="DEFAULT"/>
+                </target>
+                <case name="Test Case 1" harness="EUNIT" enabled="true" passrate="100">
+                    <flash target-alias="DEFAULT" images="ATS3Drop/images/sydo_gs_ats3_image.fpsx" />
+                    <flash target-alias="DEFAULT" images="ATS3Drop/images/sydo_gs_ats3_image_udaerase.fpsx" />
+
+                    <!-- Create CTC coverage result folder -->
+                    <!-- MANDATORY STEP -->
+                    <step name="Create CTC log dir" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>makedir</command>
+                        <params>
+                            <param dir="c:\data\ctc\"/>
+                        </params>
+                    </step>
+
+                    <!-- Install testmodule MT_GSFramework -->
+                    <step name="Install testmodule MT_GSFramework DLL" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>install</command>
+                        <params>
+                            <param component-path="ATS3Drop"/>
+                            <param type="binary"/>
+                            <param src="MT_GSFramework.dll"/>
+                            <param dst="c:\sys\bin\MT_GSFramework.dll"/>
+                        </params>
+                    </step>
+                    <step name="Install testmodule T_GSBackgroundImage DLL" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>install</command>
+                        <params>
+                            <param component-path="ATS3Drop"/>
+                            <param type="binary"/>
+                            <param src="T_GSBackgroundImage.dll"/>
+                            <param dst="c:\sys\bin\T_GSBackgroundImage.dll"/>
+                        </params>
+                    </step>
+                    <step name="Install testmodule T_GSListBox DLL" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>install</command>
+                        <params>
+                            <param component-path="ATS3Drop"/>
+                            <param type="binary"/>
+                            <param src="T_GSListBox.dll"/>
+                            <param dst="c:\sys\bin\T_GSListBox.dll"/>
+                        </params>
+                    </step>
+                    <step name="Install testmodule MT_CGSLauncher DLL" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>install</command>
+                        <params>
+                            <param component-path="ATS3Drop"/>
+                            <param type="binary"/>
+                            <param src="MT_CGSLauncher.dll"/>
+                            <param dst="c:\sys\bin\MT_CGSLauncher.dll"/>
+                        </params>
+                    </step>
+
+                    <!-- Start CTC manager -->
+                    <!-- MANDATORY STEP -->
+                    <step name="CTC start" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>execute</command>
+                        <params>
+                            <param file="z:\sys\bin\ctcman.exe"/>
+                        </params>
+                    </step>
+
+                    <!-- Create EUnit log dir -->
+                    <!-- MANDATORY STEP -->
+                    <step name="Create EUnit log dir" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>makedir</command>
+                        <params>
+                            <param dir="c:\shared\eunit\logs\"/>
+                        </params>
+                    </step>
+
+                    <!-- Execute tests -->
+                    <step name="Execute tests" harness="EUNIT" enabled="true" passrate="100" significant="true">
+                        <command>execute</command>
+                        <params>
+                            <param parameters="/l xml /e s60appenv /t 90 /p All /w 30 /r warning MT_GSFramework MT_CGSLauncher T_GSBackgroundImage T_GSListBox"/>
+                            <param timeout="720"/>
+                            <param result-file="c:\shared\eunit\logs\EUnit_log.xml"/>
+                            <param file="z:\sys\bin\EUNITEXERUNNER.EXE"/>
+                        </params>
+                    </step>
+
+                    <!-- Save CTC coverage data -->
+                    <!-- MANDATORY STEP -->
+                    <step name="Save CTC data" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>execute</command>
+                        <params>
+                            <param parameters="writefile"/>
+                            <param file="z:\sys\bin\ctcman.exe"/>
+                        </params>
+                    </step>
+
+                    <!-- Fetch and clean CTC data -->
+                    <!-- MANDATORY STEP -->
+                    <step name="Fetch and clean CTC data" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>fetch-log</command>
+                        <params>
+                            <param delete="true"/>
+                            <param path="c:\data\ctc\ctcdata.txt"/>
+                        </params>
+                    </step>
+                </case>
+            </set>
+        </session>
+    </plan>
+    <files>
+        <file>ATS3Drop/images/sydo_gs_ats3_image.fpsx</file>
+        <file>ATS3Drop/images/sydo_gs_ats3_image_udaerase.fpsx</file>
+        <file>ATS3Drop/armv5_urel/MT_GSFramework.dll</file>
+        <file>ATS3Drop/armv5_urel/T_GSBackgroundImage.dll</file>
+        <file>ATS3Drop/armv5_urel/T_GSListBox.dll</file>
+        <file>ATS3Drop/armv5_urel/MT_CGSLauncher.dll</file>
+    </files>
+
+    <!-- Send ATS3 test reports -->
+    <postAction>
+        <type>SendEmailAction</type>
+        <params>
+            <param name="type" value="ATS3_REPORT"/>
+            <param name="to" value="tomi.t.tolvanen@nokia.com;mika.kalkainen@nokia.com;ext-yang.1.lu@nokia.com"/>
+            <param name="subject" value="ATS3 report for §RUN_NAME§ §RUN_START_DATE§ §RUN_START_TIME§"/>
+            <param name="send-files" value="true"/>
+        </params>
+    </postAction>
+
+    <!-- File store action sends the ATS3 report to \\ousrv058. -->
+    <!-- MANDATORY POST ACTION -->
+    <postAction>
+        <type>FileStoreAction</type>
+        <params>
+            <param name="to-folder" value="\\ousrv058\data$\ATS3Reports\S60_5_0\Sydo\Devicemanagement\Gs\"/>
+        </params>
+    </postAction>
+</test>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gssettingsuis/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+#include "../Gs/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/mw/gsprofilesrv" >
+]>
+
+<SystemDefinition name="gsprofilesrv" schema="1.4.0">
+  <systemModel>
+    <layer name="bldfirst_mw_layer">
+      <module name="gsprofilesrv">
+        <unit name="gsprofilesrv" unitID="presdo.gsprofilesrv" bldFile="&layer_real_source_path;/group" mrp="" />
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/BWINS/FileListU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,38 @@
+EXPORTS
+	??1CFLDController@@UAE@XZ @ 1 NONAME ; CFLDController::~CFLDController(void)
+	??1CFLDFileListContainer@@UAE@XZ @ 2 NONAME ; CFLDFileListContainer::~CFLDFileListContainer(void)
+	?AddExclusiveMediaTypeL@CFLDFileListContainer@@QAEXJ@Z @ 3 NONAME ; void CFLDFileListContainer::AddExclusiveMediaTypeL(long)
+	?AddExclusiveMimeTypeL@CFLDFileListContainer@@QAEXABVTDesC16@@@Z @ 4 NONAME ; void CFLDFileListContainer::AddExclusiveMimeTypeL(class TDesC16 const &)
+	?CompleteConstructionL@CFLDController@@QAEXAAVRWindow@@@Z @ 5 NONAME ; void CFLDController::CompleteConstructionL(class RWindow &)
+	?HandleFileListBoxEventL@CFLDController@@UAEXW4TFileListBoxEvent@MFLDFileListBoxObserver@@ABVTDesC16@@@Z @ 6 NONAME ; void CFLDController::HandleFileListBoxEventL(enum MFLDFileListBoxObserver::TFileListBoxEvent, class TDesC16 const &)
+	?InsertEndNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@0@Z @ 7 NONAME ; void CFLDFileListContainer::InsertEndNullItemL(class TDesC16 const &, class TDesC16 const &)
+	?InsertEndNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@@Z @ 8 NONAME ; void CFLDFileListContainer::InsertEndNullItemL(class TDesC16 const &)
+	?InsertNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@0@Z @ 9 NONAME ; void CFLDFileListContainer::InsertNullItemL(class TDesC16 const &, class TDesC16 const &)
+	?InsertNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@@Z @ 10 NONAME ; void CFLDFileListContainer::InsertNullItemL(class TDesC16 const &)
+	?LaunchL@CFLDFileListContainer@@QAEHAAVTDes16@@ABVTDesC16@@@Z @ 11 NONAME ; int CFLDFileListContainer::LaunchL(class TDes16 &, class TDesC16 const &)
+	?NewL@CFLDController@@SAPAV1@HVTTimeIntervalMicroSeconds32@@@Z @ 12 NONAME ; class CFLDController * CFLDController::NewL(int, class TTimeIntervalMicroSeconds32)
+	?NewL@CFLDFileListContainer@@SAPAV1@H@Z @ 13 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewL(int)
+	?NewL@CFLDFileListContainer@@SAPAV1@HH@Z @ 14 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewL(int, int)
+	?NewL@CFLDFileListContainer@@SAPAV1@XZ @ 15 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewL(void)
+	?NewLC@CFLDController@@SAPAV1@HVTTimeIntervalMicroSeconds32@@@Z @ 16 NONAME ; class CFLDController * CFLDController::NewLC(int, class TTimeIntervalMicroSeconds32)
+	?NewLC@CFLDFileListContainer@@SAPAV1@H@Z @ 17 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewLC(int)
+	?NewLC@CFLDFileListContainer@@SAPAV1@HH@Z @ 18 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewLC(int, int)
+	?NewLC@CFLDFileListContainer@@SAPAV1@XZ @ 19 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewLC(void)
+	?ResetExclusiveMediaTypes@CFLDFileListContainer@@QAEXXZ @ 20 NONAME ; void CFLDFileListContainer::ResetExclusiveMediaTypes(void)
+	?ResetExclusiveMimeTypes@CFLDFileListContainer@@QAEXXZ @ 21 NONAME ; void CFLDFileListContainer::ResetExclusiveMimeTypes(void)
+	?SetAutomatedType@CFLDFileListContainer@@QAEXW4TDRMHelperAutomatedType@CDRMHelper@@@Z @ 22 NONAME ; void CFLDFileListContainer::SetAutomatedType(enum CDRMHelper::TDRMHelperAutomatedType)
+	?SetDelay@CFLDController@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 23 NONAME ; void CFLDController::SetDelay(class TTimeIntervalMicroSeconds32)
+	?SetDelay@CFLDFileListContainer@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 24 NONAME ; void CFLDFileListContainer::SetDelay(class TTimeIntervalMicroSeconds32)
+	?SetFileObserver@CFLDController@@QAEXPAVMFLDFileObserver@@@Z @ 25 NONAME ; void CFLDController::SetFileObserver(class MFLDFileObserver *)
+	?SetMaxFileSize@CFLDFileListContainer@@QAEXH@Z @ 26 NONAME ; void CFLDFileListContainer::SetMaxFileSize(int)
+	?SetRingingType@CFLDController@@QAEXH@Z @ 27 NONAME ; void CFLDController::SetRingingType(int)
+	?SetRingingType@CFLDFileListContainer@@QAEXH@Z @ 28 NONAME ; void CFLDFileListContainer::SetRingingType(int)
+	?SetVibra@CFLDController@@QAEXH@Z @ 29 NONAME ; void CFLDController::SetVibra(int)
+	?SetVibra@CFLDFileListContainer@@QAEXH@Z @ 30 NONAME ; void CFLDFileListContainer::SetVibra(int)
+	?SetVolume@CFLDController@@QAEXH@Z @ 31 NONAME ; void CFLDController::SetVolume(int)
+	?SetVolume@CFLDFileListContainer@@QAEXH@Z @ 32 NONAME ; void CFLDFileListContainer::SetVolume(int)
+	?SetWantedMediaTypesL@CFLDFileListContainer@@QAEXABV?$TArray@W4TCLFMediaType@@@@@Z @ 33 NONAME ; void CFLDFileListContainer::SetWantedMediaTypesL(class TArray<enum TCLFMediaType> const &)
+	?SetWantedMimeTypesL@CFLDFileListContainer@@QAEXABVMDesC16Array@@@Z @ 34 NONAME ; void CFLDFileListContainer::SetWantedMimeTypesL(class MDesC16Array const &)
+	?Set3dEffects@CFLDController@@QAEXH@Z @ 35 NONAME ; void CFLDController::Set3dEffects(int)
+	?Set3dEffects@CFLDFileListContainer@@QAEXH@Z @ 36 NONAME ; void CFLDFileListContainer::Set3dEffects(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/EABI/FileListU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,49 @@
+EXPORTS
+	_ZN14CFLDController14SetRingingTypeEi @ 1 NONAME
+	_ZN14CFLDController15SetFileObserverEP16MFLDFileObserver @ 2 NONAME
+	_ZN14CFLDController21CompleteConstructionLER7RWindow @ 3 NONAME
+	_ZN14CFLDController23HandleFileListBoxEventLEN23MFLDFileListBoxObserver17TFileListBoxEventERK7TDesC16 @ 4 NONAME
+	_ZN14CFLDController4NewLEi27TTimeIntervalMicroSeconds32 @ 5 NONAME
+	_ZN14CFLDController5NewLCEi27TTimeIntervalMicroSeconds32 @ 6 NONAME
+	_ZN14CFLDController8SetDelayE27TTimeIntervalMicroSeconds32 @ 7 NONAME
+	_ZN14CFLDController8SetVibraEi @ 8 NONAME
+	_ZN14CFLDController9SetVolumeEi @ 9 NONAME
+	_ZN14CFLDControllerD0Ev @ 10 NONAME
+	_ZN14CFLDControllerD1Ev @ 11 NONAME
+	_ZN14CFLDControllerD2Ev @ 12 NONAME
+	_ZN21CFLDFileListContainer14SetMaxFileSizeEi @ 13 NONAME
+	_ZN21CFLDFileListContainer14SetRingingTypeEi @ 14 NONAME
+	_ZN21CFLDFileListContainer15InsertNullItemLERK7TDesC16 @ 15 NONAME
+	_ZN21CFLDFileListContainer15InsertNullItemLERK7TDesC16S2_ @ 16 NONAME
+	_ZN21CFLDFileListContainer16SetAutomatedTypeEN10CDRMHelper23TDRMHelperAutomatedTypeE @ 17 NONAME
+	_ZN21CFLDFileListContainer18InsertEndNullItemLERK7TDesC16 @ 18 NONAME
+	_ZN21CFLDFileListContainer18InsertEndNullItemLERK7TDesC16S2_ @ 19 NONAME
+	_ZN21CFLDFileListContainer19SetWantedMimeTypesLERK12MDesC16Array @ 20 NONAME
+	_ZN21CFLDFileListContainer20SetWantedMediaTypesLERK6TArrayI13TCLFMediaTypeE @ 21 NONAME
+	_ZN21CFLDFileListContainer21AddExclusiveMimeTypeLERK7TDesC16 @ 22 NONAME
+	_ZN21CFLDFileListContainer22AddExclusiveMediaTypeLEl @ 23 NONAME
+	_ZN21CFLDFileListContainer23ResetExclusiveMimeTypesEv @ 24 NONAME
+	_ZN21CFLDFileListContainer24ResetExclusiveMediaTypesEv @ 25 NONAME
+	_ZN21CFLDFileListContainer4NewLEi @ 26 NONAME
+	_ZN21CFLDFileListContainer4NewLEii @ 27 NONAME
+	_ZN21CFLDFileListContainer4NewLEv @ 28 NONAME
+	_ZN21CFLDFileListContainer5NewLCEi @ 29 NONAME
+	_ZN21CFLDFileListContainer5NewLCEii @ 30 NONAME
+	_ZN21CFLDFileListContainer5NewLCEv @ 31 NONAME
+	_ZN21CFLDFileListContainer7LaunchLER6TDes16RK7TDesC16 @ 32 NONAME
+	_ZN21CFLDFileListContainer8SetDelayE27TTimeIntervalMicroSeconds32 @ 33 NONAME
+	_ZN21CFLDFileListContainer8SetVibraEi @ 34 NONAME
+	_ZN21CFLDFileListContainer9SetVolumeEi @ 35 NONAME
+	_ZN21CFLDFileListContainerD0Ev @ 36 NONAME
+	_ZN21CFLDFileListContainerD1Ev @ 37 NONAME
+	_ZN21CFLDFileListContainerD2Ev @ 38 NONAME
+	_ZTI14CFLDController @ 39 NONAME ; #<TI>#
+	_ZTI21CFLDFileListContainer @ 40 NONAME ; #<TI>#
+	_ZTV14CFLDController @ 41 NONAME ; #<VT>#
+	_ZTV21CFLDFileListContainer @ 42 NONAME ; #<VT>#
+	_ZThn4_N14CFLDController23HandleFileListBoxEventLEN23MFLDFileListBoxObserver17TFileListBoxEventERK7TDesC16 @ 43 NONAME ; #<thunk>#
+	_ZThn4_N14CFLDControllerD0Ev @ 44 NONAME ; #<thunk>#
+	_ZThn4_N14CFLDControllerD1Ev @ 45 NONAME ; #<thunk>#
+	_ZN14CFLDController12Set3dEffectsEi @ 46 NONAME
+	_ZN21CFLDFileListContainer12Set3dEffectsEi @ 47 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Inc/CFLDFileListModel.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,379 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* This class implements a model of a file list.
+* The class is inherited from MDesCArray, so it can be used directly
+* as a model for a listbox.
+*
+*
+*/
+
+
+
+#ifndef __CFLDFILELISTMODEL_H__
+#define __CFLDFILELISTMODEL_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <bamdesca.h>
+#include <badesca.h>
+#include <CLFContentListing.hrh>
+#include <MCLFChangedItemObserver.h>
+#include <MCLFPostFilter.h>
+
+// FORWARD DECLARATIONS
+class CFLDOperationObserver;
+class CFLDChangedItemObserver;
+class MCLFContentListingEngine;
+class MCLFItemListModel;
+class CFLDEntryReference;
+class MFLDEntryFormatter;
+class CFLDWaitNote;
+class RConeResourceLoader;
+class TResourceReader;
+class MCLFModifiableItem;
+class CFLDPopupList;
+
+//  CLASS DECLARATION
+/**
+* This class implements a model of a file list.
+* The class is inherited from MDesCArray, so it can be used directly
+* as a model for a listbox.
+*
+* @lib filelist.lib
+* @since 2.1
+*/
+NONSHARABLE_CLASS( CFLDFileListModel )
+    : public CBase, public MDesCArray, public MCLFPostFilter
+    {
+    public:     // Constructors and destructors
+
+		/**
+        * Two-phased static constructor.
+        * @param aModelResourceId A CLF model resource, see CLFContentListing.rh
+        * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
+        * structure, see FileListModel.rh for details
+        * @return A pointer to a constructed CFLDFileListModel object
+        */
+        static CFLDFileListModel* NewL(
+         const TInt aModelResourceId, const TInt aDirectoriesResourceId );
+
+        /**
+        * Two-phased static constructor.
+        * @param aModelResourceId A CLF model resource, see CLFContentListing.rh
+        * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
+        * structure, see FileListModel.rh for details
+        * @return A pointer to a constructed CFLDFileListModel object
+        */
+        static CFLDFileListModel* NewLC(
+         const TInt aModelResourceId, const TInt aDirectoriesResourceId );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CFLDFileListModel();
+
+    private:  // Constructors and destructors
+
+        /**
+        * Constructor
+        */
+        CFLDFileListModel();
+
+        /**
+        * Second phase constructor
+        * @param aModelResourceId A CLF model resource, see CLFContentListing.rh
+        * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
+        * structure, see FileListModel.rh for details
+        */
+        void ConstructL(
+         const TInt aModelResourceId, const TInt aDirectoriesResourceId );
+
+    public:     // New methods
+
+    	/**
+        * Returns file media type
+        * @param aFileName A descriptor containing the media file name
+        * @return Media file type (see TCLFMediaType enumeration
+		* inside CFLContentListing.hrh)
+        */
+    	TInt32 MediaFileType( const TDesC& aFileName ) const;
+
+    	/**
+		* Adds a new MIME type into blocking list.
+		* @param aMimeType The blocked MIME type
+        */
+    	void AddExclusiveMimeTypeL( const TDesC& aMimeType );
+
+    	/**
+		* Adds a new media type into blocking list.
+		* @param aMediaType The blocked media type (see TCLFMediaType enumeration
+		* inside CFLContentListing.hrh)
+        */
+    	void AddExclusiveMediaTypeL( const TInt32 aMediaType );
+
+    	/**
+		* Removes all the defined exlusive MIME types
+        */
+    	void ResetExclusiveMimeTypes();
+
+    	/**
+		* Removes all the defined exlusive media types
+        */
+    	void ResetExclusiveMediaTypes();
+
+    	/**
+		* Sets wanted mime types. Overrides all settings defined inside
+		* resource, defined with AddExclusive -methods or with
+		* SetWanted -methods.
+		* @param aMimeTypes The array containing wanted MIME types
+        */
+    	void SetWantedMimeTypesL( const MDesCArray& aMimeTypes );
+
+     	/**
+		* Sets wanted media types. Overrides all settings defined inside
+		* resource, defined with AddExclusive -methods or with
+		* SetWanted -methods.
+		* @param aMediaTypes The array containing wanted media types
+        */
+    	void SetWantedMediaTypesL( const TArray<TCLFMediaType>& aMediaTypes );
+
+     	/**
+        * Refreshes the file list.
+        */
+        void RefreshEntryListL();
+
+    	/**
+		* Sets popup list to Model. Needed to update the listbox after the
+		* model has changed (e.g. after inserting a memory card).
+		* @param aPopupList The popup list
+        */
+		void SetPopupList( CFLDPopupList* aPopupList );
+
+    	/**
+        * Retrieves a full path of an entry (e.g. "c:\folder\file.ext")
+        * @param aFileName A modifiable descriptor where the path and filename
+        *        is placed, or KNullDesc if aIndex points to the null text item.
+        *        Note: aFileName.Length() >= KMaxFileName
+        * @param aIndex Index of the entry to retrieve
+        */
+        void GetFileName( TDes& aFileName, const TInt aIndex );
+
+	    /**
+        * Sets an MFLDEntryFormatter inherited for the model. Ownership of the given
+        * object is transferred to CFLDFileListModel.
+        * @param aFormatter A pointer to a MFLDEntryFormatter inherited object.
+        */
+        void SetEntryFormatter( MFLDEntryFormatter* aFormatter );
+
+     	/**
+        * Adds a text (e.g. "None") as the first item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        */
+        void InsertNullItemL( const TDesC& aItemText );
+
+        /**
+        * Adds a text (e.g. "None") as the first item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        * @param aFileName A descriptor containing the ringing tone file name form null item
+        */
+        void InsertNullItemL( const TDesC& aItemText, const TDesC& aFileName );
+
+        /**
+        * Adds a text (e.g. "None") as the last item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        */
+        void InsertEndNullItemL( const TDesC& aItemText );
+
+        /**
+        * Adds a text (e.g. "None") as the last item of the list,
+        * which will not be sorted among the file name items.
+        * @param aItemText A descriptor containing the null item text
+        * @param aFileName A descriptor containing the ringing tone file name form null item
+        */
+        void InsertEndNullItemL( const TDesC& aItemText, const TDesC& aFileName );
+
+        /**
+        * Find a file from the model's list
+        * @param aFileName The file name to be searched
+        * @return An index to the searched file, or KErrNotFound
+        */
+        TInt FindFileL( const TDesC& aFileName );
+        
+        /**
+        * Sets the maximum file size for the list.
+        * @param aMaxFileSize The maximum file size in bytes. If you want to allow all file
+        *        sizes, set this to KFLDNoSizeFiltering (defined in FileListModel.hrh).
+        */
+        void SetMaxFileSize( const TInt aMaxFileSize );
+        
+        /**
+         * Returns PopupList.
+         */
+        CFLDPopupList* GetPopupList();
+
+    private:     // Methods derived from MDesCArray
+
+        TPtrC16 MdcaPoint( TInt aIndex ) const;
+        
+        TInt MdcaCount() const;
+    
+    private:	// Methods derived from MCLFPostFilter
+    
+        void FilterItemsL( const TArray<MCLFItem*>& aItemList,
+                                RPointerArray<MCLFItem>& aFilteredItemList );
+
+	private:	// New methods
+
+		/*
+		* Checks if file needs to be filtered out from model
+		* @param aMimeType Media MIME type
+		* @param aMediaType Media type
+		* @param aPathAndFileName Path and filename
+		* @return EFalse if MO should be filtered out
+		*/
+		TBool CheckRules( 
+		 TPtrC& aMimeType, TInt32 aMediaType, TPtrC& aPathAndFileName );
+
+        /**
+        * Fill the entry reference list according to the added directories list
+        * and filtering parameters
+        */
+        void PopulateReferenceListL();
+
+         /**
+        * List all files from the list model to the list box.
+        */
+        void PopulateListBoxL();
+
+        /**
+		* Gets a filename at specific index.
+		* @param aIndex Index of the file (whole list is indexed)
+		* @param aFileName Descriptor where the filename is stored.
+		*/
+		void GetFileNameAtIndex( TInt aIndex, TDes& aFileName ) const;
+		
+		/**
+		* Scans user defined Rom directories and adds found entries
+		* into iRomRingingToneArray
+		*/
+		void ScanRomDirectoriesL();
+		
+		/**
+		* Scans user defined Rom directories and adds found entries
+		* into iRomRingingToneArray
+		*/
+		void ScanRomDirectoriesAndInsertL();
+
+		/**
+		* Adds directory into iDirectoryPaths
+		* @param aDirectory Directory to be scanned
+		*/
+		TInt AddDirectoryL( const TDesC& aDirectory );
+
+		/**
+		* Adds directory into iRomDirectoryPaths
+		* @param aDirectory Directory to be scanned
+		*/
+		TInt AddRomDirectoryL( const TDesC& aDirectory );
+		
+		/**
+		* Loads directories from resource file
+		* @param aDirectoriesResourceId Resource ID to directory structure
+		*/
+ 		void LoadDirectoriesL( const TInt aDirectoriesResourceId );
+
+ 		/**
+         * Checks ringing tone file size.
+         * @param aFile         file to check.
+         * @param aSizeLimit  maximum allowed file size in bytes.
+         * @return KErrNone, if ok.
+         *         KErrTooBig, if configurable file size limit exceeded.
+         */
+        TInt CheckToneFileSizeL( const TDesC& aFile, TInt aSizeLimit );
+
+    private:  // Data
+
+        /// Own: Content listing engine
+        MCLFContentListingEngine* iEngine;
+
+        /// Own: Content listing model
+        MCLFItemListModel* iModel;
+
+         /// Own: Content listeng operation observer
+        CFLDOperationObserver* iObserver;
+        
+         /// Own: Content listeng operation observer
+        CFLDChangedItemObserver* iChangedItemObserver;
+
+        /// Own: MFLDEntryFormatter to use in formatting the entries
+        MFLDEntryFormatter* iEntryFormatter;
+
+		/// Own: Wait note dialog for indicating refreshing process of the List Model
+        CFLDWaitNote* iWaitNote;
+    
+    	/// Contains references to all the entries. This is the list that
+        /// gets sorted and filtered
+        RPointerArray<CFLDEntryReference> iEntryReferences;
+
+        /// Optional text items in the beginning of the list
+        RPointerArray<HBufC> iNullTextArray;
+
+        /// Optional ringing tones for null texts
+        RPointerArray<HBufC> iNullTextRingingToneArray;
+
+        /// Optional text items in the end of the list
+        RPointerArray<HBufC> iEndNullTextArray;
+
+        /// Optional ringing tones for end null items
+        RPointerArray<HBufC> iEndNullTextRingingToneArray;
+
+        /// For waiting the asynchronous refresh operation to complete
+        CActiveSchedulerWait iWait;
+
+        /// Array for exclusive mimetypes.
+		CDesCArraySeg iExclusiveMimeTypes;
+
+		/// Array for exclusive mediatypes.
+		RArray<TInt32> iExclusiveMediaTypes;
+				
+	    /// Contains descriptors containing
+	    /// the user-defined phone directory paths
+        CDesCArraySeg iDirectoryPaths;
+        
+        /// Contains descriptors containing
+        /// the user-defined ROM directory paths
+        CDesCArraySeg iRomDirectoryPaths;
+		
+		/// Array for user-defined ringingtones
+		RPointerArray<MCLFModifiableItem> iRomRingingToneArray;
+		
+        /// Maximum file size in bytes
+        TInt iMaxFileSize;
+
+        /// Popup list
+		CFLDPopupList* iPopupList;
+		
+		/// Using ROM tones only
+		TBool iRomTonesOnly;
+    };
+
+#endif      //  __CFLDFILELISTMODEL_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDBrowserLauncher.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation for Download tones feature
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "CFLDBrowserLauncher.h"
+
+// INTERNAL INCLUDES
+#include    "CFLDCommandAbsorbingControl.h"
+
+// EXTERNAL INCLUDES
+#include    <BrowserLauncher.h>
+#include    <DocumentHandler.h>
+#include    <eikenv.h>
+#include    <apmstd.h>
+#include	<AiwCommon.h>
+#include    <BrowserOverriddenSettings.h>
+#include    <FavouritesLimits.h> // Context Id:s
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDBrowserLauncher::CFLDBrowserLauncher
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDBrowserLauncher::CFLDBrowserLauncher()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDBrowserLauncher::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDBrowserLauncher::ConstructL()
+    {
+    iBrowserLauncher = CBrowserLauncher::NewL();
+    iDocumentHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDBrowserLauncher::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDBrowserLauncher* CFLDBrowserLauncher::NewLC()
+    {
+    CFLDBrowserLauncher* self = new( ELeave ) CFLDBrowserLauncher();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor
+CFLDBrowserLauncher::~CFLDBrowserLauncher()
+    {
+    delete iDocumentHandler;
+    delete iBrowserLauncher;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDBrowserLauncher::HandleContentL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CFLDBrowserLauncher::HandleContentL(
+		 const TDesC& aFileName,
+	  		const CAiwGenericParamList& aParamList, TBool& aContinue )
+	{
+	TBool isSaved( EFalse );
+
+    if( aParamList.Count() > 0 )
+   		{
+        TInt index( 0 );
+        aParamList.FindFirst( index, EGenericParamFileSaved );
+
+        if( index != KErrNotFound )
+        	{
+	        isSaved = ( aParamList[ index ].Value().AsTInt32() );
+       		}
+
+         }
+
+	// Tone is NOT yet saved by a browser, save it by using DocHandler
+	if(!isSaved)
+		{
+		//Let documenthandler to find out the datatype
+		TDataType nullType;
+		iDocumentHandler->CopyL( aFileName, KNullDesC, nullType, NULL );
+		}
+	
+	aContinue = ETrue;
+	return ETrue;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDBrowserLauncher::HandleContentL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TAny* CFLDBrowserLauncher::DownloadedContentHandlerReserved1( TAny* /*aAnyParam*/ )
+	{
+	return NULL;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDBrowserLauncher::LaunchBrowserL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDBrowserLauncher::LaunchBrowserL()
+    {
+	 // Absorb all key events and commands until browsing is finished
+    CFLDCommandAbsorbingControl::NewLC(); // Discard pointer, it's in stack.
+
+	iBrowserLauncher->LaunchBrowserSyncEmbeddedL(
+	 KFavouritesAudioContextId );
+
+    CleanupStack::PopAndDestroy(); // Browsing finished, remove command absorber.
+
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDBrowserLauncher.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation for Download tones feature
+*
+*/
+
+
+
+#ifndef CFLDBROWSERLAUNCHER_H
+#define CFLDBROWSERLAUNCHER_H
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <DownloadedContentHandler.h>
+
+// FORWARD DECLARATIONS
+class CDocumentHandler;
+class CBrowserLauncher;
+
+// CLASS DECLARATION
+
+/**
+*  Implementation for Download tones feature.
+*
+*  @lib FileList.lib
+*  @since 2.1
+*/
+NONSHARABLE_CLASS( CFLDBrowserLauncher ) : public CBase,
+ public MDownloadedContentHandler
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CFLDBrowserLauncher* NewLC();
+
+        virtual ~CFLDBrowserLauncher();
+
+    public: // New functions
+        
+        /**
+        * Launches Browser embedded. Waits until Browser is closed.
+        * @since 2.1
+        */
+        void LaunchBrowserL();
+
+    public: // Functions from base classes
+    
+		TBool HandleContentL(
+		 const TDesC& aFileName,
+	  		const CAiwGenericParamList& aParamList, TBool& aContinue );
+		
+		TAny* DownloadedContentHandlerReserved1( TAny* aAnyParam );
+
+    private:
+		
+		/**
+		* Default constructor
+		*/
+        CFLDBrowserLauncher();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+        /// Own: Browser Launcher
+        CBrowserLauncher* iBrowserLauncher;
+
+        /// Own: Document Handler for saving downloaded tones.
+        CDocumentHandler* iDocumentHandler;
+
+    };
+
+#endif      // CFLDBROWSERLAUNCHER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDChangedItemObserver.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CFLDChangedItemObserver.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CFLDChangedItemObserver.h"
+
+// INTERNAL INCLUDES
+#include "CFLDFileListModel.h"
+#include "CFLDWaitNote.h"
+#include "CFLDPopupList.h"
+#include "CFLDController.h"
+
+const TInt KDefaultDelay( 3000000 );
+// EXTERNAL INCLUDES
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDChangedItemObserver::CFLDChangedItemObserver
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDChangedItemObserver::CFLDChangedItemObserver()
+	: iModel( NULL )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDChangedItemObserver::CFLDChangedItemObserver
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDChangedItemObserver::CFLDChangedItemObserver(CFLDWaitNote* aWaitNote)
+	: iModel( NULL ),
+	iDelay(KDefaultDelay)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDChangedItemObserver::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDChangedItemObserver* CFLDChangedItemObserver::NewL()
+    {
+    CFLDChangedItemObserver* self = new (ELeave) CFLDChangedItemObserver();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDChangedItemObserver::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDChangedItemObserver* CFLDChangedItemObserver::NewL(CFLDWaitNote* aWaitNote)
+	{
+	CFLDChangedItemObserver* self = new (ELeave) CFLDChangedItemObserver(aWaitNote);
+	CleanupStack::PushL( self );
+	self->ConstructL(aWaitNote);
+	CleanupStack::Pop( self );
+	return self;
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDChangedItemObserver::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDChangedItemObserver::ConstructL( CFLDWaitNote* aWaitNote)
+	{
+	iTimer = CPeriodic::NewL( EPriorityNormal );
+	iWaitNote = aWaitNote;
+	}
+
+// Destructor
+CFLDChangedItemObserver::~CFLDChangedItemObserver()
+    {
+    if (iTimer)
+    	{
+    	  iTimer->Cancel();
+    	  delete iTimer;
+    	}
+  
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::SetFileListModel
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDChangedItemObserver::SetFileListModel( CFLDFileListModel* aModel )
+	{
+	iModel = aModel;	
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::HandleItemChangeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDChangedItemObserver::HandleItemChangeL( const TArray<TCLFItemId>& /*aItemIDArray*/ )
+	{
+	if( iModel )
+		{
+		TRAP_IGNORE( static_cast<CFLDController*>(iModel->GetPopupList()->GetFileListBoxObserver())->Release());
+		}
+	
+	if( iWaitNote && !iWaitNote->IsRunning() )
+		{
+		iWaitNote->OpenWaitNoteL();
+		}
+
+	
+    if (iModel)
+    	{
+    	iTimer->Cancel();
+		iTimer->Start( iDelay, iDelay, TCallBack( HandleModelRefreshL, this ) ); // CSI: 10 # iTimer is cancelled in Release()
+		
+		// When video screen is closed,
+		// listbox must be forced to be refreshed
+		// ( otherwise scrollbar is not redrawn)
+		iModel->GetPopupList()->ListBox()->SetDimmed( EFalse );
+		iModel->GetPopupList()->ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
+		iModel->GetPopupList()->DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::HandleModelRefreshL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDChangedItemObserver::HandleModelRefreshL( TAny* aPtr )
+	{
+	CFLDChangedItemObserver* observer= reinterpret_cast< CFLDChangedItemObserver* >( aPtr );
+	observer->iTimer->Cancel();
+	observer->iModel->RefreshEntryListL();
+	
+	return 0;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::HandleError
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDChangedItemObserver::HandleError( TInt /*aError*/ )
+	{
+	}
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDChangedItemObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CLF changed item Observer.
+*
+*/
+
+
+
+#ifndef __CFLDCHANGEDITEMOBSERVER_H__
+#define __CFLDCHANGEDITEMOBSERVER_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <MCLFChangedItemObserver.h>
+
+// FORWARD DECLARATIONS
+class CFLDFileListModel;
+class CFLDWaitNote;
+class CFLDController;
+// CLASS DECLARATION
+
+/**
+*  CLF changed item Observer.
+*  CFLDChangedItemObserver receives operation events of Content
+*  Listing Framework. Operation event is generated when model
+*  has been changed ( for example file has been renamed )
+*/
+NONSHARABLE_CLASS( CFLDChangedItemObserver )
+    : public CBase,
+      public MCLFChangedItemObserver
+    {
+    public:  // Constructors and destructor
+
+		/**
+		 * Creates and returns a new instance of this class.
+		 * @return Pointer to the CFLDChangedItemObserver object
+		 */
+	    static CFLDChangedItemObserver* NewL();
+	    
+	    /**
+	     * Creates and returns a new instance of this class.
+	     * @return Pointer to the CFLDChangedItemObserver object
+	     */
+	    static CFLDChangedItemObserver* NewL(CFLDWaitNote* aWaitNote);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CFLDChangedItemObserver();
+
+    private:    // Constructors
+        /**
+        * C++ default constructor.
+        */
+        CFLDChangedItemObserver();
+        
+        /**
+         * C++ constructor.
+         */
+        CFLDChangedItemObserver(CFLDWaitNote* aWaitNote);
+        
+        /**
+         * Second phase constructor
+         */
+        void ConstructL(CFLDWaitNote* aWaitNote );
+
+    protected:  // Methods derived from MCLFChangedItemObserver
+
+		void HandleItemChangeL( const TArray<TCLFItemId>& aItemIDArray );
+
+        void HandleError( TInt aError );
+
+	public:     // New functions
+		/*
+		* Sets callback instance of filelist model
+		* @param aModel Instance of filelist model
+		*/
+		void SetFileListModel( CFLDFileListModel* aModel );
+		
+	private:  // New methods
+
+		/**
+		 * This callback method is called when the timer expires. Calls
+		 * CFLDFileListModel::RefreshEntryListL().
+		 * @param aPtr pointer to CFLDChangedItemObserver
+		 * @return Returns always zero
+		 */
+		static TInt HandleModelRefreshL( TAny* aPtr );
+
+    private:    // Data
+
+    	/// Ref: FileList Model
+    	CFLDFileListModel* iModel;
+    	
+    	/// Ref: Wait note dialog for indicating refreshing process of the List Model
+    	CFLDWaitNote* iWaitNote;
+    	
+    	/// Own: Pointer to timer
+    	CPeriodic* iTimer;
+    	
+    	/// The delay in microseconds until timer expires
+    	TTimeIntervalMicroSeconds32 iDelay;
+
+    };
+
+#endif // __CFLDCHANGEDITEMOBSERVER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDCommandAbsorbingControl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Command absorber to eat all key presses.
+*
+*/
+
+// CLASS HEADER
+#include "CFLDCommandAbsorbingControl.h"
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32std.h>
+#include <eikappui.h>
+#include <eikenv.h>
+#include <eikbtgpc.h>
+
+// CONSTANTS
+namespace
+	{
+	//position 0 --> left
+	const TInt KLeftPosition( 0 );
+    //position 2 --> right
+   	const TInt KRightPosition( 2 );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDCommandAbsorbingControl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDCommandAbsorbingControl* CFLDCommandAbsorbingControl::NewL()
+    {
+    CFLDCommandAbsorbingControl* self = CFLDCommandAbsorbingControl::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CFLDCommandAbsorbingControl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDCommandAbsorbingControl* CFLDCommandAbsorbingControl::NewLC()
+    {
+    CFLDCommandAbsorbingControl* self = new ( ELeave ) CFLDCommandAbsorbingControl();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+// Destructor
+CFLDCommandAbsorbingControl::~CFLDCommandAbsorbingControl()
+    {
+  	Release();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CFLDCommandAbsorbingControl::CFLDPopupList
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDCommandAbsorbingControl::CFLDCommandAbsorbingControl()
+    {
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CFLDCommandAbsorbingControl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDCommandAbsorbingControl::ConstructL()
+    {
+    //if we don't have aplication ui,
+    //then there is no need to consume commands
+    iAppUi = CEikonEnv::Static()->EikAppUi();
+    if( iAppUi )
+        {
+        //add self to eat key events
+        iAppUi->AddToStackL( this, ECoeStackPriorityDialog );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CFLDCommandAbsorbingControl::OfferKeyEventL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CFLDCommandAbsorbingControl::OfferKeyEventL( const TKeyEvent& /*aKeyEvent*/,
+                                                           TEventCode /*aType*/ )
+    {
+   	return EKeyWasConsumed;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDCommandAbsorbingControl::Release()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDCommandAbsorbingControl::Release()
+	{
+	  if( iAppUi )
+        {
+        //remove self
+        iAppUi->RemoveFromStack( this );
+        }
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDCommandAbsorbingControl::MakeCbaVisible()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDCommandAbsorbingControl::MakeCbaVisible( TBool aVisible ) const
+    {
+    //position 0 --> left
+    TInt leftId( iCba->ButtonGroup()->CommandId( KLeftPosition ) );  
+    //position 2 --> right
+    TInt rightId( iCba->ButtonGroup()->CommandId( KRightPosition ) ); 
+
+    iCba->MakeCommandVisible( leftId, aVisible );
+    iCba->MakeCommandVisible( rightId, aVisible );
+
+    iCba->DrawNow();
+    }
+
+
+//  End of File
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDCommandAbsorbingControl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Command absorber to eat all key presses.
+*
+*/
+
+#ifndef __CFLDCOMMANDABSORBINGCONTROL_H
+#define __CFLDCOMMANDABSORBINGCONTROL_H
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <coecntrl.h>
+
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CEikButtonGroupContainer;
+
+// CLASS DECLARATION
+/**
+ * Command absorber.
+ *
+ * Puts empty CBA on the screen and absorbs
+ * all the key events.
+ *
+ * @lib FileList.lib
+ * @since 2.1
+ */
+NONSHARABLE_CLASS( CFLDCommandAbsorbingControl ) : public CCoeControl
+    {
+    public:
+    
+      /**
+         * Two-phased constructor.
+         */
+        static CFLDCommandAbsorbingControl* NewL();
+        
+        /**
+         * Two-phased constructor.
+         * Leaves object on the CleanupStack.
+         */
+        static CFLDCommandAbsorbingControl* NewLC();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CFLDCommandAbsorbingControl();
+
+    private:
+
+        /**
+         * Symbian OS constructor.
+         */
+        void ConstructL();
+
+
+        /**
+         * C++ default constructor.
+         */
+        CFLDCommandAbsorbingControl();
+
+    public:  // From CCoeControl
+
+       /**
+        * Absorbing OfferkeyEvent() method.
+        * Absorbs all offered key events (returns
+        * always EKeyWasConsumed).
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                     TEventCode aType );
+
+    private:  // own helpers
+
+		void Release();
+		
+       /**
+        * Alters CBA visibility.
+        *
+        * @since 2.1
+        * @param aVisible If ETrue makes buttons visible. Else
+        * makes them invisible.
+        */
+        void MakeCbaVisible( TBool aVisible ) const;
+
+    private: //data
+    
+		/// Ref: Application under what we are running
+        CEikAppUi* iAppUi;  
+        
+		 /// Ref: Used CBA button container
+        CEikButtonGroupContainer* iCba; 
+    };
+
+#endif      // __CFLDCOMMANDABSORBINGCONTROL_H
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDController.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,414 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CFLDController observes the list box and invokes a MFLDFileProcessor
+*     if the timer expires.
+*
+*
+*/
+
+
+//  CLASS HEADER
+#include "CFLDController.h"
+
+//	INTERNAL INCLUDES
+#include "MFLDFileObserver.h"
+#include "CFLDRingingTonePlayer.h"
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	#include "CFLDVideoPlayer.h"
+	#include "CFLDSoftKeyChanger.h"
+#endif
+
+//	EXTERNAL INCLUDES
+#include <bautils.h>
+#include <data_caging_path_literals.hrh>
+#include <CLFContentListing.hrh>
+#include <pathinfo.h>	// For PathInfo
+
+#include <caf/caf.h>
+#include <Oma2Agent.h>
+
+
+// CONSTANTS
+namespace
+	{
+	_LIT( KFLDResourceFileName, "FileList.RSC" );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDController::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDController* CFLDController::NewL( TBool aShowErrorMsgs,
+ TTimeIntervalMicroSeconds32 aDelay )
+    {
+    CFLDController* self = CFLDController::NewLC( aShowErrorMsgs, aDelay );
+    CleanupStack::Pop( self ); // self
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDController* CFLDController::NewLC( TBool aShowErrorMsgs,
+ TTimeIntervalMicroSeconds32 aDelay )
+    {
+    CFLDController* self = new( ELeave ) CFLDController( aShowErrorMsgs, aDelay );
+    CleanupStack::PushL( self );
+
+    self->ConstructL( );
+    return self;
+    }
+
+// Destructor
+EXPORT_C CFLDController::~CFLDController()
+    {
+    iResourceLoader.Close();
+    
+	Release();
+
+	delete iTimer;
+	delete iAudioProcessor;
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	delete iSoftKeyChanger;
+    delete iVideoProcessor;
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::Release
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDController::Release()
+	{
+	iTimer->Cancel();
+	iAudioProcessor->Cancel();
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	iVideoProcessor->Cancel();
+#endif
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDController::CFLDFileListModel
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDController::CFLDController( TBool aShowErrorMsgs,
+ TTimeIntervalMicroSeconds32 aDelay )
+    :  iDelay( aDelay ),
+    iShowErrorMsgs( aShowErrorMsgs ),
+    iResourceLoader( *( CCoeEnv::Static() ) )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDController::ConstructL()
+    {
+    TFileName* fn = new (ELeave) TFileName
+		( TParsePtrC( PathInfo::RomRootPath() ).Drive() );
+	CleanupStack::PushL( fn );
+
+	fn->Append( KDC_RESOURCE_FILES_DIR );
+	fn->Append( KFLDResourceFileName );
+	iResourceLoader.OpenL( *fn );
+	CleanupStack::PopAndDestroy( fn );
+		
+    iTimer = CPeriodic::NewL( EPriorityNormal );
+    iAudioProcessor = CFLDRingingTonePlayer::NewL( iShowErrorMsgs );
+    
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	iVideoProcessor = CFLDVideoPlayer::NewL( iShowErrorMsgs );
+    iSoftKeyChanger = CFLDSoftKeyChanger::NewL();
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::CompleteConstructionL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::CompleteConstructionL( RWindow& aWindow )
+	{
+	iWindow = &aWindow;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDController::SetDelay()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::SetDelay( TTimeIntervalMicroSeconds32 aDelay )
+    {
+    iDelay = aDelay;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CFLDController::SetVolume()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::SetVolume( TInt aVolume )
+    {
+   	iRingingVolume = aVolume;
+   	iAudioProcessor->SetVolume( iRingingVolume );
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+ 	iVideoProcessor->SetVolume( iRingingVolume );
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::SetRingingType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::SetRingingType( TInt aRingingType )
+    {
+  	iRingingType = aRingingType;
+ 	iAudioProcessor->SetRingingType( iRingingType );
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+ 	iVideoProcessor->SetRingingType( iRingingType );
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::SetVibra()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::SetVibra( TBool aVibra )
+    {
+    iVibra = aVibra;
+    iAudioProcessor->SetVibra( iVibra );
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+   	iVideoProcessor->SetVibra( iVibra );
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::SetFileObserver()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::SetFileObserver( MFLDFileObserver* aFileObserver )
+	{
+	iFileObserver = aFileObserver;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDController::Set3dEffects()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::Set3dEffects( TBool a3dEffects )
+	{
+	i3dEffects = a3dEffects;
+	iAudioProcessor->Set3dEffects( i3dEffects );
+	}
+	
+// -----------------------------------------------------------------------------
+// CFLDController::HandleSoftKeyState()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDController::HandleSoftKeyState( TFileListSoftKeyState& aSoftKeyState )
+	{
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	aSoftKeyState = iSoftKeyChanger->SoftKeyState();
+#else
+	aSoftKeyState = EToneSelectionSoftKeyState;	// Just remove compiler warnings
+#endif
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDController::HandleFileListBoxEventL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDController::HandleFileListBoxEventL( TFileListBoxEvent aEvent,
+                                                   const TDesC& aFileName )
+    {
+    iCurrentFile = aFileName;
+
+    switch( aEvent )
+    	{
+    	// User changes focus in tonelist
+    	case EFocusChanged:
+    		{
+			Release();
+#ifdef RD_VIDEO_AS_RINGING_TONE
+			iSoftKeyChanger->RestoreOldToneSelectionSoftKeysL();
+#endif
+
+    		if( iDelay >= TTimeIntervalMicroSeconds32( 0 ) )
+    			{
+    			iTimer->Start( iDelay, iDelay, TCallBack( HandleTimerTickL, this ) ); // CSI: 10 # iTimer is cancelled in Release()
+    			}
+    		break;
+    		}
+
+		// Some other key was pressed than softkeys
+    	case EOtherKeyEvent:
+    		{
+			Release();
+#ifdef RD_VIDEO_AS_RINGING_TONE
+			iSoftKeyChanger->RestoreOldToneSelectionSoftKeysL();
+#endif
+    		break;
+    		}
+
+		// User selects the video or audio as ringingtone in tonelist
+		case EListBoxClosed:
+			{
+			Release();
+
+    		if( iDelay >= TTimeIntervalMicroSeconds32( 0 ) )
+    			{
+    			iTimer->Start( iDelay, iDelay, TCallBack( HandleTimerTickL, this ) ); // CSI: 10 # iTimer is cancelled in Release()
+    			}
+    		break;
+			}
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+		// Video has been focused for 1s and preview cba is selected
+    	case EVideoPreview:
+    		{
+			Release();
+			iSoftKeyChanger->ChangeNewSoftKeysPreviewL();
+			if( iRingingType != ERingingTypeBeepOnce )
+				{
+				iVideoProcessor->ProcessFileL( iCurrentFile, iWindow );
+				}
+			else
+				{
+				// BeebOnce
+				iAudioProcessor->ProcessFileL( iCurrentFile, NULL );
+				iVideoProcessor->ProcessFileL( iCurrentFile, iWindow );
+				}
+			iSoftKeyChanger->ChangeNewSoftKeysPreviewSelectL();
+			break;
+    		}
+
+
+		// Video is running in preview window and user has selected it
+    	case EVideoPreviewSelected:
+    		{
+    		// Cleanup is done in destructor
+    		break;
+    		}
+
+		// Video is running in preview window and user has canceled it
+    	case EVideoPreviewCanceled:
+    		{
+            // Only cancel and restore softkeys if video is being previewed
+            if( iSoftKeyChanger->SoftKeyState() == EPreviewSelectSoftKeyState )
+                {
+                Release();
+                iSoftKeyChanger->RestoreOldToneSelectionSoftKeysL();
+                }
+			break;
+    		}
+#endif
+
+    	default:
+    		{
+    		break;
+    		}
+
+    	};
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDController::HandleTimerTickL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDController::HandleTimerTickL( TAny* aPtr )
+    {
+    CFLDController* controller = reinterpret_cast< CFLDController* >( aPtr );
+    controller->iTimer->Cancel();
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	TBool isVideo( EFalse );
+	if( controller->iFileObserver )
+		{
+		if( controller->iFileObserver->MediaFileType(
+		 controller->iCurrentFile ) == ECLFMediaTypeVideo )
+			{
+			isVideo = ETrue;
+			}
+		}
+
+	if( isVideo )
+		{
+		// File is video
+		// If it is OMA DRM 2 protected, it cannot be previewed in FileList (yet)
+		using namespace ContentAccess;
+	   	CContent* content = CContent::NewLC( controller->iCurrentFile,
+	   										 EContentShareReadWrite );
+	   	TInt deliveryMethod = 0;
+	   	content->GetAttribute( EDeliveryMethod, deliveryMethod );
+	   	CleanupStack::PopAndDestroy(); // content
+	   	if( deliveryMethod != EOmaDrm2 )
+	   		{
+	   		// Change softkeys for preview
+		 	controller->iSoftKeyChanger->ChangeNewSoftKeysPreviewL();
+	   		}
+		}
+	 else
+	 	{
+	 	// File is audio
+ 		if( ( controller->iFileObserver &&
+			!controller->iFileObserver->IsFileValidL(
+        	controller->iCurrentFile, MFLDFileObserver::EPlay ) ) )
+			{
+			// If there is a file observer and the file is not valid,
+			// don't call ProcessFileL.
+			return 0;
+			}
+		controller->iAudioProcessor->ProcessFileL( controller->iCurrentFile, NULL );
+	 	}
+#else
+	if( ( controller->iFileObserver &&
+		!controller->iFileObserver->IsFileValidL(
+        controller->iCurrentFile, MFLDFileObserver::EPlay ) ) )
+		{
+		// If there is a file observer and the file is not valid,
+		// don't call ProcessFileL.
+		return 0;
+		}
+	controller->iAudioProcessor->ProcessFileL( controller->iCurrentFile, NULL );
+#endif
+
+    return 0;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDDRMImplementation.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,451 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CFLDDRMImplementation.
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "CFLDDRMImplementation.h"
+
+// INTERNAL INCLUDES
+#include    "CFLDRingingTonePlayer.h" // KFLDResourceFileName
+
+// EXTERNAL INCLUDES
+#include    <DRMCommon.h>
+#include    <DRMHelper.h>
+#include    <FileList.rsg>
+#include    <MProfilesLocalFeatures.h>
+#include    <MProfileUtilitySingleton.h>
+
+#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+#include	<drmutility.h>
+#include	<drmagents.h>
+#endif
+
+// CONSTANTS
+namespace
+	{
+	_LIT( KFLDROMDriveLetter, "Z:" );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDDRMImplementation::ConstructL()
+    {
+    iProfilesFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() );
+	iDRMCommon = DRMCommon::NewL();
+	User::LeaveIfError( iDRMCommon->Connect() );
+    iDRMHelper = CDRMHelper::NewL( *CCoeEnv::Static() );
+    }
+
+// Destructor
+CFLDDRMImplementation::~CFLDDRMImplementation()
+    {
+   	delete iDRMHelper;
+	
+    if( iDRMCommon )
+    	{
+		iDRMCommon->Disconnect(); // ignore possible error
+		delete iDRMCommon;
+		}
+    ReleaseProfileUtility();
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::SetAutomatedType
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDDRMImplementation::SetAutomatedType(
+ CDRMHelper::TDRMHelperAutomatedType aAutomatedType )
+	{
+	iAutomatedType = aAutomatedType;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::IsFileValidL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CFLDDRMImplementation::IsFileValidL(
+    const TDesC& aFileName, TIntention aIntention )
+	{
+    // If the destructor is empty, return that it's valid
+    if( aFileName.Compare( KNullDesC ) == 0 )
+        {
+        return ETrue;
+        }
+
+ 	// Tone files on ROM are always valid
+   	if( ( aFileName.Left( KFLDROMDriveLetter().Length() ).CompareF(
+          KFLDROMDriveLetter ) == 0 ) )
+        {
+        return ETrue;
+        }
+
+	// Check if file is WMDRM protected
+   	TBool prot( EFalse );
+   	TRAPD( err, prot = IsFileWMDRMProtectedL( aFileName ) );
+   	if( err != KErrNone )
+   		{
+   		ShowErrorNoteL( R_FLD_QTN_FILE_FORMAT_ERROR );
+        return EFalse;
+   		}
+   	if( prot )
+   		{
+        ShowErrorNoteL( R_FLD_QTN_PROFILES_INFO_TONE_DRM_PROTECTED );
+		return EFalse;
+   		}
+
+   	ContentAccess::TVirtualPathPtr path( aFileName,
+   						ContentAccess::KDefaultContentObject );
+   	CData* data = CData::NewLC( path, EContentShareReadWrite );
+   	TInt isProtected;
+   	TInt error = data->GetAttribute( EIsProtected, isProtected );
+   	CleanupStack::PopAndDestroy(); // data
+
+    if( error != DRMCommon::EOk )
+        {
+        // DRM Helper class knows at least rights db corrupted error message.
+        // Leaves on system-wide error code.
+        iDRMHelper->HandleErrorL( error, aFileName );
+        return EFalse;
+        }
+
+	// Obtain information whether the file can be set as automated content
+	TBool canSetAutomated( EFalse );
+    TInt canSetAutomatedErr( iDRMHelper->CanSetAutomated( aFileName, canSetAutomated ) );
+
+	if( !isProtected && canSetAutomated )
+		{
+		// The file in question is not DRM protected.
+        // Return ETrue if file is also Ok unprotected, otherwise EFalse.
+        return IsFileValidUnprotectedL( aFileName, aIntention );
+		}
+	
+	// Operator requirement: Check restrictions if file is mp4 audio
+	TBuf<KMaxDataTypeLength> dataType( DataTypeL( aFileName ).Des() );
+    if( iProfilesFeatures->IsBlockedProtectedType( dataType ) )
+        {
+        ShowErrorNoteL( R_FLD_QTN_PROFILES_INFO_TONE_DRM_PROTECTED );
+        return EFalse;
+        }
+	
+	if ( canSetAutomatedErr == DRMCommon::ERightsExpired ||
+		canSetAutomatedErr == DRMCommon::ENoRights )
+		{
+		// Rights are expired, future rights or missing
+		iDRMHelper->HandleErrorL( canSetAutomatedErr, aFileName );
+		return EFalse;
+		}
+
+    // Operator requirement: Check DRM v2 tones
+	if( !canSetAutomated )
+        {
+		// This is DRM v2 file OR count based v1 tone
+	     ShowErrorNoteL( aIntention == EPlay ?
+				R_FLD_QTN_DRM_PREV_RIGHTS_USE : R_FLD_QTN_DRM_PREV_RIGHTS_SET);
+		return EFalse;
+        }
+            
+	TInt32 infoBits( 0x00000000 );
+
+	// Find out rights information	            
+	if( !CFLDDRMImplementation::GetFileInfoL(
+	 aFileName, infoBits ) )
+		{
+		// Corrupted file or "No rights" situation
+		return EFalse;
+		}
+
+	// Operator requirement: Check CFM protection
+	if ( infoBits & ENoRingingTone )
+		{
+		// This is CFM protected file, ringingtone is set to "no"
+		ShowErrorNoteL( aIntention == EPlay ?
+			R_FLD_QTN_DRM_PREV_RIGHTS_USE : R_FLD_QTN_DRM_PREV_RIGHTS_SET);
+		return EFalse;
+		}
+      
+    if( aIntention == ESelect )
+    	{
+		// Rights are good to go, and intention is selection
+    	// call SetAutomatedPassive to show 'activation query' 
+		iDRMHelper->SetAutomatedType( iAutomatedType );
+    	error = iDRMHelper->SetAutomatedPassive( aFileName );
+    	if( error != KErrCancel )
+    		{
+	       	// User accepted dialog
+        	User::LeaveIfError( error );
+        	// New way, does not require DRM capability
+        	data = CData::NewLC( path, EContentShareReadWrite );
+        	error = data->ExecuteIntent( ContentAccess::EPlay );
+        	// Wrongly requires DRM after all. According to Risto Vilkman
+        	// from DRM, KErrAccessDenied can be ignored, since if
+        	// CanSetAutomated says the tone is OK, it's OK.
+        	if ( error != KErrNone && error != KErrAccessDenied )
+        		{
+        		User::Leave( error );
+        		}
+        	CleanupStack::PopAndDestroy(); // data
+        	}
+        else
+        	{
+        	// User canceled dialog
+        	return EFalse;
+        	}
+		}
+        
+    return ETrue;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::GetFileInfo
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CFLDDRMImplementation::GetFileInfoL(
+ const TDesC& aFileName, TInt32& aInfoBits ) const
+	{
+	DRMCommon::TContentProtection contentProtection; // ignored
+	HBufC8* mimeType = NULL; // ignored
+	TUint dataLength( 0 ); // ignored
+	HBufC8* contentURI( NULL );
+	   
+	// Obtain content URI
+    TInt error = iDRMCommon->GetFileInfo(
+		aFileName, contentProtection, mimeType, contentURI, dataLength );
+    delete mimeType;
+
+    if( error != DRMCommon::EOk )
+    	{
+    	delete contentURI;
+        // Handle possible corrupt file situation
+        iDRMHelper->HandleErrorL( error, aFileName );
+        return EFalse;
+    	}
+
+	// Obtain rights object
+	CDRMRights* rights = NULL;
+    error = iDRMCommon->GetActiveRights( *contentURI, DRMCommon::EPlay, rights );
+    delete contentURI;
+
+	if( error == DRMCommon::ENoRights )
+		{
+		delete rights;
+		// There is no rights for given file
+		// Should never arrive here, ENoRights is handled
+		// already in IsFileValidL()
+   	   	iDRMHelper->HandleErrorL( error, aFileName );
+        return EFalse;
+		}
+	 
+	// Obtain infobits ( needed only for CFM case )		
+   aInfoBits = rights->GetPermission().iInfoBits;
+   delete rights;
+   return ETrue;
+   }
+
+
+// -----------------------------------------------------------------------------
+//
+// Functions related to WMDRM protection check
+//
+// -----------------------------------------------------------------------------
+
+#ifndef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+
+// Some magic constants
+static const TInt KMinContentLength( 16 );
+//_LIT8( KContentProtectionType, "DRM" );
+_LIT8( KASFHeaderObject, "75B22630668E11CFA6D900AA0062CE6C" );
+_LIT8( KWrmHeader, "W\0R\0M\0H\0E\0A\0D\0E\0R\0" );
+
+// -----------------------------------------------------------------------------
+// FormatGUID
+// -----------------------------------------------------------------------------
+//
+LOCAL_C void FormatGUID( TDes8& aGUID )
+    {
+    TBuf8<16> copyGUID( aGUID );
+    TInt i;
+    for( i = 0; i < 4; i++ )
+        {
+        copyGUID[i] = aGUID[3-i];
+        }
+    for( i = 4; i < 6; i++ )
+        {
+        copyGUID[i] = aGUID[9 - i];
+        }
+    for( i = 6; i < 8; i++ )
+        {
+        copyGUID[i] = aGUID[13 - i];
+        }
+    for( i = 8; i < 16 ; i++ )
+        {
+        copyGUID[i] = aGUID[i];
+        }
+    aGUID.Delete( 0, 32 );
+    for( i = 0; i <16; i++ )
+        {
+        aGUID.AppendNumFixedWidthUC( copyGUID[i], EHex, 2 );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// ConvertToInt64
+// -----------------------------------------------------------------------------
+//
+LOCAL_C TInt64 ConvertToInt64( TDesC8& aDes )
+    {
+    TInt64 num = 0;
+    TInt i;
+    for( i = 7 ; i >= 0; i-- )
+        {
+        num <<= 8;
+        num |= aDes[i];
+        }
+    return num;
+    }
+
+
+// -----------------------------------------------------------------------------
+// IsProtectedWmDrmL
+// returns ETrue, if file is protected WMDRM file
+//         EFalse if file is not protected WMDRM file
+// Leaves with KErrUnderflow if file has too little data to decide
+//         whether WmDrm or not
+//         may also leave with other system wide error code
+// -----------------------------------------------------------------------------
+//
+LOCAL_C TBool IsProtectedWmDrmL( RFile& aFileHandle )
+    {
+    TInt r( KErrNone );
+    HBufC8* buffer( NULL );
+    TInt pos( 0 );
+    RFile file;
+    TBuf8< 32 > header;
+
+    TInt64 headerSize( 0 );
+    TBool isProtectedWmDrm( EFalse );
+    TPtr8 headerPtr( NULL, 0 );
+
+    // Leave if given handle is invalid
+    if( !aFileHandle.SubSessionHandle() )
+        {
+        User::Leave( KErrBadHandle );
+        }
+
+    User::LeaveIfError( file.Duplicate( aFileHandle ) );
+    CleanupClosePushL( file );
+
+    User::LeaveIfError( file.Seek( ESeekStart, pos ) );
+
+    // Check if the file is an ASF file
+    // : Check on runtime wether WM DRM is supporeted or not
+
+    User::LeaveIfError( file.Read( 0, header, KMinContentLength ) );
+    if( header.Length() < KMinContentLength )
+        {
+        User::Leave( KErrUnderflow );
+        }
+
+    FormatGUID( header );
+
+    if( header == KASFHeaderObject )
+        {
+        // It's ASF, check still whether it's WM DRM protected or not
+        file.Read( header,8 );
+        headerSize = ConvertToInt64( header );
+        if( headerSize <= 30 )
+            {
+            User::Leave( KErrUnderflow );
+            }
+        if ( headerSize > ( ( KMaxTInt32 / 2 ) - 1 ) )
+            {
+            User::Leave( KErrOverflow );
+            }
+        buffer = HBufC8::NewLC( headerSize );
+
+        headerPtr.Set( buffer->Des() );
+        User::LeaveIfError( file.Read( headerPtr, headerSize - 24 ) );
+
+        r = headerPtr.Find( KWrmHeader );
+        if ( KErrNotFound != r )
+            {
+            isProtectedWmDrm = ETrue;
+            }
+        CleanupStack::PopAndDestroy( buffer ); // buffer
+        }
+        CleanupStack::PopAndDestroy(); // file
+
+    return isProtectedWmDrm;
+    }
+
+#endif // RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::IsFileWMDRMProtectedL
+// -----------------------------------------------------------------------------
+//
+TBool CFLDDRMImplementation::IsFileWMDRMProtectedL( const TDesC& aFileName ) const
+	{
+	TBool res = EFalse;
+	RFs& fsSession( CCoeEnv::Static()->FsSession() );
+	RFile hFile;
+
+	TInt err = hFile.Open( fsSession, aFileName, 
+						EFileRead | EFileStream | EFileShareReadersOnly );
+	if( err == KErrInUse )
+		{
+		err = hFile.Open( fsSession, aFileName, 
+						EFileRead | EFileStream | EFileShareAny );
+		}
+	if( err != KErrNone )
+		{
+		User::Leave( err );
+		}
+	CleanupClosePushL( hFile );
+
+#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+	TPtrC agent( KNullDesC );
+	DRM::CDrmUtility* drmUtil( DRM::CDrmUtility::NewLC() );
+	drmUtil->GetAgentL( hFile, agent );
+	if( agent.Compare( DRM::KDrmWMAgentName ) == 0 )
+		{
+		res = ETrue;
+		}
+	CleanupStack::PopAndDestroy( drmUtil );
+#else
+	res = IsProtectedWmDrmL( hFile );
+#endif
+
+	CleanupStack::PopAndDestroy( &hFile );
+	return res;
+	}
+
+// -----------------------------------------------------------------------------
+//
+// End of Functions related to WMDRM protection check
+//
+// -----------------------------------------------------------------------------
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDDRMImplementation.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation for DRM functionality.
+*
+*/
+
+
+
+#ifndef CFLDDRMIMPLEMENTATION_H
+#define CFLDDRMIMPLEMENTATION_H
+
+// INTERNAL INCLUDES
+#include "MFLDFileObserver.h"
+
+// EXTERNAL
+#include <e32base.h>
+#include <apmstd.h> // KMaxDataTypeLength
+#include <data_caging_path_literals.hrh>
+#include <centralrepository.h>
+#include <DRMHelper.h>	// For TDRMHelperAutomatedType
+#include <DRMRights.h>	// For TRestriction
+
+// FORWARD DECLARATIONS
+class DRMCommon;
+class CDRMHelper;
+class CFLDFileListModel;
+class MProfilesLocalFeatures;
+
+// CLASS DECLARATION
+
+/**
+*  Implementation for DRM functionality.
+*
+*  @lib filelist.lib
+*  @since 2.1
+*/
+NONSHARABLE_CLASS( CFLDDRMImplementation ) : public CBase, public MFLDFileObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CFLDDRMImplementation* NewL( CFLDFileListModel* aModel );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CFLDDRMImplementation();
+
+    public: // Functions from base classes
+
+        /**
+        * From MFLDFileObserver.
+        */
+		TBool IsFileValidL( const TDesC& aFileName, TIntention aIntention );
+
+		/**
+		* From MFLDFileObserver.
+		*/
+		TInt32 MediaFileType( const TDesC& aFileName ) const;
+
+	public:	// New functions
+
+		/**
+        * Set the automated content type
+        * @param  aAutomatedType: type of automated content
+        */
+        void SetAutomatedType(
+         CDRMHelper::TDRMHelperAutomatedType aAutomatedType );
+
+
+    private: // New functions
+
+        /**
+        * Displays an error note.
+        * @since 2.1
+        * @param @aResourceId Resource ID for a TBUF resource containing the error text.
+        */
+        void ShowErrorNoteL( TInt aResourceId ) const;
+
+        /**
+        * Checks if an unprotected file is valid.
+        * @param aFileName Full path and filename.
+        * @param aIntention Describes what is the file used for.
+        * @return Returns ETrue if the file is valid for intended use.
+        */
+        TBool IsFileValidUnprotectedL(
+            const TDesC& aFileName, TIntention aIntention ) const;
+
+		/**
+		* Returns info whether demoplay is allowed for given filetype
+		* @param aDataType Tone MIME type
+		* @return ETrue if tone allowed to be played
+		*/
+		TBool AllowDemoPlay( const TDesC& aDataType ) const;
+
+		/**
+		* Returns info whether given filetype is allowed as ringingtone
+		* @param aDataType Tone MIME type
+		* @return ETrue if tone is allowed to be selected
+		*/
+		TBool AllowSelect( const TDesC& aDataType ) const;
+
+		/**
+		* Finds out the MIME type of a given file
+		* @param aFileName File to be checked
+		* @return Returns datatype of a file
+		*/
+		TDataType DataTypeL( const TDesC& aFileName ) const;
+		
+		/**
+		* Finds out DRM restrictions for a given file
+		* @param aFileName File to be checked
+		* @param aInfoBits(out) Determines CFM protection
+		* @return Returns EFalse if file is corrupted or has no rights
+		*/
+		TBool GetFileInfoL( const TDesC& aFileName,
+		 TInt32& aInfoBits ) const;
+
+		/**
+         * Checks if file is WMDRM protected.
+         * @param aFileName Name of the file to be checked.
+         * @return ETrue if file is WMDRM protected, EFalse otherwise.
+         */
+		TBool	IsFileWMDRMProtectedL( const TDesC& aFileName ) const;
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CFLDDRMImplementation( CFLDFileListModel* aModel );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        /// Own: DRM common functions
+        DRMCommon* iDRMCommon;
+
+        /// Own: DRM helper
+        CDRMHelper* iDRMHelper;
+
+        /// Not owned: FileList model
+        CFLDFileListModel* iModel;
+
+        /// Automated content type
+        CDRMHelper::TDRMHelperAutomatedType iAutomatedType;
+
+        /// Not owned: Profiles local features
+        MProfilesLocalFeatures* iProfilesFeatures;
+    };
+
+#endif      // CFLDDRMIMPLEMENTATION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDDRMImplementationCommon.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CFLDDRMImplementation.
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "CFLDDRMImplementation.h"
+
+// INTERNAL INCLUDES
+#include    "CFLDRingingTonePlayer.h"
+#include	"CFLDFileListModel.h"
+
+// EXTERNAL INCLUDES
+#include    <aknnotewrappers.h>
+#include	<StringLoader.h>
+#include    <FileList.rsg>
+#include    <MProfilesLocalFeatures.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::CFLDDRMImplementation
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDDRMImplementation::CFLDDRMImplementation( CFLDFileListModel* aModel )
+	: iModel( aModel ),
+	iAutomatedType( CDRMHelper::EAutomatedTypeRingingTone )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDDRMImplementation* CFLDDRMImplementation::NewL( CFLDFileListModel* aModel )
+    {
+    CFLDDRMImplementation* self = new( ELeave ) CFLDDRMImplementation( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::ShowErrorNoteL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDDRMImplementation::ShowErrorNoteL( TInt aResourceId ) const
+    {
+    HBufC* errorText = StringLoader::LoadLC( aResourceId );
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( EFalse );
+
+    note->ExecuteLD( *errorText );
+
+	// errorText
+	CleanupStack::PopAndDestroy( errorText );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::IsFileValidUnprotectedL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CFLDDRMImplementation::IsFileValidUnprotectedL(
+    const TDesC& aFileName, TIntention aIntention ) const
+    {
+	TBuf<KMaxDataTypeLength> tempDataType( DataTypeL( aFileName ).Des() );
+
+    if( iProfilesFeatures->IsBlockedType( tempDataType ) )
+        {
+        if( aIntention == ESelect )
+            {
+            ShowErrorNoteL( R_FLD_QTN_TEXT_NOT_ALLOWED );
+            }
+    	return EFalse;
+        }
+
+    // Operator requirement. Check if DRM is required with tones.
+	if( aIntention == EPlay )
+		{
+        if( iProfilesFeatures->IsBlockedDemoPlayType( tempDataType ) )
+            {
+			return EFalse;
+            }
+        }
+    else
+        {
+        if( iProfilesFeatures->IsBlockedUnprotectedType( tempDataType ) )
+            {
+			ShowErrorNoteL( R_FLD_QTN_PROFILES_INFO_TONE_NO_DRM );
+			return EFalse;
+            }
+        }
+
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::DataTypeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TDataType CFLDDRMImplementation::DataTypeL(
+    const TDesC& aFileName ) const
+    {
+    RApaLsSession apaLsSession;
+    User::LeaveIfError( apaLsSession.Connect() );
+    CleanupClosePushL( apaLsSession );
+
+    TUid dummyUid = { 0 }; // instantiate as zero
+    TDataType dataType( dummyUid );
+    User::LeaveIfError(
+        apaLsSession.AppForDocument( aFileName, dummyUid, dataType ) );
+
+    CleanupStack::PopAndDestroy(); // apaLsSession.Close()
+	return dataType;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::MediaFileType
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt32 CFLDDRMImplementation::MediaFileType( const TDesC& aFileName ) const
+	{
+	return iModel->MediaFileType( aFileName );
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDDRMImplementationEmpty.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CFLDDRMImplementation.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CFLDDRMImplementation.h"
+
+#include    <DRMCommon.h>
+#include    <e32svr.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::ConstructL
+// Empty implementation
+// -----------------------------------------------------------------------------
+//
+void CFLDDRMImplementation::ConstructL()
+    {
+	iDRMCommon = DRMCommon::NewL();
+	User::LeaveIfError( iDRMCommon->Connect() );
+    }
+    
+// Destructor
+CFLDDRMImplementation::~CFLDDRMImplementation()
+    {
+	if( iDRMCommon )
+		{
+		iDRMCommon->Disconnect(); // ignore possible error
+		delete iDRMCommon;
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDDRMImplementation::IsFileValidL
+// Empty implementation
+// -----------------------------------------------------------------------------
+//
+TBool CFLDDRMImplementation::IsFileValidL(
+    const TDesC& aFileName, TIntention aIntention )
+	{
+	TBool isValidUnprotected( ETrue );
+
+    if( aFileName.Compare( KNullDesC ) != 0 )
+		{
+		TBool isProtected( EFalse );
+		iDRMCommon->IsProtectedFile( aFileName, isProtected );
+		if( !isProtected )
+			{
+			// The file in question is not a DCF file.
+			// Return ETrue if file is also Ok unprotected, otherwise EFalse.
+			isValidUnprotected =
+				IsFileValidUnprotectedL( aFileName, aIntention );
+			}
+		}
+
+    return isValidUnprotected;
+	}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDEntryReference.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     A simple container class that is used to reference a single
+*     entry in the file list.
+*
+*
+*/
+
+
+// CLASS HEADER
+#include    "CFLDEntryReference.h"
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Constructor
+CFLDEntryReference::CFLDEntryReference()
+    {
+    }
+    
+// Destructor
+CFLDEntryReference::~CFLDEntryReference()
+    {
+    delete iFormattedPresentation;
+    delete iPathAndMediaFileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDEntryReference::FormattedPresentation()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+HBufC& CFLDEntryReference::FormattedPresentation() const
+	{
+	return *iFormattedPresentation;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDEntryReference::PathAndMediaFileName()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+HBufC& CFLDEntryReference::PathAndMediaFileName() const
+	{
+	return *iPathAndMediaFileName;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDEntryReference::MediaType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//	
+TInt32 CFLDEntryReference::MediaType() const
+	{
+	return iMediaType;
+	}	
+
+// -----------------------------------------------------------------------------
+// CFLDEntryReference::SetPathAndMediaFileName()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDEntryReference::SetPathAndMediaFileName( HBufC* aPathAndMediaFileName ) // CSI: 60 # ownership is transferred
+	{
+	delete iPathAndMediaFileName;
+	iPathAndMediaFileName = NULL;
+	
+	iPathAndMediaFileName = aPathAndMediaFileName;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetAutomatedType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDEntryReference::SetFormattedPresentation( HBufC* aFormattedPresentation ) // CSI: 60 # ownership is transferred
+	{
+	delete iFormattedPresentation;
+	iFormattedPresentation = NULL;
+	
+	iFormattedPresentation = aFormattedPresentation;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDEntryReference::SetMediaType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//	
+void CFLDEntryReference::SetMediaType( TInt32 aMediaType )
+	{
+	iMediaType = aMediaType;
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDEntryReference.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     A simple container class that is used to reference a single
+*     entry in the file list.
+*
+*
+*/
+
+
+#ifndef __CFLDENTRYREFERENCE_H
+#define __CFLDENTRYREFERENCE_H
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <CLFContentListing.hrh>
+
+// CLASS DECLARATION
+
+/**
+* A simple container class that is used to reference a single
+* entry in the file list.
+* 
+* @lib filelist.lib
+* @since 2.1
+*/
+NONSHARABLE_CLASS( CFLDEntryReference ): public CBase
+    {
+    public:
+    	
+    	/**
+    	* Constructor
+    	* @param aDirectory Pointer to directory
+    	*/
+    	CFLDEntryReference();
+    
+        /**
+        * Destructor
+        */
+        virtual ~CFLDEntryReference();
+
+    public:	// New functions
+    
+    	/**
+        * Sets media type
+        * @param aMediaType Media type
+        */
+    	void SetMediaType( TInt32 aMediaType );
+    
+    	/**
+        * Sets path and filename
+        * @param aPathAndMediaFileName Path and filename, ownership transferred
+        */
+	    void SetPathAndMediaFileName( HBufC* aPathAndMediaFileName );
+	    
+	    /**
+        * Sets formatted presentation
+        * @param aFormattedPresentation Formatted presentation, ownership
+        *        transferred
+        */
+	    void SetFormattedPresentation( HBufC* aFormattedPresentation );
+
+		/**
+        * Gets formatted presentation
+        * @return Reference to formatted presentation
+        */
+    	HBufC& FormattedPresentation() const;
+
+		/**
+        * Gets path and filename
+        * @return Reference to path and filename
+        */
+    	HBufC& PathAndMediaFileName() const;
+    	
+    	/**
+        * Gets Media type
+        * @return Media type
+        */
+    	TInt32 MediaType() const;
+    
+    private:	// Data
+    
+    	/// Own: Listbox formatted data
+		/// However, not created by CFLDEntryReference
+        HBufC* iPathAndMediaFileName;
+        
+        /// Own: Listbox formatted data
+		/// However, not created by CFLDEntryReference
+        HBufC* iFormattedPresentation;
+        
+        /// Media type
+        TInt32 iMediaType;
+
+    };
+
+#endif      // __CFLDENTRYREFERENCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDFileListContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,513 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     A wrapper class, which is part of an example implementation of tone
+*     selection list. It owns the list box, the model, and the controller,
+*     and it is used to launch the popup list.
+*     If you need to use a different list box style or a different file,
+*     processor replace this class with your own container.
+*
+*
+*/
+
+
+// CLASS HEADER
+#include "CFLDFileListContainer.h"
+
+// INTERNAL INCLUDES
+#include "CFLDPopupList.h"
+#include "CFLDDRMImplementation.h"
+#include "CFLDBrowserLauncher.h"
+#include "CFLDSingleGraphicEntryFormatter.h"
+#include "FLDListBoxTemplate.h"
+#include "CFLDController.h"
+#include "CFLDFileListModel.h"
+
+// EXTERNAL INCLUDES
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+#include <FileList.rsg>
+#include <featmgr.h>
+#include <pathinfo.h>
+#include <centralrepository.h>
+#include <ProfileEngineInternalCRKeys.h> // Profiles engine internal Central Repository keys
+#include <aknlists.h>
+
+// CONSTANTS
+namespace
+	{
+	// MIME types
+	_LIT( KFLDAMRMimeType, "audio/amr" );
+#ifndef __WMA
+	_LIT( KFLDAudioWMA, "audio/x-ms-wma" );
+#endif
+
+    _LIT( KFLDResourceFileName, "FileList.RSC" );
+
+	// Default delay 1000000 = 1sec
+	const TInt KDefaultDelay( 1000000 );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewL()
+    {
+    CFLDFileListContainer* self = CFLDFileListContainer::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewLC()
+    {
+    CFLDFileListContainer* self =
+        new( ELeave ) CFLDFileListContainer();
+    CleanupStack::PushL( self );
+    self->ConstructL( R_FLD_LIST_MODEL, R_FLD_DIRECTORIES );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewL(
+    const TInt aResourceId )
+    {
+    CFLDFileListContainer* self = CFLDFileListContainer::NewLC(
+        aResourceId, R_FLD_DIRECTORIES );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewLC(
+    const TInt aResourceId )
+    {
+    CFLDFileListContainer* self =
+        new( ELeave ) CFLDFileListContainer();
+    CleanupStack::PushL( self );
+    self->ConstructL( aResourceId, R_FLD_DIRECTORIES );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewL(
+    const TInt aResourceId, const TInt aDirectoriesResourceId )
+    {
+    CFLDFileListContainer* self = CFLDFileListContainer::NewLC(
+        aResourceId, aDirectoriesResourceId );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewLC(
+    const TInt aResourceId, const TInt aDirectoriesResourceId )
+    {
+    CFLDFileListContainer* self =
+        new( ELeave ) CFLDFileListContainer();
+    CleanupStack::PushL( self );
+    self->ConstructL( aResourceId, aDirectoriesResourceId );
+    return self;
+    }
+    
+// Destructor
+EXPORT_C CFLDFileListContainer::~CFLDFileListContainer()
+    {
+    iResourceLoader.Close();
+    
+    delete iDRMImplementation;
+    delete iModel;
+    delete iController;
+    FeatureManager::UnInitializeLib();
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::CFLDFileListContainer
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDFileListContainer::CFLDFileListContainer()
+	: iResourceLoader( *( CCoeEnv::Static() ) )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListContainer::ConstructL(
+ const TInt aResourceId, const TInt aDirectoriesResourceId )
+    {
+    // Open Filelist default resource
+	TFileName* fn = new (ELeave) TFileName
+		( TParsePtrC( PathInfo::RomRootPath() ).Drive() );
+	CleanupStack::PushL( fn );
+
+	fn->Append( KDC_RESOURCE_FILES_DIR );
+	fn->Append( KFLDResourceFileName );
+	iResourceLoader.OpenL( *fn );
+	CleanupStack::PopAndDestroy( fn );
+
+    iModel = CFLDFileListModel::NewL( aResourceId, aDirectoriesResourceId );
+    CFLDSingleGraphicEntryFormatter* entryFormatter =
+    	new ( ELeave ) CFLDSingleGraphicEntryFormatter();
+    iModel->SetEntryFormatter( entryFormatter );
+
+	// Add 'download tones' item to model
+    FeatureManager::InitializeLibL();
+ 	if( FeatureManager::FeatureSupported( KFeatureIdSeamlessLinks ) )
+        {
+        // Load 'download tones' text and format it
+		HBufC* text = StringLoader::LoadLC(
+			R_FLD_QTN_PROFILES_DOWNLOAD_TONES );
+		_LIT( KIconIndexAndTab, "1\t" );
+        HBufC* newText =
+            text->ReAllocL( text->Length() + KIconIndexAndTab().Length() );
+        CleanupStack::Pop( text );
+        CleanupStack::PushL( newText );
+        TPtr des( newText->Des() );
+        des.Insert( 0, KIconIndexAndTab );
+		// Insert formatted 'download tones' text to model
+        iModel->InsertNullItemL( des, KNullDesC );
+        CleanupStack::PopAndDestroy( newText );
+        }
+
+	iDRMImplementation = CFLDDRMImplementation::NewL( iModel );
+
+	TBool showErrorMsgs( ETrue );
+    iController = CFLDController::NewL( showErrorMsgs, KDefaultDelay );
+ 	iController->SetFileObserver( iDRMImplementation );
+
+	// Following implementation enables disabling recordable ringing tones.
+	TInt recEnable( 0 );
+	CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+    CleanupStack::PushL( cenrep );
+    User::LeaveIfError( cenrep->Get( KProEngRecordedRingingTones, recEnable ) );
+    CleanupStack::PopAndDestroy( cenrep );
+
+    if( !recEnable )
+        {
+        // Recorded tones as ringing tones should be disabled.
+        // Exclude AMR files.
+        iModel->AddExclusiveMimeTypeL( KFLDAMRMimeType );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetAutomatedType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetAutomatedType(
+ CDRMHelper::TDRMHelperAutomatedType aAutomatedType )
+	{
+	iDRMImplementation->SetAutomatedType( aAutomatedType );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::LaunchL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CFLDFileListContainer::LaunchL( TDes& aFileName, const TDesC& aPopupTitle )
+    {
+    // Update the list
+	iModel->RefreshEntryListL();
+
+    CEikFormattedCellListBox* listBox = NULL;
+        listBox = new( ELeave ) FLDListBoxTemplate
+        	<CAknSingleGraphicBtPopupMenuStyleListBox>( *iController, *iModel );
+    CleanupStack::PushL( listBox );
+
+    // Create the popup list
+    CFLDPopupList* popup = CFLDPopupList::NewL( listBox,
+        R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT,
+        *iDRMImplementation, iController,
+        *iModel, AknPopupLayouts::EMenuGraphicWindow );
+    // EMenuGraphicWindow for CAknSingleGraphicBtPopupMenuStyleListBox
+    CleanupStack::PushL( popup );
+
+	static_cast<FLDListBoxTemplate
+		 <CAknSingleGraphicBtPopupMenuStyleListBox> *>( listBox )
+		 ->SetListBox( popup );
+
+	// Video player can be fully constructed only when popup list
+	// is constructed
+	iController->CompleteConstructionL( popup->PopupListWindow() );
+
+	// Set popup to Model
+	iModel->SetPopupList( popup );
+
+    popup->SetTitleL( aPopupTitle );
+
+    listBox->ConstructL( popup,
+        EAknListBoxSelectionList | EAknListBoxLoopScrolling );
+
+    // Create the scroll indicator
+    listBox->CreateScrollBarFrameL( ETrue );
+    listBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+
+    // Set the listbox to use the the file list model
+    listBox->Model()->SetItemTextArray( iModel );
+    listBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+    // Refresh the listbox due to model change
+    listBox->HandleItemAdditionL();
+
+	popup->PopulateIconArrayL();
+
+    // If a filename was given, set focus on it
+    if ( aFileName != KNullDesC )
+        {
+        TInt index = iModel->FindFileL( aFileName );
+        if ( index != KErrNotFound )
+            {
+            listBox->SetCurrentItemIndex( index );
+            }
+        }
+
+    TBool result = popup->ExecuteLD();
+	// Note, CAknPopupList must NOT be popped out
+	// before ExecuteLD (like dialogs do) but after.
+    CleanupStack::Pop( popup );
+
+	// Reset popup pointer
+	iModel->SetPopupList( NULL );
+
+    if ( result )
+        {
+        TInt selectedIndex( listBox->CurrentItemIndex() );
+
+		// Check if the selected item is 'Download tones' or regular ringingtone
+		TFileName selectedFileName( KNullDesC );
+		iModel->GetFileName( selectedFileName, selectedIndex );
+
+        // If there is such a model that has no 'Download tones' item but
+        // seamless links are supported, we have to check that selectedFileName
+        // is really ringingtone (it is not a null item)
+        if( selectedIndex == 0 &&
+            FeatureManager::FeatureSupported( KFeatureIdSeamlessLinks ) &&
+            selectedFileName.Length() == 0 )
+            {
+            // User selected the first item "Download tones". Launch browser.
+            CFLDBrowserLauncher* launcher = CFLDBrowserLauncher::NewLC();
+            launcher->LaunchBrowserL();
+            CleanupStack::PopAndDestroy(); // launcher
+            result = EFalse; // No tone was selected
+            }
+        else
+            {
+            // Any other choice. Copy selected file name to aFileName.
+            iModel->GetFileName( aFileName, selectedIndex );
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // listBox
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::InsertNullItemL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::InsertNullItemL(
+ const TDesC& aItemText )
+    {
+    iModel->InsertNullItemL( aItemText );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::InsertNullItemL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::InsertNullItemL(
+ const TDesC& aItemText, const TDesC& aFileName )
+    {
+    iModel->InsertNullItemL( aItemText, aFileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::InsertEndNullItemL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::InsertEndNullItemL(
+ const TDesC& aItemText )
+    {
+    iModel->InsertEndNullItemL( aItemText );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::InsertEndNullItemL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::InsertEndNullItemL(
+ const TDesC& aItemText, const TDesC& aFileName )
+    {
+    iModel->InsertEndNullItemL( aItemText, aFileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetDelay()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetDelay( TTimeIntervalMicroSeconds32 aDelay )
+    {
+    iController->SetDelay( aDelay );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetVolume()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetVolume( TInt aVolume )
+    {
+    iController->SetVolume( aVolume );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetRingingType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetRingingType( TInt aRingingType )
+    {
+    iController->SetRingingType( aRingingType );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetVibra()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetVibra( TBool aVibra )
+    {
+    iController->SetVibra( aVibra );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::Set3dEffects()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+EXPORT_C void CFLDFileListContainer::Set3dEffects( TBool a3dEffects )
+	{
+	iController->Set3dEffects( a3dEffects );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::AddExclusiveMimeTypeL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::AddExclusiveMimeTypeL( const TDesC& aMimeType )
+	{
+	iModel->AddExclusiveMimeTypeL( aMimeType );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::AddExclusiveMediaTypeL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::AddExclusiveMediaTypeL( const TInt32 aMediaType )
+	{
+	iModel->AddExclusiveMediaTypeL( aMediaType );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetWantedMimeTypesL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetWantedMimeTypesL( const MDesCArray& aMimeTypes )
+	{
+	iModel->SetWantedMimeTypesL( aMimeTypes );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetWantedMediaTypesL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetWantedMediaTypesL( const TArray<TCLFMediaType>& aMediaTypes )
+	{
+	iModel->SetWantedMediaTypesL( aMediaTypes );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetWantedMimeTypesL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::ResetExclusiveMimeTypes()
+	{
+	iModel->ResetExclusiveMimeTypes();
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetWantedMimeTypesL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::ResetExclusiveMediaTypes()
+	{
+	iModel->ResetExclusiveMediaTypes();
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListContainer::SetMaxFileSize()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CFLDFileListContainer::SetMaxFileSize( const TInt aMaxFileSize )
+    {
+    iModel->SetMaxFileSize( aMaxFileSize );
+    }	
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDFileListModel.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1036 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*      This class implements a model of a file list. Features:
+*      - Contents of multiple folders in the same list
+*      - Filtering with wildcards (*?)
+*      - Filtering by maximum file size
+*      - Sorting (name / date, ascending / descending)
+*      - Entry presentation formatting using an abstract interface
+*     The class is inherited from MDesCArray, so it can be used directly
+*     as a model for a listbox.
+*
+*
+*/
+
+
+// CLASS HEADER
+#include "CFLDFileListModel.h"
+
+// INTERNAL INCLUDES
+#include "CFLDOperationObserver.h"
+#include "CFLDChangedItemObserver.h"
+#include "CFLDEntryReference.h"
+#include "CFLDWaitNote.h"
+#include "CFLDPopupList.h"
+#include "MFLDEntryFormatter.h"
+
+// EXTERNAL INCLUDES
+#include <MCLFContentListingEngine.h>
+#include <MCLFItem.h>
+#include <MCLFItemListModel.h>
+#include <MCLFModifiableItem.h>
+#include <ContentListingFactory.h>
+#include <CLFContentListing.hrh>
+#include <barsread.h>	// For TResourceReader
+#include <ConeResLoader.h>	// For RConeResourceLoader
+#include <coemain.h>	// CCoeEnv
+#include <pathinfo.h>
+#include <data_caging_path_literals.hrh>	// For KDC_RESOURCE_FILES_DIR
+#include <FileList.rsg>	// For R_FLD_WAIT_NOTE
+#include <bautils.h>	// For BaflUtils
+#include <apgcli.h>	// For RApaLsSession
+#include <aknnotewrappers.h>
+#include <StringLoader.h>
+
+// CONSTANTS
+namespace
+	{
+	_LIT( KFLDROMDriveLetter, "Z:" );
+	const TInt KGranularityFilters( 2 );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+ CFLDFileListModel* CFLDFileListModel::NewL(
+  const TInt aModelResourceId, const TInt aDirectoriesResourceId )
+    {
+    // The default stuff.
+    CFLDFileListModel* self =
+     CFLDFileListModel::NewLC( aModelResourceId, aDirectoriesResourceId );
+    CleanupStack::Pop( self ); // self
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDFileListModel* CFLDFileListModel::NewLC(
+ const TInt aModelResourceId, const TInt aDirectoriesResourceId )
+    {
+    CFLDFileListModel* self =
+        new( ELeave ) CFLDFileListModel();
+    CleanupStack::PushL( self );
+    self->ConstructL( aModelResourceId, aDirectoriesResourceId );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::CFLDFileListModel
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDFileListModel::CFLDFileListModel()
+	: iExclusiveMimeTypes( KGranularityFilters ),
+	iExclusiveMediaTypes( KGranularityFilters ),
+	iDirectoryPaths( KGranularityFilters ),
+	iRomDirectoryPaths( KGranularityFilters ),
+	iMaxFileSize( 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::ConstructL(
+ const TInt aModelResourceId, const TInt aDirectoriesResourceId )
+    {
+	// Create CLF Operation Observer to monitor, when
+    // refresh operation has completed
+    iObserver = CFLDOperationObserver::NewL();
+     
+    // Create Content Listing Engine and a list model
+    iEngine = ContentListingFactory::NewContentListingEngineLC();
+    CleanupStack::Pop(); // iEngine
+
+	// Load CLF definitions from user given resource
+    TResourceReader reader;
+	CCoeEnv::Static()->CreateResourceReaderLC( reader, aModelResourceId );
+    iModel = iEngine->CreateListModelLC( *iObserver, reader );
+    CleanupStack::Pop(); // iModel
+   	CleanupStack::PopAndDestroy();  // reader
+
+    // Load wait note from default-resource
+    iWaitNote = CFLDWaitNote::NewL( R_FLD_WAIT_NOTE );
+    
+	// Load directories
+	CFLDFileListModel::LoadDirectoriesL( aDirectoriesResourceId );
+	
+	// Create changed item observer to monitor, when
+    // tone selection files are modified or deleted
+    iChangedItemObserver = CFLDChangedItemObserver::NewL(iWaitNote);
+	iEngine->AddChangedItemObserverL( *iChangedItemObserver );
+
+	// Set post filter	
+	iModel->SetPostFilter( this );
+    }
+
+// Destructor
+ CFLDFileListModel::~CFLDFileListModel()
+    {
+     if( iModel )
+        {
+        iModel->CancelRefresh();
+        delete iModel;
+        }
+
+    delete iEngine;
+    delete iObserver;
+    delete iChangedItemObserver;
+    delete iEntryFormatter;
+	delete iWaitNote;
+
+    iEndNullTextRingingToneArray.ResetAndDestroy();
+    iEndNullTextArray.ResetAndDestroy();
+    iNullTextRingingToneArray.ResetAndDestroy();
+    iNullTextArray.ResetAndDestroy();
+    iEntryReferences.ResetAndDestroy();
+    iExclusiveMimeTypes.Reset();
+    iExclusiveMediaTypes.Reset();
+   	iDirectoryPaths.Reset();
+   	iRomDirectoryPaths.Reset();
+    iRomRingingToneArray.ResetAndDestroy();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::LoadRomDirectoriesL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::LoadDirectoriesL( const TInt aDirectoriesResourceId )	
+	 {
+	 TResourceReader reader;
+  	 CCoeEnv::Static()->CreateResourceReaderLC( reader, aDirectoriesResourceId );
+	 
+	 // Read ROM directories from resource
+	 TInt count( reader.ReadInt16() );
+	 while( --count >= 0 )
+     	{
+        TPtrC ptr( reader.ReadTPtrC() );
+		// Ignore return value
+        AddRomDirectoryL( ptr );
+        }
+        
+     // Read directories from resource
+	 count = reader.ReadInt16();
+	 while( --count >= 0 )
+     	{
+        TPtrC ptr( reader.ReadTPtrC() );
+		// Ignore return value
+        AddDirectoryL( ptr );
+        }
+        
+  	 CleanupStack::PopAndDestroy();  // reader
+	 }
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::AddRomDirectoryL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ TInt CFLDFileListModel::AddRomDirectoryL( const TDesC& aDirectory )
+    {
+    TInt index( 0 );
+	if( iRomDirectoryPaths.Find( aDirectory, index ) == 0 )
+		{
+        // A duplicate was found, do not add to the array, return.
+		return KErrAlreadyExists;
+		}
+
+	RFs& fsSession( CCoeEnv::Static()->FsSession() );
+    // Check that the directory really exists
+    if ( !BaflUtils::FolderExists( fsSession, aDirectory ) )
+        {
+        return KErrPathNotFound;
+        }
+    iRomDirectoryPaths.AppendL( aDirectory );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::AddDirectoryL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ TInt CFLDFileListModel::AddDirectoryL( const TDesC& aDirectory )
+    {
+    TInt index( 0 );
+	if( iDirectoryPaths.Find( aDirectory, index ) == 0 )
+		{
+        // A duplicate was found, do not add to the array, return.
+		return KErrAlreadyExists;
+		}
+
+    iDirectoryPaths.AppendL( aDirectory );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::SetWantedMimeTypesL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::SetWantedMimeTypesL( const MDesCArray& aMimeTypes )
+	{
+	CFLDFileListModel::ResetExclusiveMimeTypes();
+	CFLDFileListModel::ResetExclusiveMediaTypes();
+
+	iModel->SetWantedMimeTypesL( aMimeTypes );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::SetWantedMediaTypesL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::SetWantedMediaTypesL(
+ const TArray<TCLFMediaType>& aMediaTypes )
+	{
+	CFLDFileListModel::ResetExclusiveMimeTypes();
+	CFLDFileListModel::ResetExclusiveMediaTypes();
+
+	// Temporary solution
+	RArray<TInt> array;
+	TInt count( aMediaTypes.Count() );
+    CleanupClosePushL( array );
+	for( TInt i = 0; i < count; i++ )
+		{
+		array.AppendL( aMediaTypes[i]);
+		}
+
+    iModel->SetWantedMediaTypesL( array.Array() );
+    CleanupStack::PopAndDestroy( &array );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::PopulateReferenceListL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::PopulateReferenceListL()
+    {
+    // Do not allow to update model from changed item observer
+    iChangedItemObserver->SetFileListModel( NULL );
+    
+    // Send reference of CActiveSchedulerWait to the CLF Operation Observer
+    iObserver->PrepareForRefresh( iWait );
+
+    // CLF hogs the processor when doing its refresh. Make sure we'll
+    // have enough of a slice to be able to handle the End key presses.
+    RWsSession& wsSession = CCoeEnv::Static()->WsSession();
+    wsSession.ComputeMode( RWsSession::EPriorityControlDisabled );
+
+    // Call refresh to get all music files from the file system to the model
+    iModel->RefreshL();
+
+	// Display a wait note if user tries to do something while refresh
+	// operation of the list model has not finished yet.
+    if( iObserver->IsRefreshOngoing() && !iWait.IsStarted() )
+        {
+        // View the wait note
+        if( iWaitNote && !iWaitNote->IsRunning() )
+        	{
+        	 iWaitNote->OpenWaitNoteL();
+        	}
+       
+   	    // Wait for the refresh operation to complete. Operation Observer will
+       	// stop this wait when the refresh operation has compeleted.
+       	iWait.Start(); // CSI: 10 # the state of iWait is checked above
+
+        // Close the wait note
+        iWaitNote->CloseWaitNoteL();
+        }
+
+    // Back to default behavior
+    wsSession.ComputeMode( RWsSession::EPriorityControlComputeOff );
+
+	PopulateListBoxL();
+		
+	if( iPopupList )
+		{ // Model has updated; list should try to handle it
+		iPopupList->CancelPreview();
+		TRAP_IGNORE( iPopupList->ListBox()->HandleItemAdditionL() );
+		// List has updated; set focus to the first item
+		iPopupList->ListBox()->SetCurrentItemIndexAndDraw( 0 );
+		}
+
+	// Allow to update model from changed item observer
+	// (unless we're displaying ROM tones only)
+	if( !iRomTonesOnly )
+		{
+		iChangedItemObserver->SetFileListModel( this );
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::ScanRomDirectoriesL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::ScanRomDirectoriesL()
+	{
+	CDir* fileList( NULL );
+	RFs& fsSession( CCoeEnv::Static()->FsSession() );
+	
+	TInt directoryCount( iRomDirectoryPaths.Count() );
+	for( TInt i= 0; i<directoryCount; i++ )
+		{
+		User::LeaveIfError(fsSession.GetDir(
+			iRomDirectoryPaths.MdcaPoint(i),
+			 KEntryAttNormal,ESortByName, fileList));
+		CleanupStack::PushL( fileList );
+	
+		TInt fileCount( fileList->Count() );
+		for ( TInt j=0; j<fileCount; j++ )
+			{
+			const TEntry item = (*fileList)[j];
+			TBufC<KMaxFileName> tempBuf = item.iName;
+			HBufC* concateName = HBufC::NewLC(
+			 iRomDirectoryPaths.MdcaPoint(i).Length() + tempBuf.Length() );
+			TPtr des = concateName->Des();
+			des.Insert(0, iRomDirectoryPaths.MdcaPoint(i) );
+			des.Append( tempBuf );
+			
+			// Only files located on ROM must be scanned
+			// CLF has already scanned other ( supported ) locations
+			if( ( des.Left( KFLDROMDriveLetter().Length() ).CompareF(
+          		KFLDROMDriveLetter ) == 0 ) )
+				{
+				TParsePtrC parsedName( des );
+				
+				MCLFModifiableItem* clfModifiableItem
+				 = ContentListingFactory::NewModifiableItemLC();
+				clfModifiableItem->AddFieldL( ECLFFieldIdFileName, parsedName.NameAndExt() );
+				clfModifiableItem->AddFieldL( ECLFFieldIdPath, parsedName.Path() );
+				clfModifiableItem->AddFieldL( ECLFFieldIdDrive, parsedName.Drive() );
+#ifdef RD_VIDEO_AS_RINGING_TONE
+				if( PathInfo::PathType( parsedName.DriveAndPath() ) == PathInfo::EVideosPath )
+					{
+					clfModifiableItem->AddFieldL( ECLFFieldIdMediaType, ECLFMediaTypeVideo);
+					}
+				else
+					{
+					clfModifiableItem->AddFieldL( ECLFFieldIdMediaType, ECLFMediaTypeSound);
+					}
+#else
+				clfModifiableItem->AddFieldL( ECLFFieldIdMediaType, ECLFMediaTypeSound);
+#endif
+				clfModifiableItem->AddFieldL( ECLFFieldIdFileNameAndPath, des );
+		
+        		// Find out MIME type
+        		RApaLsSession apaLsSession;
+    			User::LeaveIfError( apaLsSession.Connect() );
+    			CleanupClosePushL( apaLsSession );
+    			TUid dummyUid = { 0 }; // instantiate as zero
+    			TDataType dataType( dummyUid );
+    			TInt err = apaLsSession.AppForDocument( parsedName.FullName(), dummyUid, dataType );
+    			CleanupStack::PopAndDestroy(); // apaLsSession.Close()
+    			if( err == KErrNone )
+    				{
+        			clfModifiableItem->AddFieldL( ECLFFieldIdMimeType, dataType.Des() );
+    				User::LeaveIfError(	iRomRingingToneArray.Append( clfModifiableItem ) );
+    				CleanupStack::Pop(); // clfModifiableItem
+    				}
+    			else
+    				{
+    				CleanupStack::PopAndDestroy(); // clfModifiableItem
+    				}
+				}
+			CleanupStack::PopAndDestroy( concateName );
+			}
+		CleanupStack::PopAndDestroy( fileList);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CompareEntries
+// For sorting entry references alphabetically by tone name.
+// -----------------------------------------------------------------------------
+//
+TInt CompareEntries(const CFLDEntryReference& entry1, const CFLDEntryReference& entry2 )
+	{
+	TParsePtrC parsed1( entry1.PathAndMediaFileName() );
+	TParsePtrC parsed2( entry2.PathAndMediaFileName() );
+
+	return parsed1.Name().CompareF( parsed2.Name() );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::ScanRomDirectoriesAndInsertL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::ScanRomDirectoriesAndInsertL()
+	{
+	CDir* fileList( NULL );
+	RFs fsSession;
+	User::LeaveIfError( fsSession.Connect() ); 
+	CleanupClosePushL( fsSession );
+	
+	TInt directoryCount( iRomDirectoryPaths.Count() );
+	for( TInt i= 0; i<directoryCount; i++ )
+		{
+		User::LeaveIfError(fsSession.GetDir(
+			iRomDirectoryPaths.MdcaPoint(i),
+			 KEntryAttNormal,ESortByName, fileList));
+		CleanupStack::PushL( fileList );
+	
+		TInt fileCount( fileList->Count() );
+		for ( TInt j=0; j<fileCount; j++ )
+			{
+			const TEntry item = (*fileList)[j];
+			TBufC<KMaxFileName> tempBuf = item.iName;
+			HBufC* concateName = HBufC::NewLC(
+			 iRomDirectoryPaths.MdcaPoint(i).Length() + tempBuf.Length() );
+			TPtr des = concateName->Des();
+			des.Insert(0, iRomDirectoryPaths.MdcaPoint(i) );
+			des.Append( tempBuf );
+			
+			// Only files located on ROM must be scanned
+			if( ( des.Left( KFLDROMDriveLetter().Length() ).CompareF(
+          		KFLDROMDriveLetter ) == 0 ) )
+				{
+				// Add file to entry-list 							            	
+		   		CFLDEntryReference* entryRef = new( ELeave ) CFLDEntryReference();
+		   		CleanupStack::PushL( entryRef );
+	        	HBufC* pathAndMediaFileName	= des.AllocL();
+				entryRef->SetPathAndMediaFileName( pathAndMediaFileName );
+
+				TParsePtrC parsedName( des );
+				if( PathInfo::PathType( parsedName.DriveAndPath() ) == PathInfo::EVideosPath )
+					{
+					entryRef->SetMediaType( ECLFMediaTypeVideo);
+					}
+				else
+					{
+					entryRef->SetMediaType( ECLFMediaTypeSound);
+					}
+
+    			iEntryFormatter->FormatL( *entryRef );
+				User::LeaveIfError(	iEntryReferences.Append( entryRef ) );
+				CleanupStack::Pop( entryRef );
+				}
+			CleanupStack::PopAndDestroy( concateName );
+			}
+		CleanupStack::PopAndDestroy( fileList);
+		}
+
+	TLinearOrder<CFLDEntryReference>* sorter = 
+		new( ELeave ) TLinearOrder<CFLDEntryReference> ( CompareEntries );
+	iEntryReferences.Sort( *sorter );
+	delete sorter;
+
+	CleanupStack::PopAndDestroy(); // fsSession
+	}
+
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::FilterItemsL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::FilterItemsL( const TArray<MCLFItem*>& aItemList,
+                                RPointerArray<MCLFItem>& aFilteredItemList )
+	{
+	
+	// Add all found entries into model
+    TInt count( aItemList.Count() );
+	for( TInt i = 0 ; i < count ; ++i )
+    	{
+		MCLFItem* item = aItemList[i];
+		aFilteredItemList.AppendL( item );	    	
+    	}
+	
+	// Fetch tones from ROM directories
+	CFLDFileListModel::ScanRomDirectoriesL();
+	
+	// Add all found entries into model
+    count = iRomRingingToneArray.Count();
+	for( TInt i = 0 ; i < count ; ++i )
+    	{
+		MCLFItem* item = iRomRingingToneArray[i];
+		aFilteredItemList.AppendL( item );
+    	}
+    
+	}	
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::GetPopupList
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CFLDPopupList* CFLDFileListModel::GetPopupList()
+	{
+	return iPopupList;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::AddExclusiveMimeTypeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::AddExclusiveMimeTypeL( const TDesC& aMimeType )
+	{
+	TInt index( 0 );
+	if( iExclusiveMimeTypes.Find( aMimeType, index ) == 0 )
+
+		{
+        // A duplicate was found, do not add to the array, just return.
+		return;
+		}
+	iExclusiveMimeTypes.AppendL( aMimeType );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::AddExclusiveMediaTypeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::AddExclusiveMediaTypeL( const TInt32 aMediaType )
+	{
+	if( iExclusiveMediaTypes.Find( aMediaType ) != KErrNotFound )
+		{
+		// A duplicate was found, do not add to the array, just return.
+		return;
+		}
+	iExclusiveMediaTypes.AppendL( aMediaType );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::ResetExclusiveMimeTypes
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::ResetExclusiveMimeTypes()
+	{
+	iExclusiveMimeTypes.Reset();
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::ResetExclusiveMediaTypes
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::ResetExclusiveMediaTypes()
+	{
+	iExclusiveMediaTypes.Reset();
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::CheckRules
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CFLDFileListModel::CheckRules( 
+		 TPtrC& aMimeType, TInt32 aMediaType, TPtrC& aPathAndFileName )
+	{
+	
+	// Check exclusive MIME types
+    if( iExclusiveMimeTypes.Count() > 0 )
+    	{
+       	TInt index( 0 );
+       	if( iExclusiveMimeTypes.Find( aMimeType, index ) == 0 )
+      		{
+           	return EFalse;
+           	}
+       	}
+
+	// Check exclusive media types
+	if( iExclusiveMediaTypes.Count() > 0 )
+		{
+       	if( iExclusiveMediaTypes.Find( aMediaType ) != KErrNotFound )
+	   		{
+           	return EFalse;
+           	}
+    	}
+
+   	if( ( aPathAndFileName.Left( KFLDROMDriveLetter().Length() ).CompareF(
+          KFLDROMDriveLetter ) == 0 ) )
+		{
+		// ROM tones are accepted always
+		return ETrue;
+		}
+	
+	// Check defined pathes
+	if( iDirectoryPaths.Count() > 0 )
+		{
+		TParsePtrC parsedName( aPathAndFileName );
+		TInt index( 0 );
+       	if( iDirectoryPaths.Find( parsedName.DriveAndPath(), index ) != 0 )
+	   		{
+	   		// File is not part of defined path set
+           	return EFalse;
+           	}
+    	}
+    	
+	// File is part of defined path set or then no directory paths are defined
+    return ETrue;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::PopulateListBoxL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::PopulateListBoxL()
+    {
+    // Add all items to the list box
+    TInt countItems( iModel->ItemCount() );
+    TInt error;
+       
+    for( TInt i = 0; i < countItems; i++ )
+        {
+        // Check name and path
+        TPtrC fieldValueNameAndPath;
+        error = iModel->Item( i ).GetField(
+         ECLFFieldIdFileNameAndPath, fieldValueNameAndPath );
+
+        if( error == KErrNone )
+            {
+	        // Check media type
+			TInt32 mediaTypeValue;
+    		error = iModel->Item( i ).GetField(
+     		ECLFFieldIdMediaType, mediaTypeValue );
+	        	
+	   		if( error == KErrNone )
+		   		{
+	       		// Check MIME type
+        		TPtrC fieldValueMime;
+        		error = iModel->Item( i ).GetField(
+        			ECLFFieldIdMimeType, fieldValueMime );
+	
+	   		 	if( error == KErrNone )
+		       		{
+            		// Check include/exclude rules
+		        	if( CFLDFileListModel::CheckRules(
+	       	     		fieldValueMime, mediaTypeValue,
+                 		fieldValueNameAndPath ) )
+ 		       			{
+						// Everything seems to be ok,
+						// now check file-size limit
+    					if ( iMaxFileSize )
+        					{
+   	            			if ( CheckToneFileSizeL(
+   	            				fieldValueNameAndPath, iMaxFileSize)
+   	            		 		!= KErrNone )
+	        	   				{
+	        	   				continue;
+            	   				}
+							}
+						// Finally, add file to entry-list 							            	
+				   		CFLDEntryReference* entryRef
+				  			= new( ELeave ) CFLDEntryReference();
+    			   		CleanupStack::PushL( entryRef );
+			        	HBufC* pathAndMediaFileName
+			      			= fieldValueNameAndPath.AllocL();
+						entryRef->SetPathAndMediaFileName(
+							pathAndMediaFileName );
+						entryRef->SetMediaType( mediaTypeValue );
+	        			iEntryFormatter->FormatL( *entryRef );
+						User::LeaveIfError(
+							iEntryReferences.Append( entryRef ) );
+						CleanupStack::Pop( entryRef );
+ 		       			}
+		       		}
+	            }
+	        }
+        }
+
+	if( countItems == 0 )
+		{
+		// No tones from CLF -- likely out of memory. Scan for ROM tones only.
+		HBufC* errorText = StringLoader::LoadLC( 
+									R_FLD_QTN_PROFILES_ERROR_NOT_ENOUGH_MEMORY );
+		CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue );
+		note->ExecuteLD( *errorText );
+		CleanupStack::PopAndDestroy( errorText );
+
+		iRomTonesOnly = ETrue;
+		ScanRomDirectoriesAndInsertL();
+		}
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::RefreshEntryListL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::RefreshEntryListL()
+    {
+    iRomTonesOnly = EFalse;
+
+    iRomRingingToneArray.ResetAndDestroy();
+    iEntryReferences.ResetAndDestroy();
+    PopulateReferenceListL();
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::SetPopupList
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::SetPopupList( CFLDPopupList* aPopupList )
+	{
+	iPopupList = aPopupList;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::MdcaPoint
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ TPtrC16 CFLDFileListModel::MdcaPoint( TInt aIndex ) const
+    {
+	TInt nullItemCount( iNullTextArray.Count() );
+	if( aIndex < nullItemCount )
+		{
+		// Points to a null item in the beginning of the list.
+		return iNullTextArray[aIndex]->Des();
+		}
+	TInt referenceListCount( iEntryReferences.Count() );
+	if( aIndex >= referenceListCount + nullItemCount )
+		{
+		// Points to a null item in the end of the list.
+		return iEndNullTextArray[aIndex - referenceListCount - nullItemCount]
+                ->Des();
+		}
+
+	// The index points to one of the directory entries
+	return iEntryReferences[aIndex - nullItemCount]
+            ->FormattedPresentation().Des();
+	
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::MdcaCount
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ TInt CFLDFileListModel::MdcaCount() const
+    {
+	return iNullTextArray.Count()
+	 + iEntryReferences.Count() + iEndNullTextArray.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::SetEntryFormatter
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::SetEntryFormatter( MFLDEntryFormatter* aFormatter )
+    {
+    delete iEntryFormatter;
+    iEntryFormatter = aFormatter;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::InsertNullItemL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::InsertNullItemL( const TDesC& aItemText )
+    {
+    InsertNullItemL( aItemText, KNullDesC );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::InsertNullItemL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::InsertNullItemL(
+  const TDesC& aItemText, const TDesC& aFileName )
+    {
+	HBufC* text = iEntryFormatter->FormatTextLC( aItemText );
+	// Takes ownership
+	User::LeaveIfError( iNullTextArray.Append( text ) ); 
+	CleanupStack::Pop( text );
+
+	text = aFileName.AllocLC();
+	// Takes ownership
+	User::LeaveIfError( iNullTextRingingToneArray.Append( text ) ); 
+	CleanupStack::Pop( text );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::InsertEndNullItemL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::InsertEndNullItemL( const TDesC& aItemText )
+    {
+    InsertEndNullItemL( aItemText, KNullDesC );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::InsertEndNullItemL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::InsertEndNullItemL(
+ const TDesC& aItemText, const TDesC& aFileName )
+    {
+	HBufC* text = iEntryFormatter->FormatTextLC( aItemText );
+    // Takes ownership
+	User::LeaveIfError( iEndNullTextArray.Append( text ) ); 
+	CleanupStack::Pop( text );
+
+	text = aFileName.AllocLC();
+	// Takes ownership
+	User::LeaveIfError( iEndNullTextRingingToneArray.Append( text ) ); 
+	CleanupStack::Pop( text );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::GetFileName
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ void CFLDFileListModel::GetFileName( TDes& aFileName, const TInt aIndex )
+    {
+	TInt nullItemCount( iNullTextRingingToneArray.Count() );
+	if( aIndex < nullItemCount )
+		{
+		// Points to a null item in the beginning of the list.
+		aFileName.Copy( iNullTextRingingToneArray[aIndex]->Des() );
+		return;
+		}
+	TInt referenceListCount( iEntryReferences.Count() );
+	if( aIndex >= referenceListCount + nullItemCount )
+		{
+		// Points to a null item in the end of the list.
+		aFileName.Copy( iEndNullTextRingingToneArray[
+			aIndex - referenceListCount - nullItemCount]->Des() );
+		return;
+		}
+
+	// The index points to one of the directory entries
+	CFLDEntryReference& entry = *iEntryReferences[aIndex - nullItemCount];
+	aFileName.Copy( entry.PathAndMediaFileName().Des() );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::FindFileL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+ TInt CFLDFileListModel::FindFileL( const TDesC& aFileName )
+    {
+	TInt ret( KErrNotFound );
+	TInt count( MdcaCount() );
+	TFileName fileName( KNullDesC );
+	for( TInt index( 0 ); index < count; index++ )
+		{
+		GetFileNameAtIndex( index, fileName );
+		if( fileName.CompareF( aFileName ) == 0 )
+			{
+			ret = index;
+			break;
+			}
+		}
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::GetFileNameAtIndex
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::GetFileNameAtIndex(
+ TInt aIndex, TDes& aFileName ) const
+	{
+	TInt nullItemCount( iNullTextRingingToneArray.Count() );
+	if( aIndex < nullItemCount )
+		{
+		// Points to a null item in the beginning of the list.
+		aFileName.Copy( iNullTextRingingToneArray[aIndex]->Des() );
+		return;
+		}
+	TInt referenceListCount( iEntryReferences.Count() );
+	if( aIndex >= referenceListCount + nullItemCount )
+		{
+		// Points to a null item in the end of the list.
+		aFileName.Copy( iEndNullTextRingingToneArray[
+			aIndex - referenceListCount - nullItemCount]->Des() );
+		return;
+		}
+
+	// The index points to one of the directory entries
+	CFLDEntryReference& entry = *iEntryReferences[aIndex - nullItemCount];
+	aFileName.Copy( entry.PathAndMediaFileName().Des() );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::MediaFileType
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt32 CFLDFileListModel::MediaFileType( const TDesC& aFileName ) const
+	{
+	if( iRomTonesOnly )
+		{
+		// Model is empty, get media type from entry reference
+		for(TInt i = 0; i < iEntryReferences.Count(); i++)
+			{
+			if( aFileName.CompareF( iEntryReferences[i]->PathAndMediaFileName() ) == 0 )
+				{
+				return iEntryReferences[i]->MediaType();
+				}
+			}
+		}
+	else
+		{
+	    TInt countItems( iModel->ItemCount() );
+	    for( TInt i = 0; i < countItems; i++ )
+	        {
+	        // Get value of requested field and add item to the list box
+	        TPtrC fieldValue;
+	        TInt error( iModel->Item( i ).GetField(
+	         ECLFFieldIdFileNameAndPath, fieldValue ) );
+
+	        if( error == KErrNone )
+	            {
+	            if( aFileName.CompareF( fieldValue ) == 0 )
+		   			{
+		   			TInt32 mediaTypeValue;
+	        		TInt error( iModel->Item( i ).GetField(
+	        		 ECLFFieldIdMediaType, mediaTypeValue ) );
+
+	            	if( error == KErrNone )
+		            	{
+		            	return mediaTypeValue;
+		   				}
+		   			}
+	            }
+	        }
+		}
+    return KErrNotFound;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::SetMaxFileSize
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDFileListModel::SetMaxFileSize( const TInt aMaxFileSize )
+    {
+    iMaxFileSize = aMaxFileSize;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDFileListModel::CheckToneFileSizeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDFileListModel::CheckToneFileSizeL(
+ const TDesC& aFile, TInt aSizeLimit )
+    {
+	RFs& fsSession( CCoeEnv::Static()->FsSession() );
+	
+    // Get file size
+    TInt size = 0;
+    TInt error = KErrNone;
+
+    TEntry entry;
+    if ( fsSession.Entry( aFile, entry ) == KErrNone )
+        {
+        size = entry.iSize;        
+        }
+
+	// Check. NOTE: now if file size couldn't be determined, check fails.
+	if ( aSizeLimit  &&  size > aSizeLimit )
+		{
+		error = KErrTooBig;
+		}
+
+    return error;
+    }
+    
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDOperationObserver.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CFLDOperationObserver.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CFLDOperationObserver.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDOperationObserver::CFLDOperationObserver
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDOperationObserver::CFLDOperationObserver()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDOperationObserver::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDOperationObserver* CFLDOperationObserver::NewL()
+    {
+    CFLDOperationObserver* self = new (ELeave) CFLDOperationObserver;
+    return self;
+    }
+
+// Destructor
+CFLDOperationObserver::~CFLDOperationObserver()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDOperationObserver::HandleOperationEventL
+// Method to handle list model operation events.
+// -----------------------------------------------------------------------------
+//
+void CFLDOperationObserver::HandleOperationEventL(
+                                TCLFOperationEvent aOperationEvent,
+                                TInt /*aError*/ )
+    {
+    // Waiting is stopped when an event for refresh completion is received
+    if( aOperationEvent == ECLFRefreshComplete )
+        {
+        iRefreshOngoing = EFalse;
+
+        if( iWait && iWait->IsStarted() )
+            {
+            iWait->AsyncStop();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDOperationObserver::IsRefreshOngoing
+// Check if there is a refresh operation is ongoing.
+// -----------------------------------------------------------------------------
+//
+TBool CFLDOperationObserver::IsRefreshOngoing()
+    {
+    return iRefreshOngoing;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDOperationObserver::PrepareForRefresh
+// Prepare for a refresh operation.
+// -----------------------------------------------------------------------------
+//
+void CFLDOperationObserver::PrepareForRefresh( CActiveSchedulerWait& aWait )
+    {
+    // Store the wait instance
+    iWait = &aWait;
+
+    // Refresh operation will be started in a moment
+    iRefreshOngoing = ETrue;
+    }    
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDOperationObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CLF Operation Observer.
+*
+*/
+
+
+
+#ifndef __CFLDOPERATIONOBSERVER_H__
+#define __CFLDOPERATIONOBSERVER_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <MCLFOperationObserver.h>
+
+// CLASS DECLARATION
+
+/**
+*  CLF Operation Observer.
+*  CFLDOperationObserver receives operation events of Content 
+*  Listing Framework. Operation event is generated when asynchronous refresh
+*  operation of List Model is finished.
+*/
+NONSHARABLE_CLASS( CFLDOperationObserver )
+    : public CBase,
+      public MCLFOperationObserver
+    {
+    public:  // Constructors and destructor
+
+		/**
+		 * Creates and returns a new instance of this class.
+		 * @return Pointer to the CFLDOperationObserver object
+		 */
+	    static CFLDOperationObserver* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CFLDOperationObserver();
+
+    private:    // Constructors
+        /**
+        * C++ default constructor.
+        */
+        CFLDOperationObserver();
+
+    protected:  // Methods derived from MCLFOperationObserver
+
+        void HandleOperationEventL( TCLFOperationEvent aOperationEvent,
+                                    TInt aError );
+
+	public:     // New functions
+                                    
+  		/**
+        * Check if there is a refresh operation is ongoing.
+        * @return ETrue if refresh is not finished,
+        *         EFalse if refresh is finished
+        */
+        TBool IsRefreshOngoing();
+
+        /**
+        * Prepare for a refresh operation to start.
+        * @param aWait The wait instance to stop when refreshing is completed
+        */
+        void PrepareForRefresh( CActiveSchedulerWait& aWait );
+
+    private:    // Data
+
+        /// Own: For waiting the refresh operation to complete
+        CActiveSchedulerWait* iWait;
+    
+        // For indicating that refresh operation is started but not finished
+        TBool iRefreshOngoing;                                    
+
+    };
+
+#endif // __CFLDOperationObserver_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDPlayerBase.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,376 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CFLDPlayerBase is used to play sound files. It takes into account
+*     the current volume and ringing type settings.
+*
+*
+*/
+
+
+// CLASS HEADER
+#include "CFLDPlayerBase.h"
+
+// INTERNAL INCLUDES
+#include "ProfileEngineInternalCRKeys.h"
+
+// EXTERNAL INCLUDES
+#include <aknnotewrappers.h> // CAknErrorNote
+#include <StringLoader.h>
+#include <FileList.rsg>
+#include <centralrepository.h>
+#include <hwrmvibrasdkcrkeys.h>
+#include <e32property.h>
+#include <ctsydomainpskeys.h>
+
+// CONSTANTS
+namespace
+	{
+	const TInt KMinVolumeLevel( 1 );
+	const TInt KMaxVolumeLevel( 10 );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// Destructor
+CFLDPlayerBase::~CFLDPlayerBase()
+    {
+    CCoeEnv::Static()->RemoveForegroundObserver( *this );
+
+    iApaSession.Close();
+
+	if( iVibraNotifyHandler )
+		{
+		iVibraNotifyHandler->StopListening();
+		}
+
+	if( iTypeNotifyHandler )
+		{
+		iTypeNotifyHandler->StopListening();
+		}
+
+	if( iVolumeNotifyHandler )
+		{
+		iVolumeNotifyHandler->StopListening();
+		}
+
+    delete iVibraNotifyHandler;
+	delete iTypeNotifyHandler;
+    delete iVolumeNotifyHandler;
+
+    delete iSession;
+    delete iVibraSession;
+
+    delete iErrorMessage;
+	iErrorMessage = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::CFLDPlayerBase
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDPlayerBase::CFLDPlayerBase( TBool aShowErrorMsgs )
+    :   i3dEffects( ETrue ),
+        iShowErrorMsgs( aShowErrorMsgs )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::BaseConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::BaseConstructL()
+    {
+	CCoeEnv* coeEnv = CCoeEnv::Static();
+
+    coeEnv->AddForegroundObserverL( *this );
+
+    // Read a text string from resource file
+    if ( iShowErrorMsgs )
+        {
+		iErrorMessage = StringLoader::LoadL( R_FLD_QTN_FILE_FORMAT_ERROR );
+        }
+
+    // Get initial settings from active profile
+    // init cenrep connection
+    iSession = CRepository::NewL(KCRUidProfileEngine);
+    iVibraSession = CRepository::NewL(KCRUidVibraCtrl);
+
+    iVolumeNotifyHandler = CCenRepNotifyHandler::NewL(*this,
+                                                     *iSession,
+                                                     CCenRepNotifyHandler::EIntKey,
+                                                     KProEngActiveRingingVolume);
+
+	iTypeNotifyHandler = CCenRepNotifyHandler::NewL(*this,
+                                                     *iSession,
+                                                     CCenRepNotifyHandler::EIntKey,
+                                                     KProEngActiveRingingType);
+
+	iVibraNotifyHandler = CCenRepNotifyHandler::NewL(*this,
+                                                     *iVibraSession,
+                                                     CCenRepNotifyHandler::EIntKey,
+                                                     KVibraCtrlProfileVibraEnabled);
+
+
+	User::LeaveIfError( iSession->Get( KProEngActiveRingingVolume, iRingingVolume ) );
+    User::LeaveIfError( iSession->Get( KProEngActiveRingingType, iRingingType ) );
+    User::LeaveIfError( iVibraSession->Get( KVibraCtrlProfileVibraEnabled, iVibra ) );
+
+    User::LeaveIfError( iSession->Get( KProEngDefaultRingingTone, iDefaultTone ) );
+
+    iVolumeNotifyHandler->StartListeningL();
+    iTypeNotifyHandler->StartListeningL();
+    iVibraNotifyHandler->StartListeningL();
+
+    User::LeaveIfError( iApaSession.Connect() );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::SetVolume()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::SetVolume( TInt aVolume )
+    {
+   iRingingVolume = aVolume;
+        	
+	// CCenrepNotifyHandler doesn't allow to stop only iVolumeNotifyHandler
+	// but we must stop all the handlers in correct order
+	if( iVibraNotifyHandler )
+		{
+		iVibraNotifyHandler->StopListening();
+		}
+
+	if( iTypeNotifyHandler )
+		{
+		iTypeNotifyHandler->StopListening();
+		}
+
+	if( iVolumeNotifyHandler )
+		{
+		iVolumeNotifyHandler->StopListening();
+		delete iVolumeNotifyHandler;
+        iVolumeNotifyHandler = NULL;
+		}
+	
+	// Start handlers again which were stopped
+	// No possibility to handle leave here any way
+	if( iTypeNotifyHandler )
+		{
+        TRAP_IGNORE( iTypeNotifyHandler->StartListeningL() );
+        }
+	if( iVibraNotifyHandler )
+		{
+        TRAP_IGNORE( iVibraNotifyHandler->StartListeningL() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::SetRingingType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::SetRingingType( TInt aRingingType )
+    {
+    iRingingType = aRingingType;
+	if( iVibraNotifyHandler )
+		{
+		iVibraNotifyHandler->StopListening();
+		}
+
+	if( iTypeNotifyHandler )
+		{
+		iTypeNotifyHandler->StopListening();
+		delete iTypeNotifyHandler;
+        iTypeNotifyHandler = NULL;
+		}
+
+	if( iVolumeNotifyHandler )
+		{
+		iVolumeNotifyHandler->StopListening();
+		}
+	
+	if( iVolumeNotifyHandler )
+		{
+        TRAP_IGNORE( iVolumeNotifyHandler->StartListeningL() );
+        }
+        
+	if( iVibraNotifyHandler )
+		{
+        TRAP_IGNORE( iVibraNotifyHandler->StartListeningL() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::SetVibra()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::SetVibra( TBool aVibra )
+    {
+    iVibra = aVibra;
+	if( iVibraNotifyHandler )
+		{
+		iVibraNotifyHandler->StopListening();
+		delete iVibraNotifyHandler; 
+        iVibraNotifyHandler = NULL; 
+		}
+
+	if( iTypeNotifyHandler )
+		{
+		iTypeNotifyHandler->StopListening();
+		}
+
+	if( iVolumeNotifyHandler )
+		{
+		iVolumeNotifyHandler->StopListening();
+		}
+	
+	if( iVolumeNotifyHandler )
+		{
+        TRAP_IGNORE( iVolumeNotifyHandler->StartListeningL() );
+        }
+	if( iTypeNotifyHandler )
+		{
+        TRAP_IGNORE( iTypeNotifyHandler->StartListeningL() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::Set3dEffects()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::Set3dEffects( TBool a3dEffects )
+	{
+	i3dEffects = a3dEffects;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::BaseConvertVolume()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDPlayerBase::BaseConvertVolume( TInt aVolume, TInt aMaxVolume )
+    {
+    TInt result( aMaxVolume * aVolume / KMaxVolumeLevel );
+    // if user has selected minimum volume level
+    // set HW volume 1
+    if ( aVolume == KMinVolumeLevel && result == 0 )
+        {
+        result = 1;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::DisplayErrorNoteL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::DisplayErrorNoteL()
+    {
+    if( iShowErrorMsgs )
+        {
+        CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue );
+        note->ExecuteLD( *iErrorMessage );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::DataType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDPlayerBase::DataType( const TDesC& aFileName, TDataType& aDataType )
+    {
+   	TUid dummyUid( KNullUid );
+	return iApaSession.AppForDocument( aFileName, dummyUid, aDataType );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::HandleNotifyInt()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::HandleNotifyInt(TUint32 aId, TInt aNewValue)
+    {
+
+   	if ( aId == KProEngActiveRingingVolume )
+   		{
+   		iRingingVolume = aNewValue;
+   		}
+   	else if ( aId == KProEngActiveRingingType )
+		{
+   		iRingingType = aNewValue;
+   		}
+   	else if ( aId == KVibraCtrlProfileVibraEnabled )
+   		{
+   		iVibra = aNewValue;
+   		}
+
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::HandleLosingForeground()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::HandleLosingForeground()
+    {
+    iFocusLost = ETrue;
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::HandleGainingForeground()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPlayerBase::HandleGainingForeground()
+    {
+    iFocusLost = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPlayerBase::IsCallOngoing()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CFLDPlayerBase::IsCallOngoing() const
+    {
+    // Get call status
+    TBool res = EFalse;
+    TInt err = KErrNone;
+    TInt callState = EPSCTsyCallStateUninitialized; 
+
+    err = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
+    if( !err &&
+         ( callState != EPSCTsyCallStateUninitialized && 
+           callState != EPSCTsyCallStateNone && 
+           callState != EPSCTsyCallStateDisconnecting ) ) 
+        {
+        // There was call ongoing
+        res = ETrue;
+        }
+
+    return res;
+    }
+
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDPlayerBase.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CFLDPlayerBase is used to play sound files. It takes into account
+*     the current volume and ringing type settings.
+*
+*
+*/
+
+
+#ifndef __CFLDPLAYERBASE_H__
+#define __CFLDPLAYERBASE_H__
+
+// INTERNAL INCLUDES
+#include "MFLDFileProcessor.h"
+
+// EXTERNAL INCLUDES
+#include <e32def.h>
+#include <coemain.h>
+#include <apgcli.h>
+#include <cenrepnotifyhandler.h>
+
+//	FORWARD DECLARATIONS
+class C3DRingingToneInterface;
+
+//  CONSTANTS
+const TInt KFLDMinVolumeLevel( 1 );
+
+//  CLASS DECLARATION
+
+/**
+* CFLDPlayerBase is used to play sound files. It takes into account the current
+* volume and ringing type settings.
+*
+* @lib filelist.lib
+* @since 2.1
+*/
+NONSHARABLE_CLASS( CFLDPlayerBase )
+    : public CBase,
+      public MFLDFileProcessor,
+	  public MCenRepNotifyHandlerCallback,
+      public MCoeForegroundObserver
+    {
+    protected:     // Destructor
+
+        /**
+         * Destructor
+         */
+        virtual ~CFLDPlayerBase();
+
+    protected:    // Constructors
+
+        /**
+         * C++ constructor
+         * @param aShowErrorMsgs Show an error note if the file format is not supported
+         */
+        CFLDPlayerBase( TBool aShowErrorMsgs );
+
+        /**
+         * Second phase constructor
+         */
+        void BaseConstructL();
+
+    public:		// From MFLDFileProcessor
+
+        /**
+        * Set the volume level on which the sound is played
+        * If this method is not called, player uses the setting in active profile.
+        * @param aVolume The volume level
+        */
+        void SetVolume( TInt aVolume );
+
+        /**
+        * Sets the ringing type
+        * If this method is not called, player uses the setting in active profile.
+        * @param aRingingType The ringing type (see enum TRingingTypes)
+        */
+        void SetRingingType( TInt aRingingType );
+
+        /**
+        * Sets vibrating alert on or off.
+        * If this method is not called, player uses the setting in active profile.
+        * @param aVibra True: Vibra is on. False: Vibra is off.
+        */
+        void SetVibra( TBool aVibra );
+        
+        /**
+        * Sets 3d-effects on or off.
+        * If this method is called using parameter EFalse 3d-effects are 
+        * always disabled even though those are set in active profile.
+        * Otherwise toneplayer uses the setting in active profile.
+        * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off.
+        */
+        void Set3dEffects( TBool a3dEffects );
+
+    protected:    // New methods
+
+        /** See if a call is ongoing.
+        * @return ETrue if a call is ongoing, EFalse otherwise.
+        */
+        TBool IsCallOngoing() const;
+
+        /**
+         * Helper method to adapt the Profiles volume to player volume.
+         * @param aVolume the volume value to be converted.
+         * @param aMaxVolume maximum volume level of the player used.
+         * @return the converted volume.
+         */
+        TInt BaseConvertVolume( TInt aVolume, TInt aMaxVolume );
+
+        /**
+        * Show note "Tone format not supported"
+        */
+        void DisplayErrorNoteL();
+
+        /**
+         * Gets the data type of the given file.
+         * @param aFileName path to the file which data type must be found out
+         * @param aDataType value return parameter to hold the data type
+         * @return system-wide error code
+         */
+        TInt DataType( const TDesC& aFileName, TDataType& aDataType );
+
+	private: 	// Methods derived from MCenRepNotifyHandlerCallback
+        void HandleNotifyInt(TUint32 aId, TInt aNewValue);
+
+    private:    // Methods derived from MCoeForegroundObserver
+
+        /**
+        * Derived from MCoeForegroundObserver. Called when application gains foreground.
+        */
+        void HandleGainingForeground();
+
+        /**
+        * Derived from MCoeForegroundObserver. Stops playing the file if
+        * this application loses focus.
+        */
+        void HandleLosingForeground();
+
+    protected:    // Data
+
+		/// Ringingvolume
+        TInt iRingingVolume;
+		/// Ringingtype
+        TInt iRingingType;
+		/// Vibrasetting (on/off)
+        TBool iVibra;
+		/// Own: pointer to error message
+        HBufC* iErrorMessage;
+        /// Prevent tone playing, if application has lost focus
+        TBool iFocusLost;
+        /// Default tone
+        TFileName iDefaultTone;
+        // Ringingtone Plugin (should be created/deleted by subclass)
+		C3DRingingToneInterface* i3dRingingTonePlugin;
+		/// 3DSettings (on/off)		
+		TBool i3dEffects;
+
+    private:    // Data
+
+		/// Own: Pointer to volumenotifyhandler
+		CCenRepNotifyHandler* iVolumeNotifyHandler;
+		/// Own: Pointer to typenotifyhandler
+		CCenRepNotifyHandler* iTypeNotifyHandler;
+		/// Own: Pointer to vibranotifyhandler
+		CCenRepNotifyHandler* iVibraNotifyHandler;
+		/// Own: Pointer to CR session
+        CRepository* iSession;
+		/// Own: Pointer to CR vibra session
+        CRepository* iVibraSession;
+        /// Show an error, if the file format is not supported
+        TBool iShowErrorMsgs;
+		// Find out tone MIME -type
+        RApaLsSession iApaSession;
+
+    };
+
+#endif      //  __CFLDPLAYERBASE_H__
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDPopupList.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,631 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CFLDPopupList.
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "CFLDPopupList.h"
+
+// INTERNAL INCLUDES
+#include    "CFLDFileListModel.h"
+#include    "MFLDFileObserver.h"
+#include    "MFLDFileListBoxObserver.h"
+
+// EXTERNAL INCLUDES
+#include <AknIconArray.h>
+#include <aknmemorycardui.mbg>
+#include <AknsUtils.h>
+#include <gulicon.h>
+#include <aknconsts.h> // KAvkonBitmapFile, KAvkonVariatedBitmapsFile
+#include <variatedbitmaps.mbg> // MBM indices for seamless link
+#include <avkon.mbg>
+#include <data_caging_path_literals.hrh>
+#include <aknlists.h>
+#include <commondialogs.mbg>
+#include <filelist.mbg>
+
+// CONSTANTS
+namespace
+	{
+    _LIT( KFLDMassStorageBitmapFile, "z:filelist.mbm" );
+    _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
+
+	const TInt KIconGranularity( 3 );
+	}
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::CFLDPopupList
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDPopupList::CFLDPopupList(
+	MFLDFileObserver& aFileObserver,
+    MFLDFileListBoxObserver* aListBoxObserver,
+	CFLDFileListModel& aModel )
+	:	CAknPopupList(),
+		iFileObserver( aFileObserver ),
+        iListBoxObserver( aListBoxObserver ),
+		iModel( aModel ),
+		iPoint(-1,-1)
+    {
+    }
+
+
+void CFLDPopupList::ConstructL(
+ CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType )
+	{
+	// Notify foreground lost
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    coeEnv->AddForegroundObserverL( *this );
+    coeEnv->AddFocusObserverL( *this );
+    
+    CAknPopupList::ConstructL( aListBox, aCbaResource, aType );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDPopupList* CFLDPopupList::NewL(
+	CEikListBox* aListBox,
+	TInt aCbaResource,
+	MFLDFileObserver& aFileObserver,
+    MFLDFileListBoxObserver* aListBoxObserver,
+	CFLDFileListModel& aModel,
+	AknPopupLayouts::TAknPopupLayouts aType )
+	{
+	CFLDPopupList* self = new( ELeave )
+        CFLDPopupList( aFileObserver, aListBoxObserver, aModel );
+	CleanupStack::PushL( self );
+	self->ConstructL( aListBox, aCbaResource, aType );
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+// Destructor
+ CFLDPopupList::~CFLDPopupList()
+    {
+    CCoeEnv::Static()->RemoveForegroundObserver( *this );
+    CCoeEnv::Static()->RemoveFocusObserver( *this );
+    }
+    
+ // -----------------------------------------------------------------------------
+ // CFLDPopupList::HandlePointerEventL
+ // (other items were commented in a header).
+ // -----------------------------------------------------------------------------
+ //
+ void CFLDPopupList::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+	 {
+	 if ( aPointerEvent.iType == TPointerEvent::EButton1Down)
+		 {
+		 iPoint = aPointerEvent.iPosition;
+		 CancelPreview();
+		 }
+	 if ( Rect().Contains( iPoint ) )
+		 {
+		 CCoeControl::HandlePointerEventL( aPointerEvent );
+		 }
+	 else
+		 {
+		 AttemptExitL(EFalse);    
+		 }
+	 }
+// -----------------------------------------------------------------------------
+// CFLDPopupList::AttemptExitL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::AttemptExitL( TBool aAccept )
+	{
+	if( iExitChecksDone )
+	    {
+	    CAknPopupList::AttemptExitL( aAccept );
+	    return;
+	    }
+
+	TFileName fileName( KNullDesC );
+	iModel.GetFileName( fileName, iListBox->CurrentItemIndex() );
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	// Get current softkey state
+	if( iListBoxObserver )
+    	{
+		iListBoxObserver->HandleSoftKeyState( iSoftKeyState );
+    	}
+	TBool isVideo( EFalse );
+	if ( iModel.MediaFileType( fileName ) == ECLFMediaTypeVideo )
+		{
+		isVideo = ETrue;
+		}
+#endif
+
+	if( aAccept )
+		{
+		// User made a selection (didn't press cancel).
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+		if( isVideo )
+			{
+			if( iSoftKeyState ==
+			 MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
+				{
+				// Cancel listbox timer
+        		if( iListBoxObserver )
+            		{
+            		iListBoxObserver->HandleFileListBoxEventL(
+                		MFLDFileListBoxObserver::EOtherKeyEvent,
+                		fileName );
+            		}
+				}
+			else
+				{
+				// No need to cancel timer
+				// (it has been already cancelled)
+				}
+			}
+		else
+			{
+        	// Cancel listbox timer
+        	if( iListBoxObserver )
+            	{
+            	iListBoxObserver->HandleFileListBoxEventL(
+                	MFLDFileListBoxObserver::EOtherKeyEvent,
+                	fileName );
+            	}
+			}
+#else
+		// Cancel listbox timer
+        if( iListBoxObserver )
+        	{
+            iListBoxObserver->HandleFileListBoxEventL(
+            	MFLDFileListBoxObserver::EOtherKeyEvent,
+                fileName );
+            }
+#endif
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	if( !isVideo )	// Only perform file validity check for audio files here
+		{
+		// Ask the observer if the file is valid.
+        if( !iFileObserver.IsFileValidL(
+         fileName, MFLDFileObserver::ESelect ) )
+			{
+            // Not ok to close the pop-up.
+            // Return. Don't call CAknPopupList::AttemptExitL.
+			return;
+			}
+		}
+
+#else
+        // Ask the observer if the file is valid.
+    if( !iFileObserver.IsFileValidL(
+     fileName, MFLDFileObserver::ESelect ) )
+    	{
+	    // Not ok to close the pop-up.
+        // Return. Don't call CAknPopupList::AttemptExitL.
+		return;
+		}
+#endif
+
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+		if( iListBoxObserver )
+			{
+			// Ask the observer if the file is video
+			if( isVideo )
+				{// File is a video
+
+				// Change the softkeys back to normal
+				iListBoxObserver->HandleFileListBoxEventL(
+ 						MFLDFileListBoxObserver::EVideoPreviewCanceled,
+ 						 fileName );
+ 						
+				if( iSoftKeyState
+				 == MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
+			 		{	// File is a video and we are in tone selection list
+
+			 		// Ask the observer if the file is valid.
+        			if( !iFileObserver.IsFileValidL(
+        			 fileName, MFLDFileObserver::ESelect ) )
+        				{
+						// Not ok to close the pop-up.
+            			// Return. Don't call CAknPopupList::AttemptExitL.
+						return;
+        				}
+			 		}
+			 	else if( iSoftKeyState
+			 	 == MFLDFileListBoxObserver::EPreviewSoftKeyState )
+			 		{	// File is a video and it has been focused for 1s
+
+			 		// Ask the observer if the file is valid.
+        			if( !iFileObserver.IsFileValidL(
+        			 fileName, MFLDFileObserver::EPlay ) )
+        				{
+						// Not ok to close the pop-up.
+            			// Return. Don't call CAknPopupList::AttemptExitL.
+						return;
+        				}
+
+			 		iListBoxObserver->HandleFileListBoxEventL(
+                		MFLDFileListBoxObserver::EVideoPreview,
+                		fileName );
+                	
+			 		// Disable scrollbar
+			 		ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( ETrue );
+
+			 		// Remove the focus from listbox
+                	ListBox()->SetDimmed( ETrue );
+
+                	// Not ok to close the pop-up.
+            		// Return. Don't call CAknPopupList::AttemptExitL.
+                	return;
+			 		}
+			 	else if( iSoftKeyState
+			 	 == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
+			 		{	// File is a video and it is in preview state
+
+			 		// Ask the observer if the file is valid.
+        			if( !iFileObserver.IsFileValidL(
+        			 fileName, MFLDFileObserver::ESelect ) )
+						{
+						// When video screen is closed,
+						// listbox must be forced to be refreshed
+						// ( otherwise scrollbar is not redrawn)
+						ListBox()->SetDimmed( EFalse );
+	                    ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
+						DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
+						// Not ok to close the pop-up.
+            			// Return. Don't call CAknPopupList::AttemptExitL.
+						return;
+						}
+
+					// When video screen is closed, listbox must be refreshed
+					DrawDeferred();
+	            	}
+				}
+			}
+		}
+	else	// 	if( aAccept )
+		{
+		// User canceled selection
+		if( iListBoxObserver )
+			{
+			if( isVideo )
+				{	// File is a video
+				
+				// Change the softkeys back to normal
+				iListBoxObserver->HandleFileListBoxEventL(
+	       			MFLDFileListBoxObserver::EVideoPreviewCanceled,
+	       			 fileName );
+				
+	 			if( iSoftKeyState ==
+	 			 MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
+					{	// File is a video and it is in preview state
+
+					// When video screen is closed,
+					// listbox must be forced to be refreshed
+					// ( otherwise scrollbar is not redrawn)
+					ListBox()->SetDimmed( EFalse );
+                    ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
+					DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
+					// Not ok to close the pop-up.
+            		// Return. Don't call CAknPopupList::AttemptExitL.
+					return;
+					}
+	 			}
+			}
+#endif
+
+		}
+
+	iExitChecksDone = ETrue;
+	CAknPopupList::AttemptExitL( aAccept );
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::HandleResourceChange
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::HandleResourceChange( TInt aType )
+    {
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    if( aType == KEikDynamicLayoutVariantSwitch ||
+         aType == KAknsMessageSkinChange )
+        {
+		if( iListBoxObserver )
+			{
+ 			TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
+ 				MFLDFileListBoxObserver::EVideoPreviewCanceled ) );
+ 		    if( ListBox()->IsFocused() )
+ 		        {
+ 		        ListBox()->SetDimmed( EFalse );
+                ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
+ 		        }
+			}
+        }
+#endif
+    if( aType == KAknsMessageSkinChange )
+        {
+        TRAP_IGNORE( PopulateIconArrayL() );
+        }
+
+    CAknPopupList::HandleResourceChange( aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::GetFileListBoxObserver
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MFLDFileListBoxObserver* CFLDPopupList::GetFileListBoxObserver()
+	{
+	return iListBoxObserver;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::HandleListBoxEventL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::HandleListBoxEventL( CEikListBox* aListBox,
+	TListBoxEvent aEventType )
+    {
+	switch( aEventType )
+		{
+		// Special handling for touch: first click just starts preview;
+		// second click (double click) will select the tone.
+		// Fall through.
+		case EEventItemClicked:
+			{
+			iModel.GetFileName( iCurrentFileName, iListBox->CurrentItemIndex() );
+			iListBoxObserver->HandleFileListBoxEventL( 
+				MFLDFileListBoxObserver::EFocusChanged, iCurrentFileName );
+			return;
+			}
+
+		case EEventItemDoubleClicked:
+			AttemptExitL( ETrue );
+			return;
+
+		default:
+			break;
+		}
+
+	CAknPopupList::HandleListBoxEventL( aListBox, aEventType );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::CancelPreview
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::CancelPreview()
+    {
+    if( iListBoxObserver )
+    	{
+        TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
+         				MFLDFileListBoxObserver::EOtherKeyEvent, KNullDesC ) );
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::PopupListWindow::
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+RWindow& CFLDPopupList::PopupListWindow() const
+	{
+	return Window();
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::HandleGainingForeground
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::HandleGainingForeground()
+	{
+	TRAP_IGNORE( ListBox()->HandleItemAdditionL() );
+	}
+// -----------------------------------------------------------------------------
+// CFLDPopupList::HandleLosingForeground
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::HandleLosingForeground()
+	{
+    if( iListBoxObserver )
+        {
+        iListBoxObserver->HandleSoftKeyState( iSoftKeyState );
+        if( iSoftKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
+            {
+            TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
+                MFLDFileListBoxObserver::EVideoPreviewCanceled, KNullDesC ) );
+            DrawNow();
+            }
+
+        // Set the vertical scroll bar and listbox to not dimmed.        
+        if ( ListBox()->IsFocused() )
+            {
+            ListBox()->SetDimmed( EFalse );
+            ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
+            }
+        }
+	}	
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::HandleChangeInFocus
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::HandleChangeInFocus()
+	{
+	if( ListBox()->IsFocused() )
+		{
+		ListBox()->SetDimmed( EFalse );
+		}
+	}	
+// -----------------------------------------------------------------------------
+// CFLDPopupList::HandleDestructionOfFocusedItem
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::HandleDestructionOfFocusedItem()
+	{
+	}	
+
+// -----------------------------------------------------------------------------
+// CFLDPopupList::PopulateIconArrayL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDPopupList::PopulateIconArrayL()
+    {
+    CAknSingleGraphicBtPopupMenuStyleListBox* listBox = 
+    	static_cast<CAknSingleGraphicBtPopupMenuStyleListBox*>( ListBox() );
+
+	if( !listBox )
+		{
+		return;
+		}
+
+    // Create new icon array
+    CArrayPtr<CGulIcon>* iconArray = new( ELeave ) CAknIconArray( KIconGranularity );
+    CleanupStack::PushL( iconArray );
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+
+    //    
+    // Create an empty icon in icon array position 0
+    // 
+    CGulIcon* icon =
+        AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropEmpty, KAvkonBitmapFile,
+        EMbmAvkonQgn_prop_empty, EMbmAvkonQgn_prop_empty_mask  );
+    CleanupStack::PushL( icon );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+    //
+    // Create an URL icon for download tones in icon array position 1
+    //
+    icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropLinkEmbdSmall,
+        KAvkonVariatedBitmapsFile,
+        EMbmVariatedbitmapsQgn_prop_link_embd_small,
+        EMbmVariatedbitmapsQgn_prop_link_embd_small_mask );
+    CleanupStack::PushL( icon );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+    //
+    // Create an memory card icon in icon array position 2
+    //		
+	TParse* fp = new(ELeave) TParse();
+	fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
+	TFileName resourceFileName( fp->FullName() );
+	delete fp;
+        
+    TRgb defaultColour( KRgbBlack );
+    CFbsBitmap* bmap = NULL;
+    CFbsBitmap* mask = NULL;
+
+    AknsUtils::GetCachedColor( skin, defaultColour,
+               KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 );
+    AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall,
+                KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap, mask,
+                resourceFileName, EMbmAknmemorycarduiQgn_indi_mmc_add,
+                EMbmAknmemorycarduiQgn_indi_mmc_add_mask,
+                defaultColour );
+    icon = CGulIcon::NewL( bmap, mask );
+    icon->SetBitmapsOwnedExternally( EFalse );
+    CleanupStack::Pop( 2 ); // icon owns the bitmaps now
+        
+    CleanupStack::PushL( icon );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+     
+    //
+    // Create an audio file icon in icon array position 3
+    //
+    icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileSound,
+        KCommonDialogsBitmapFile,
+        EMbmCommondialogsQgn_prop_fmgr_file_sound,
+        EMbmCommondialogsQgn_prop_fmgr_file_sound_mask );
+    CleanupStack::PushL( icon );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+    //
+    // Create a video file icon in icon array position 4
+    //
+    icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileVideo,
+        KCommonDialogsBitmapFile,
+        EMbmCommondialogsQgn_prop_fmgr_file_video,
+        EMbmCommondialogsQgn_prop_fmgr_file_video_mask );
+    CleanupStack::PushL( icon );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+    //
+    // create mass storage icon in icon array position 5
+    //
+	TParse* fp2 = new(ELeave) TParse();
+	fp2->Set(KFLDMassStorageBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
+	resourceFileName = fp2->FullName();
+	delete fp2;
+
+    TRgb defaultColour2( KRgbBlack );
+    CFbsBitmap* bmap2 = NULL;
+    CFbsBitmap* mask2 = NULL;
+
+    AknsUtils::GetCachedColor( skin, defaultColour2,
+               KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 );
+    AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall,
+                KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap2, mask2,
+                resourceFileName, EMbmFilelistQgn_indi_fmgr_ms_add,
+                EMbmFilelistQgn_indi_fmgr_ms_add_mask,
+                defaultColour2 );
+    
+    icon = CGulIcon::NewL( bmap2, mask2 );
+    icon->SetBitmapsOwnedExternally( EFalse );
+    CleanupStack::Pop( 2 ); // icon owns the bitmaps now
+        
+    CleanupStack::PushL( icon );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+
+    // Delete old icons
+    CArrayPtr<CGulIcon>* arr = listBox->ItemDrawer()->ColumnData()->IconArray();
+    if( arr )
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	listBox->ItemDrawer()->ColumnData()->SetIconArrayL( iconArray );
+	CleanupStack::Pop( iconArray );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDPopupList.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A thin CAknPopupList extension.
+*
+*/
+
+
+
+#ifndef CFLDPOPUPLIST_H
+#define CFLDPOPUPLIST_H
+
+// INTERNAL INCLUDES
+#include "MFLDFileListBoxObserver.h" // For TFileListSoftKeyState
+
+// EXTERNAL INCLUDES
+#include <aknPopup.h>
+#include <coemain.h> // For MCoeForegroundObserver
+
+// FORWARD DECLARATIONS
+class MFLDFileObserver;
+class CFLDFileListModel;
+
+// CLASS DECLARATION
+
+/**
+*  A thin CAknPopupList extension.
+*  Prevents closing the pop-up if the pop-up observer so wishes.
+*
+*  @lib filelist.lib
+*  @since 2.1
+*/
+NONSHARABLE_CLASS( CFLDPopupList )
+ : public CAknPopupList, public MCoeForegroundObserver, public MCoeFocusObserver
+    {
+
+
+    public: // New methods
+
+		/**
+		* Two-phased constructor.
+		* @param aListbox A parameter to CAknPopupList.
+		* @param aCbaResource A parameter to CAknPopupList.
+        * @param aFileObserver File observer.
+        * @param aListBoxObserver Listbox observer, can be NULL.
+        * @param aModel Filelist Model.
+		* @param aType A parameter to CAknPopupList.
+		*/
+		static CFLDPopupList* NewL(
+			CEikListBox* aListBox,
+			TInt aCbaResource,
+			MFLDFileObserver& aFileObserver,
+            MFLDFileListBoxObserver* aListBoxObserver,
+			CFLDFileListModel& aModel,
+			AknPopupLayouts::TAknPopupLayouts aType = AknPopupLayouts::EMenuWindow );
+		
+		void ConstructL(CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType );
+
+
+		/**
+        * Destructor.
+        */	
+		virtual ~CFLDPopupList();
+
+		/**
+		* Returns Popuplist RWindow handle
+		*/
+		RWindow& PopupListWindow() const;
+
+		/**
+		* Populates icon array and updates ListBox
+		*/
+		void PopulateIconArrayL();
+
+		/**
+		* Cancels audio/video preview
+		*/
+		void CancelPreview();
+		
+		/**
+		* Handles pointer events of popups.
+		*/
+		void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+		
+		/**
+		 * Returns FileListBoxObserver.
+		 */
+		MFLDFileListBoxObserver* GetFileListBoxObserver();
+
+    private:	// From CAknPopupList
+        void AttemptExitL( TBool aAccept );
+        void HandleResourceChange(TInt aType);
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+        
+	private:	// From MCoeForegroundObserver
+        void HandleGainingForeground();
+        void HandleLosingForeground();        
+
+	private:	// From MCoeFocusObserver
+        void HandleChangeInFocus();
+    	void HandleDestructionOfFocusedItem();
+
+	private:
+
+		/**
+		* C++ constructor.
+        * @param aFileObserver File observer.
+        * @param aListBoxObserver Listbox observer, can be NULL.
+        * @param aModel Filelist Model.
+		*/
+		CFLDPopupList(
+			MFLDFileObserver& aFileObserver,
+            MFLDFileListBoxObserver* aListBoxObserver,
+			CFLDFileListModel& aModel );
+
+	private: // New methods
+
+    private:    // Data
+
+        /// File observer
+        MFLDFileObserver& iFileObserver;
+
+        /// Ref: Listbox observer
+        MFLDFileListBoxObserver* iListBoxObserver;
+
+		/// FileList Model
+		CFLDFileListModel& iModel;
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+		/// Current softkeystate
+		MFLDFileListBoxObserver::TFileListSoftKeyState iSoftKeyState;
+
+#endif
+
+		TFileName iCurrentFileName;
+
+		// Have the checks in AttemptExitL been done already
+		TBool iExitChecksDone;
+		TPoint iPoint;
+    };
+
+#endif      // CFLDPOPUPLIST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDRingingTonePlayer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,474 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CFLDRingingTonePlayer is used to play sound files. It takes into account
+*     the current volume and ringing type settings.
+*
+*
+*/
+
+
+// CLASS HEADER
+#include "CFLDRingingTonePlayer.h"
+
+// EXTERNAL INCLUDES
+#include <AudioPreference.h>
+#include <mda/common/resource.h>
+#include <c3dringingtoneinterface.h>		// C3DRingingToneInterface
+#include <ScreensaverInternalPSKeys.h>
+
+// CONSTANTS
+namespace
+	{
+	const TInt KAscendingVolumeInterval( 3000000 ); // 3 seconds
+	const TInt KToneInterval( 1000000 ); // 1 second pause between tones
+
+    _LIT( KDataTypeNone, "" );
+	_LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" );
+	_LIT8( KFileListBeepSequence, "\x00\x11\x06\x0A\x08\x73\x0A\x40\x28\x0A\xF7\
+	\x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B" ); //sequence for playing a beep once sound
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDRingingTonePlayer* CFLDRingingTonePlayer::NewL( TBool aShowErrorMsgs )
+    {
+    CFLDRingingTonePlayer* self = new( ELeave ) CFLDRingingTonePlayer( aShowErrorMsgs );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self ); // self
+    return self;
+    }
+
+// Destructor
+CFLDRingingTonePlayer::~CFLDRingingTonePlayer()
+    {
+    Cancel(); // Stops possible playback
+
+	delete iAudioPlayer;
+	delete iTonePlayer;
+	
+	delete i3dRingingTonePlugin;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::CFLDRingingTonePlayer
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDRingingTonePlayer::CFLDRingingTonePlayer( TBool aShowErrorMsgs )
+    :   CFLDPlayerBase( aShowErrorMsgs ),
+        iAudioPlayerStatus( EAudioPlayerNotCreated ),
+		iTonePlayerStatus( EAudioPlayerNotCreated )
+    {
+    i3dEffects = ETrue;
+    i3DEffect = KErrNotFound;
+    i3DEcho = KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::ConstructL()
+    {
+    BaseConstructL();
+
+   	// To allow/not allow screensaver
+   	// Errors ignored, no actions needed if API is not available
+    iPropScreenSaver.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::ProcessFileL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::ProcessFileL( const TDesC& aFileName, RWindow* /*aWindow*/ )
+    {
+    if ( aFileName == KNullDesC || iFocusLost )
+        {
+        return;
+        }
+
+    Cancel(); // Stops possible playback
+
+	TDataType dataType;
+	TInt error( DataType( aFileName, dataType ) );
+    if( ( error != KErrNotFound ) && ( error != KErrNone ) )
+        {
+        User::Leave( error );
+        }
+
+   	// Do not allow screen saver while playing
+    // Errors ignored, no actions needed if API is not available	   	
+   	iPropScreenSaver.Set( KPSUidScreenSaver,
+			KScreenSaverAllowScreenSaver, EFLScreenSaverNotAllowed );
+
+	delete iTonePlayer;
+    iTonePlayer = NULL;
+	
+    delete iAudioPlayer;
+    iAudioPlayer = NULL;
+
+	if ( iRingingType == ERingingTypeBeepOnce )
+		{
+		// Active profile ringing tone is set to Beep Once
+		// Don't initialize a FileSequence but use DesSequence instead
+        iTonePlayer = CMdaAudioToneUtility::NewL( *this );
+		iTonePlayer->PrepareToPlayDesSequence( KFileListBeepSequence() );
+		iTonePlayerStatus = EAudioPlayerInitializing;
+		}
+    else
+		{
+		TPtrC ptr( aFileName );
+        if( error )
+            {
+            ptr.Set( iDefaultTone );
+            }
+        if( dataType.Des().CompareF( KFileListRngMimeType ) == 0 )
+            {
+            //Ringingtone is a RNG-file
+            iTonePlayer = CMdaAudioToneUtility::NewL( *this );
+            iTonePlayer->PrepareToPlayFileSequence( ptr );
+            iTonePlayerStatus = EAudioPlayerInitializing;
+            }
+        // If the mime type is NULL, the file can't be play.
+        else if ( dataType.Des().CompareF( KDataTypeNone ) == 0 )
+            {
+            return;
+            }
+        else
+            {
+            iAudioPlayer = CDrmPlayerUtility::NewFilePlayerL(
+             	ptr, *this, KAudioPriorityRingingTonePreview,
+                TMdaPriorityPreference ( 
+                iVibra ? KAudioPrefRingFilePreviewVibra :
+                KAudioPrefRingFilePreview ) );
+	
+            iAudioPlayerStatus = EAudioPlayerInitializing;
+            }
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::Cancel()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::Cancel()
+    {
+   	if ( iAudioPlayerStatus == EAudioPlayerPlayingWith3DEffect )
+   	    {
+   	    i3dRingingTonePlugin->Stop();
+   	    // plugin calls AudioPlayer->Stop()
+	    iAudioPlayer->Close();
+	    delete iAudioPlayer;
+	    iAudioPlayer = NULL;
+   	    }
+    
+   	if ( iAudioPlayerStatus == EAudioPlayerPlaying )
+        {
+        if( iAudioPlayer )
+	        {
+    	    iAudioPlayer->Stop();
+    	    iAudioPlayer->Close();
+    	    delete iAudioPlayer;
+    	    iAudioPlayer = NULL;
+	        }
+        }
+
+    iAudioPlayerStatus = EAudioPlayerReady;
+
+	if ( iTonePlayerStatus == EAudioPlayerPlaying )
+        {
+        if( iTonePlayer )
+	        {
+    	    iTonePlayer->CancelPlay();
+    	    delete iTonePlayer;
+    	    iTonePlayer = NULL;
+	        }
+        }
+    iTonePlayerStatus = EAudioPlayerReady;
+
+   	// Allow screen saver, unless there's a call ongoing
+   	if( !IsCallOngoing() )
+   		{
+	    // Errors ignored, no actions needed if API is not available	   	
+	   	iPropScreenSaver.Set( KPSUidScreenSaver,
+	    		KScreenSaverAllowScreenSaver, EFLScreenSaverAllowed );
+   		}
+
+}
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::DoSetRingingType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::DoSetRingingType( TInt aRingingType )
+    {
+    if( iAudioPlayerStatus == EAudioPlayerInitialized )
+        {
+        switch( aRingingType )
+            {
+			// Fall through
+            case ERingingTypeRinging:
+            case ERingingTypeSilent:
+                {
+                iAudioPlayer->SetRepeats(
+                 KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) );
+                break;
+                }
+            case ERingingTypeAscending:
+                {
+                iAudioPlayer->SetRepeats(
+                	KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) );
+                TInt volRamp = KAscendingVolumeInterval * iRingingVolume;
+                iAudioPlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
+				break;
+                }
+            case ERingingTypeRingOnce:
+                {
+                iAudioPlayer->SetRepeats(
+                 0, TTimeIntervalMicroSeconds( KToneInterval ) );
+                break;
+                }
+
+            default:
+                {
+                break;
+                }
+            }
+        }
+    else if( iTonePlayerStatus == EAudioPlayerInitialized )
+        {
+        switch( aRingingType )
+            {
+			// Fall through
+            case ERingingTypeRinging:
+			case ERingingTypeSilent:
+                {
+                iTonePlayer->SetRepeats(
+                 KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) );
+                break;
+                }
+            case ERingingTypeAscending:
+                {
+                iTonePlayer->SetRepeats(
+                 KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) );
+                TInt volRamp = KAscendingVolumeInterval * iRingingVolume;
+                iTonePlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
+                break;
+                }
+			// Fall through
+            case ERingingTypeRingOnce:
+			case ERingingTypeBeepOnce:
+                {
+                iTonePlayer->SetRepeats(
+                 0, TTimeIntervalMicroSeconds( KToneInterval ) );
+                break;
+                }
+	       default:
+                {
+                break;
+                }
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::ConvertVolume()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDRingingTonePlayer::ConvertVolume( TInt aVolume )
+    {
+    TInt result( 0 );
+    if ( iAudioPlayerStatus == EAudioPlayerInitialized ||
+        iAudioPlayerStatus == EAudioPlayerPlaying )
+        {
+        result = BaseConvertVolume( aVolume, iAudioPlayer->MaxVolume() );
+        }
+    else if( iTonePlayerStatus == EAudioPlayerInitialized ||
+        iTonePlayerStatus == EAudioPlayerPlaying )
+        {
+        result = BaseConvertVolume( aVolume, iTonePlayer->MaxVolume() );
+        }
+	//if user has selected silent ringing type, set volume off
+	if( iRingingType == ERingingTypeSilent )
+		{
+		result = 0;
+		}
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::MdapcInitComplete()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::MdapcInitComplete(
+    TInt aError, const TTimeIntervalMicroSeconds& /* aDuration */ )
+    {
+    if ( !aError && iAudioPlayerStatus == EAudioPlayerInitializing )
+        {
+        iAudioPlayerStatus = EAudioPlayerInitialized;
+        DoSetRingingType( iRingingType );
+        iAudioPlayer->SetVolume( ConvertVolume( iRingingVolume ) );
+		iAudioPlayer->SetPriority( KAudioPriorityPreview,
+            TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra :
+                                             KAudioPrefRingFilePreview ) );
+                                             
+        if ( iRingingType == ERingingTypeBeepOnce )
+            {
+            return; // beeb once not handled here
+            }
+        
+        if( !i3dEffects )
+            {
+            iAudioPlayer->Play();
+         	iAudioPlayerStatus = EAudioPlayerPlaying;
+         	return;
+            }
+
+        if ( !i3dRingingTonePlugin )
+            {
+            TUid emptyUid = { 0 };
+            TRAPD( err, i3dRingingTonePlugin = C3DRingingToneInterface::NewL( emptyUid ) );
+            if ( err != KErrNone || !i3dRingingTonePlugin )
+                {
+           	    iAudioPlayer->Play();
+          	    iAudioPlayerStatus = EAudioPlayerPlaying;
+           	    return;
+                }
+            }
+        if ( i3DEffect != KErrNotFound && i3DEcho != KErrNotFound )
+            {
+            i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEffect, i3DEffect );
+            i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEcho, i3DEcho );
+            }
+            
+        i3dRingingTonePlugin->SetAttr( E3DRTIAttrDrmPlayerUtility, iAudioPlayer );
+        TRAP_IGNORE( i3dRingingTonePlugin->PlayL() );
+        iAudioPlayerStatus = EAudioPlayerPlayingWith3DEffect;
+        }
+    else
+        {
+        Cancel();
+        if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )
+            {
+            // Don't care about leave, if the note can't be displayed.
+            TRAP_IGNORE( DisplayErrorNoteL() );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::MdapcPlayComplete()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::MdapcPlayComplete( TInt aError )
+    {
+    if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )
+        {
+        // Don't care about leave, if the note can't be displayed.
+        TRAP_IGNORE( DisplayErrorNoteL() );
+        }
+
+	Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::MatoPrepareComplete()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::MatoPrepareComplete( TInt aError )
+    {
+    if ( !aError && iTonePlayerStatus == EAudioPlayerInitializing )
+        {
+        iTonePlayerStatus = EAudioPlayerInitialized;
+        DoSetRingingType( iRingingType );
+        iTonePlayer->SetVolume( ConvertVolume( iRingingVolume ) );
+        iTonePlayer->SetPriority( KAudioPriorityPreview,
+            TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra :
+                                             KAudioPrefRingFilePreview ) );
+        iTonePlayer->Play();
+        iTonePlayerStatus = EAudioPlayerPlaying;
+        }
+    else
+        {
+        Cancel();
+        if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )
+            {
+            // Don't care about leave, if the note can't be displayed.
+            TRAP_IGNORE( DisplayErrorNoteL() );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::MatoPlayComplete()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::MatoPlayComplete( TInt aError )
+    {
+    if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )
+        {
+        // Don't care about leave, if the note can't be displayed.
+        TRAP_IGNORE( DisplayErrorNoteL() );
+        }
+
+	Cancel();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CFLDRingingTonePlayer::Set3dEffects()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDRingingTonePlayer::Set3dEffects( TBool a3dEffects )
+	{
+	const TInt K3DEffectBase = 1000;
+    const TInt K3DEchoBase =   2000;
+    
+	i3dEffects = a3dEffects;
+	
+	if ( a3dEffects >= K3DEffectBase && a3dEffects < K3DEchoBase )
+	    {
+	    i3DEffect = a3dEffects - K3DEffectBase;
+	    return;
+	    }
+	
+	if ( a3dEffects >= K3DEchoBase )
+	    {
+	    i3DEcho = a3dEffects - K3DEchoBase;
+	    return;
+	    }
+	}
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDRingingTonePlayer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CFLDRingingTonePlayer is used to play sound files. It takes into account
+*     the current volume and ringing type settings.
+*
+*
+*/
+
+
+#ifndef __CFLDRINGINGTONEPLAYER_H__
+#define __CFLDRINGINGTONEPLAYER_H__
+
+// INTERNAL INCLUDES
+//#include "MFLDFileProcessor.h"
+#include "CFLDPlayerBase.h"
+
+// EXTERNAL INCLUDES
+#include <e32def.h>
+#include <e32property.h>
+#include <DrmAudioSamplePlayer.h>
+#include <mdaaudiotoneplayer.h>
+
+
+//	FORWARD DECLARATIONS
+class C3DRingingToneInterface;
+
+//  CLASS DECLARATION
+
+/**
+* CFLDRingingTonePlayer is used to play sound files. It takes into account the current
+* volume and ringing type settings.
+*
+* @lib filelist.lib
+* @since 2.1
+*/
+NONSHARABLE_CLASS( CFLDRingingTonePlayer )
+    : public CFLDPlayerBase,
+      public MDrmAudioPlayerCallback,
+      public MMdaAudioToneObserver
+    {
+    private:  // Enumerations
+
+        enum TAudioPlayerStatus
+            {
+            EAudioPlayerNotCreated,
+            EAudioPlayerInitializing,
+            EAudioPlayerReady,
+            EAudioPlayerPlaying,
+			EAudioPlayerInitialized,
+			EAudioPlayerPlayingWith3DEffect
+            };
+
+        // These match with the ones in Profile Engine
+        enum TRingingTypes
+            {
+            ERingingTypeRinging = 0,
+            ERingingTypeAscending,
+            ERingingTypeRingOnce,
+            ERingingTypeBeepOnce,
+            ERingingTypeSilent
+            };
+
+		enum TFLAllowScreenSaver
+			{
+			EFLScreenSaverAllowed = 0,
+			EFLScreenSaverNotAllowed
+			};
+
+    public:     // Constructors and destructors
+
+        /**
+         * Two-phase static constructor
+         * @param aShowErrorMsgs Show an error note if the file format is not supported
+         * @return A pointer to a fully constructed CFLDRingingTonePlayer instance
+         */
+        static CFLDRingingTonePlayer* NewL( TBool aShowErrorMsgs = ETrue );
+
+        /**
+         * Destructor
+         */
+        virtual ~CFLDRingingTonePlayer();
+
+    private:    // Constructors and destructors
+
+        /**
+         * Constructor
+         * @param aShowErrorMsgs Show an error note if the file format is not supported
+         */
+        CFLDRingingTonePlayer( TBool aShowErrorMsgs );
+
+        /**
+         * Second phase constructor
+         */
+        void ConstructL();
+
+    public:		// From MFLDFileProcessor
+
+        /**
+         * Derived from MFLDFileProcessor. Starts playing the sound file
+         */
+        void ProcessFileL( const TDesC& aFileName, RWindow* aWindow );
+
+        /**
+         * Derived from MFLDFileProcessor. Stops playing the file.
+         */
+        void Cancel();
+        
+    public:
+        /**
+        * Enables/disables 3D effects.
+        * @param a3dEffects.
+        * @return None.
+        */
+        void Set3dEffects( TBool a3dEffects );
+
+
+
+    private:    // New methods
+
+        /** When audioplayer is ready, set its ringing type
+        * @param aRingingType The ringing type (see enum TRingingTypes)
+        */
+        void DoSetRingingType( TInt aRingingType );
+
+        /**
+        * Converts volume from 1 to 10 to audio driver understandable value.
+        * @param aVolume Volume level to be converted.
+        * @return Returns converted volume level
+        */
+        TInt ConvertVolume( TInt aVolume );
+
+    private:    // Methods derived from MDrmAudioPlayerCallback
+
+        /**
+        * Derived from MDrmAudioPlayerCallback
+        * This method is called when the audio player initialisation is ready
+        */
+        void MdapcInitComplete( TInt aError, const TTimeIntervalMicroSeconds& aDuration );
+
+        /**
+        * Derived from MDrmAudioPlayerCallback
+        * This method is called when the audio player has finished playing
+        */
+        void MdapcPlayComplete( TInt aError );
+
+    private:    // Methods derived from MMdaAudioToneObserver
+
+	    virtual void MatoPrepareComplete( TInt aError );
+	    virtual void MatoPlayComplete( TInt aError );
+
+    private:    // Data
+
+		/// Own: Pointer to audioplayer
+        CDrmPlayerUtility* iAudioPlayer;
+		/// Audioplayer status
+        TAudioPlayerStatus iAudioPlayerStatus;
+		/// Own: Pointer to toneplayer
+        CMdaAudioToneUtility* iTonePlayer;
+		/// Toneplayer status
+        TAudioPlayerStatus iTonePlayerStatus;
+
+        /**
+		* Pub&Sub property.
+		* For setting the state of the screen saver.
+		*/
+        RProperty iPropScreenSaver;
+
+        // 3D effect
+        TInt i3DEffect;
+        // 3D effect
+        TInt i3DEcho;
+        
+        // plugin for playing 3D effects
+        C3DRingingToneInterface* i3dRingingTonePlugin;
+
+
+    };
+
+#endif      //  __CFLDRINGINGTONEPLAYER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CFLDSingleGraphicEntryFormatter.
+*
+*
+*/
+
+
+// CLASS HEADER
+#include "CFLDSingleGraphicEntryFormatter.h"
+
+// INTERNAL INCLUDES
+#include "CFLDEntryReference.h"
+
+// EXTERNAL INCLUDES
+#include <f32file.h>	// For TParsePtrC
+#include <AknUtils.h>	// For AknTextUtils
+#include <driveinfo.h>
+
+// CONSTANTS
+namespace
+	{
+	// Some helper literals
+	_LIT( KFLDTab, "\t" );
+	_LIT( KFLDIgnoredExt, ".rng" );
+
+	// these icon array indexes must match with the implementation
+	// of the function CFLDFileListContainer.cpp/PopulateIconArrayL
+	_LIT( KFLDZeroAndTab, "0\t" );
+	_LIT( KFLDSoundAndTab, "3\t" );
+	_LIT( KFLDVideoAndTab, "4\t" );
+	_LIT( KFLDMemoryCard, "2" );
+	_LIT( KFLDMassStorage, "5" );
+	
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDSingleGraphicEntryFormatter::CFLDSingleGraphicEntryFormatter
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDSingleGraphicEntryFormatter::CFLDSingleGraphicEntryFormatter()
+	{
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDSingleGraphicEntryFormatter::~CFLDSingleGraphicEntryFormatter()
+// -----------------------------------------------------------------------------
+//
+CFLDSingleGraphicEntryFormatter::~CFLDSingleGraphicEntryFormatter()
+    {
+    delete iDriveUtil;
+    }
+    
+// -----------------------------------------------------------------------------
+// CFLDSingleGraphicEntryFormatter::FormatL()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDSingleGraphicEntryFormatter::FormatL( CFLDEntryReference& aEntry )
+    {
+    if ( !iDriveUtil )
+        {
+        iDriveUtil = CDriveUtil::NewL();
+        }
+        
+	HBufC* formattedName = NULL;
+	HBufC& pathAndMediaFileName = aEntry.PathAndMediaFileName();
+    TParsePtrC parsedName( pathAndMediaFileName.Des() );
+
+#ifdef RD_VIDEO_AS_RINGING_TONE	    
+	TBool isFileVideo( EFalse );
+	if ( aEntry.MediaType() == ECLFMediaTypeVideo )
+		{
+		isFileVideo = ETrue;
+		}
+  
+    if( isFileVideo )
+    	{
+    	formattedName = HBufC::NewL( parsedName.NameAndExt().Length() + KFLDVideoAndTab().Length() * 2 );
+    	}
+    else
+    	{
+    	formattedName = HBufC::NewL( parsedName.NameAndExt().Length() + KFLDSoundAndTab().Length() * 2 );
+    	}
+#else
+   	formattedName = HBufC::NewL( parsedName.NameAndExt().Length() + KFLDZeroAndTab().Length() * 2 );
+#endif
+
+	aEntry.SetFormattedPresentation( formattedName );
+		
+	// Combine all the data to the formatted data descriptor:
+	TPtr des = formattedName->Des();
+
+ 	// RNG files are shown without the file extension
+    TPtrC ext( parsedName.Ext() );
+    if ( ext.CompareF( KFLDIgnoredExt ) == 0 )
+        {
+        des.Copy( parsedName.Name() );
+        }
+    else
+        {
+        des.Copy( parsedName.NameAndExt() );
+        }
+        
+	// Make sure that the file name does not contain tab characters
+	AknTextUtils::ReplaceCharacters( des, KAknReplaceListControlChars, TChar(' ') );        
+
+#ifdef RD_VIDEO_AS_RINGING_TONE	    
+	if( isFileVideo )
+		{
+		des.Insert( 0, KFLDVideoAndTab );
+		}
+	else
+		{
+		des.Insert( 0, KFLDSoundAndTab );
+		}
+    
+#else
+    des.Insert( 0, KFLDZeroAndTab );
+#endif    
+	des.Append( KFLDTab );
+         
+	/*
+	TChar mmcDriveLetter( PathInfo::MemoryCardRootPath()[0] );
+	mmcDriveLetter.UpperCase();
+
+    // Check if the entry is on MMC
+    TChar entryDriveLetter( parsedName.Drive()[ 0 ] );
+    entryDriveLetter.UpperCase();
+
+    if ( entryDriveLetter == mmcDriveLetter )
+        {
+        des.Append( '2' ); // MMC icon index
+        }
+    */
+    
+    if ( iDriveUtil->IsMemoryCard( aEntry.PathAndMediaFileName() ) )
+        {
+        des.Append( KFLDMemoryCard );
+        }
+    else if ( iDriveUtil->IsMassStorage( aEntry.PathAndMediaFileName() ) )
+        {
+        des.Append( KFLDMassStorage );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDSingleGraphicEntryFormatter::FormatTextLC()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+HBufC* CFLDSingleGraphicEntryFormatter::FormatTextLC( const TDesC& aText )
+    {
+    HBufC* text = NULL;
+    if( aText.Find( KFLDTab ) == KErrNotFound )
+        {
+        text = HBufC::NewLC( aText.Length() + KFLDZeroAndTab().Length() );
+        TPtr des( text->Des() );
+        des.Copy( KFLDZeroAndTab );
+        des.Append( aText );
+        }
+    else
+        {
+        text = aText.AllocLC();
+        }
+    return text;
+    }
+
+
+
+
+/******************************************************************************
+ * class CDriveUtil
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CDriveUtil* CDriveUtil::NewL()
+    {
+    CDriveUtil* self = new (ELeave) CDriveUtil();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CDriveUtil::~CDriveUtil()
+    {
+	iFsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::CDriveUtil
+// 
+// -----------------------------------------------------------------------------
+//
+CDriveUtil::CDriveUtil()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CDriveUtil::ConstructL()
+    {
+    User::LeaveIfError( iFsSession.Connect() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::IsMassStorage
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CDriveUtil::IsMassStorage(const TDesC& aFullPath)
+    {
+    const TUint KMassStorageBits = DriveInfo::EDriveInternal |
+                                   DriveInfo::EDriveExternallyMountable;
+
+    TDriveUnit drive(aFullPath);
+    TUint driveStatus(0);
+    
+    TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus );
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    if ( (driveStatus & KMassStorageBits) == KMassStorageBits )
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::IsMemoryCard
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CDriveUtil::IsMemoryCard(const TDesC& aFullPath)
+    {
+    const TUint KMemoryCardBits = DriveInfo::EDriveRemovable |
+                                  DriveInfo::EDriveExternallyMountable;
+
+    TDriveUnit drive(aFullPath);
+    TUint driveStatus(0);
+    
+    TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus );
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    if ( (driveStatus & KMemoryCardBits) == KMemoryCardBits )
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This class is responsible of formatting a directory entry to
+*     a format that is displayable in a CAknSingleGraphicBtPopupMenuStyleListBox.
+*
+*
+*/
+
+
+
+#ifndef CFLDSINGLEGRAPHICENTRYFORMATTER_H
+#define CFLDSINGLEGRAPHICENTRYFORMATTER_H
+
+// INTERNAL INCLUDES
+#include "MFLDEntryFormatter.h"
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+
+// FORWARD DECLARATIONS
+class CFLDEntryRefererence;
+
+// CLASS DECLARATION
+
+
+/**
+* CDriveUtil
+*
+* CDriveUtil is used for getting drive information.
+*/
+NONSHARABLE_CLASS (CDriveUtil) : public CBase
+    {
+    public:
+        static CDriveUtil* NewL();
+        virtual ~CDriveUtil();
+
+    private:
+	    CDriveUtil();
+	    void ConstructL();
+
+	public:
+		TBool IsMemoryCard(const TDesC& aFullPath);
+		TBool IsMassStorage(const TDesC& aFullPath);
+        
+    private:
+        RFs iFsSession;
+    };
+
+
+/**
+* This class is responsible of formatting a directory entry to
+* a format that is displayable in a CAknSingleGraphicBtPopupMenuStyleListBox.
+*
+* @lib FileList.lib
+* @since Series 60 2.6
+*/
+NONSHARABLE_CLASS( CFLDSingleGraphicEntryFormatter ) :
+ public CBase, public MFLDEntryFormatter
+    {
+    public:     // // Functions from base classes
+
+		CFLDSingleGraphicEntryFormatter();
+		
+		/**
+        * Destructor.
+        */
+        virtual ~CFLDSingleGraphicEntryFormatter();
+
+		
+        /**
+        * From MFLDEntryFormatter
+        */
+        void FormatL( CFLDEntryReference& aEntry );
+
+        /**
+        * From MFLDEntryFormatter
+        */
+        HBufC* FormatTextLC( const TDesC& aText );
+        
+    private:
+        CDriveUtil* iDriveUtil;
+    };
+
+#endif      //  CFLDSINGLEGRAPHICENTRYFORMATTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDSoftKeyChanger.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* 	CFLDSoftKeyChanger changes softkeys into video preview layout and
+* 	video preview select layout. Allows also to restore old layout.
+*
+*
+*/
+
+//  CLASS HEADER
+#include "CFLDSoftKeyChanger.h"
+
+//	EXTERNAL INCLUDES
+#include <f32file.h> 	// For TParsePtrC
+#include <StringLoader.h>
+#include <eikbtgpc.h> 	// For CEikButtonGroupContainer
+#include <FileList.rsg>	// For R_FLD_SOFTKEYS_PREVIEW_CANCEL
+#include <avkon.rsg>	// For R_AVKON_SOFTKEYS_SELECT_CANCEL
+#include <avkon.hrh>	// For EAknSoftkeySelect
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDSoftKeyChanger* CFLDSoftKeyChanger::NewL()
+    {
+    CFLDSoftKeyChanger* self = CFLDSoftKeyChanger::NewLC();
+    CleanupStack::Pop( self ); // self
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDSoftKeyChanger* CFLDSoftKeyChanger::NewLC()
+    {
+    CFLDSoftKeyChanger* self = new( ELeave ) CFLDSoftKeyChanger();
+    CleanupStack::PushL( self );
+
+    self->ConstructL( );
+    return self;
+    }
+
+// Destructor
+CFLDSoftKeyChanger::~CFLDSoftKeyChanger()
+    {
+    delete iSoftKeySelect;
+    delete iSoftKeyPreview;
+    delete iSoftKeyCancel;
+    delete iSoftKeyBack;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::CFLDSoftKeyChanger
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDSoftKeyChanger::CFLDSoftKeyChanger()
+	: iSoftKeyState( MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDSoftKeyChanger::ConstructL()
+    {
+    iSoftKeySelect = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_PREVIEW_SELECT );
+    iSoftKeyPreview = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_PREVIEW );
+    iSoftKeyCancel = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_CANCEL );
+    iSoftKeyBack = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_BACK );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::ChangeLeftSoftKeyL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDSoftKeyChanger::ChangeLeftSoftKeyL( const TDesC& aSoftKeyLabel ) const
+	{
+	CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
+ 	CleanupStack::PushL( cba );
+	cba->SetCommandL( EAknSoftkeySelect, aSoftKeyLabel );
+	CleanupStack::Pop( cba );
+	cba->DrawDeferred();
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::ChangeRightSoftKeyL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDSoftKeyChanger::ChangeRightSoftKeyL( const TDesC& aSoftKeyLabel ) const
+	{
+	CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
+ 	CleanupStack::PushL( cba );
+	cba->SetCommandL( EAknSoftkeyCancel, aSoftKeyLabel );
+	CleanupStack::Pop( cba );
+	cba->DrawDeferred();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewL()
+	{
+	if (iSoftKeyState == MFLDFileListBoxObserver::EPreviewSoftKeyState )
+		{
+		return;
+		}
+		
+    CFLDSoftKeyChanger::ChangeLeftSoftKeyL( iSoftKeyPreview->Des() );
+    CFLDSoftKeyChanger::ChangeRightSoftKeyL( iSoftKeyCancel->Des() );
+    
+	iSoftKeyState = MFLDFileListBoxObserver::EPreviewSoftKeyState;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewSelectL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewSelectL()
+	{
+	if (iSoftKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
+		{
+		return;
+		}
+		
+    CFLDSoftKeyChanger::ChangeLeftSoftKeyL( iSoftKeySelect->Des() );
+    CFLDSoftKeyChanger::ChangeRightSoftKeyL( iSoftKeyBack->Des() );
+  
+	iSoftKeyState = MFLDFileListBoxObserver::EPreviewSelectSoftKeyState;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::RestoreOldSoftKeysL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDSoftKeyChanger::RestoreOldToneSelectionSoftKeysL()
+	{
+	if (iSoftKeyState == MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
+		{
+		return;
+		}
+		
+    CFLDSoftKeyChanger::ChangeLeftSoftKeyL( iSoftKeySelect->Des() );
+    CFLDSoftKeyChanger::ChangeRightSoftKeyL( iSoftKeyCancel->Des() );
+
+	iSoftKeyState = MFLDFileListBoxObserver::EToneSelectionSoftKeyState;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDSoftKeyChanger::SoftKeyState
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MFLDFileListBoxObserver::TFileListSoftKeyState
+ CFLDSoftKeyChanger::SoftKeyState()	const
+	{
+	return iSoftKeyState;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDSoftKeyChanger.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* 	CFLDSoftKeyChanger changes softkeys into video preview layout and
+* 	video preview select layout. Allows also to restore old layout.	
+*
+*
+*/
+
+
+#ifndef __CFLDSOFTKEYCHANGER_H__
+#define __CFLDSOFTKEYCHANGER_H__
+
+// INTERNAL INCLUDES
+#include <e32base.h>
+
+// EXTERNAL INCLUDES
+#include "MFLDFileListBoxObserver.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+* CFLDSoftKeyChanger changes softkeys into video preview layout and
+* video preview select layout. Allows also to restore old layout.
+*
+* @lib filelist.lib
+* @since 3.1
+*/
+NONSHARABLE_CLASS( CFLDSoftKeyChanger ) : public CBase
+    {
+    
+    public:	// Constructors and destructors
+
+		/**
+		* Two-phased static constructor.
+		* @return A pointer to a fully constructed CFLDSoftKeyChanger instance
+		*/
+    	static CFLDSoftKeyChanger* NewL();
+ 
+ 		/**
+ 	 	* Two-phased static constructor, leaves a pointer to cleanup stack
+ 		* @return A pointer to a fully constructed CFLDSoftKeyChanger instance
+ 		*/
+		static CFLDSoftKeyChanger* NewLC();
+
+    	/**
+    	* Destructor
+    	*/
+    	virtual ~CFLDSoftKeyChanger();
+
+    protected:  // Constructors and destructors
+
+    	/**
+    	* Constructor, protected
+    	*/
+    	CFLDSoftKeyChanger();
+
+    	/**
+    	* Second phase constructor
+    	*/
+    	void ConstructL();
+    
+    public: // New methods
+    
+    	/**
+    	* Changes softkey layout into 'Preview' 'Cancel'
+        */
+    	void ChangeNewSoftKeysPreviewL();
+    	
+    	/**
+    	* Changes softkey layout into 'Select' 'Cancel'
+    	* NOTE: this layout is used only when tone selection list
+    	* is at preview state
+        */
+    	void ChangeNewSoftKeysPreviewSelectL();
+    	
+    	/**
+    	* Restores layout into original 'Select' 'Back'
+        */
+    	void RestoreOldToneSelectionSoftKeysL();
+    	
+    	/**
+    	* Returns current softkeystate
+        */
+        MFLDFileListBoxObserver::TFileListSoftKeyState
+         SoftKeyState() const;
+                
+    private: // New methods
+    
+    	/**
+    	* Opens filelist internal resource file
+        */
+    	void OpenResourceL();
+    	
+    	/**
+    	* Changes softkey label from given string
+    	* @parameter aSoftKeyLabel new label for softkey
+        */
+   		void ChangeLeftSoftKeyL( const TDesC& aSoftKeyLabel ) const;
+   		/**
+    	* Changes softkey label from given string
+    	* @parameter aSoftKeyLabel new label for softkey
+        */
+   		void ChangeRightSoftKeyL( const TDesC& aSoftKeyLabel ) const;
+
+    
+    private: // Data
+    
+		// Softkey state       	
+       	MFLDFileListBoxObserver::TFileListSoftKeyState iSoftKeyState;
+       	
+       	/// Own: SoftkeyLabel
+       	HBufC* iSoftKeySelect;
+       	
+       	/// Own: SoftkeyLabel
+       	HBufC* iSoftKeyPreview;
+       	
+       	/// Own: SoftkeyLabel
+       	HBufC* iSoftKeyCancel;
+
+       	/// Own: SoftkeyLabel
+       	HBufC* iSoftKeyBack;
+
+    };
+
+#endif      // __CFLDSOFTKEYCHANGER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDVideoPlayer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,612 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*	Creates a video player and starts video preview
+*
+*
+*/
+
+
+// CLASS HEADER
+#include "CFLDVideoPlayer.h"
+
+// EXTERNAL INCLUDES
+#include <AknUtils.h> // For AknLayoutUtils
+#include <AudioPreference.h> // For KAudioPriorityPreview
+#include <ScreensaverInternalPSKeys.h>
+
+// CONSTANTS
+namespace
+	{
+	const TInt KAscendingVolumeRampInterval( 3000000 ); // 3 seconds
+	const TInt KPhoneVideoVolumeRampStep = 1;
+	// Used to reset inactivity timer so that backlight stays on
+	const TInt KResetInactivityTimerDelay = 2000000;   // 2 seconds
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDVideoPlayer* CFLDVideoPlayer::NewL( TBool aShowErrorMsgs )
+    {
+    CFLDVideoPlayer* self = new( ELeave ) CFLDVideoPlayer( aShowErrorMsgs );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self ); // self
+    return self;
+    }
+
+// Destructor
+CFLDVideoPlayer::~CFLDVideoPlayer()
+    {
+    Cancel();
+
+    delete iBacklightTimer;
+
+    if( iVolumeRampTimer )
+	    {
+    	delete iVolumeRampTimer;
+	    }
+	
+    if( iVideoPlayer )
+		{
+		delete iVideoPlayer;
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::CFLDVideoPlayer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDVideoPlayer::CFLDVideoPlayer( TBool aShowErrorMsgs )
+    : CFLDPlayerBase( aShowErrorMsgs ),
+      iVideoPlayerStatus( EVideoPlayerNotCreated )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::ConstructL()
+    {
+    BaseConstructL();
+
+   	// To allow/not allow screensaver
+   	// Errors ignored, no actions needed if API is not available
+    iPropScreenSaver.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver );
+
+    // To keep backlight on while a video is being previewed
+    iBacklightTimer = CPeriodic::NewL( EPriorityLow );
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::ProcessFileL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::ProcessFileL( const TDesC& aFileName, RWindow* aWindow )
+	{
+	iWindow = aWindow;
+	
+	if ( aFileName == KNullDesC || iFocusLost || !iWindow )
+        {
+        return;
+        }
+
+    Cancel(); // Stops possible playback
+    
+   	// Do not allow screen saver while playing
+    // Errors ignored, no actions needed if API is not available	   	
+   	iPropScreenSaver.Set( KPSUidScreenSaver,
+			KScreenSaverAllowScreenSaver, EFLScreenSaverNotAllowed );
+
+    iBacklightTimer->Cancel(); // Just in case
+    // Disable backlight turn off during video preview
+    iBacklightTimer->Start( KResetInactivityTimerDelay,
+                            KResetInactivityTimerDelay,
+                            TCallBack( DoResetInactivityTimer, NULL ) );
+
+   	// Screen and clip rectangles to window dimensions
+    TPoint wndPosition( iWindow->AbsPosition() );
+    TSize wndSize( iWindow->Size() );
+
+	// iY and iHeight should be even numbers
+	if( wndPosition.iY % 2 )
+		{
+		wndPosition.iY = wndPosition.iY + 1;
+		wndSize.iHeight = wndSize.iHeight - 1;
+		}
+	if( wndSize.iHeight % 2 )
+		{
+		wndSize.iHeight = wndSize.iHeight - 1;
+		}
+
+    TRect wndRect( wndPosition, wndSize );
+
+	if( iVideoPlayer )
+		{
+		delete iVideoPlayer;
+		iVideoPlayer = NULL;
+		}
+                                            		
+    iVideoPlayer =
+		 CVideoPlayerUtility::NewL (*this, KAudioPriorityPreview,
+	 	TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra :
+                                             KAudioPrefRingFilePreview ),
+        CCoeEnv::Static()->WsSession(),
+		*(CCoeEnv::Static()->ScreenDevice()),
+		*iWindow,
+		wndRect,
+		wndRect);
+		
+	iVideoPlayerStatus = EVideoPlayerReady;     
+	
+
+	TDataType dataType;
+	TInt error( DataType( aFileName, dataType ) );
+    if( ( error != KErrNotFound ) && ( error != KErrNone ) )
+        {
+        User::Leave( error );
+        }
+
+	TPtrC ptr( aFileName );
+	if( error )
+        {
+        ptr.Set( iDefaultTone );
+        }
+
+	iVideoPlayer->OpenFileL( ptr );
+	iVideoPlayerStatus = EVideoPlayerInitializing;
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::Cancel
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::Cancel()
+    {
+    iBacklightTimer->Cancel();
+    
+    if( iVolumeRampTimer )
+	    {
+    	iVolumeRampTimer->Cancel();
+	    }
+	    
+	if( iVideoPlayer )
+		{
+		iVideoPlayer->Stop();
+		iVideoPlayer->Close();
+		iVideoPlayerStatus = EVideoPlayerReady;
+		delete iVideoPlayer;
+		iVideoPlayer = NULL;
+		}
+
+   	// Allow screen saver, unless there's a call ongoing
+   	if( !IsCallOngoing() )
+   		{
+	    // Errors ignored, no actions needed if API is not available	   	
+	   	iPropScreenSaver.Set( KPSUidScreenSaver,
+	    		KScreenSaverAllowScreenSaver, EFLScreenSaverAllowed );
+   		}
+
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::DoResetInactivityTimer()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDVideoPlayer::DoResetInactivityTimer( TAny* /*aObject*/ )
+    {
+    User::ResetInactivityTime();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::DoSetRingingType()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::DoSetRingingType( TInt aRingingType )
+    {
+    if( iVideoPlayerStatus == EVideoPlayerInitialized )
+        {
+        switch( aRingingType )
+            {
+			// Fall through
+            case ERingingTypeRinging:
+            case ERingingTypeSilent:
+            case ERingingTypeRingOnce:
+                {
+                break;
+                }
+            case ERingingTypeAscending:
+                {
+				if ( !iVolumeRampTimer )
+    				{
+        			iVolumeRampTimer = CPeriodic::New( CActive::EPriorityStandard );
+            		}
+
+        		if ( iVolumeRampTimer && !iVolumeRampTimer->IsActive() )
+        			{
+            		TCallBack cb( VolumeRampTimerCallback, this );
+        		    iRampedVolume = KFLDMinVolumeLevel;
+            		iVolumeRampTimer->Start(
+             			KAscendingVolumeRampInterval, KAscendingVolumeRampInterval, cb );
+            		}
+				break;
+                }
+             
+            default:
+                {
+                break;
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::DoVolumeRamp
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDVideoPlayer::DoVolumeRamp()
+    {
+    if ( iRampedVolume < iRingingVolume )
+        {
+        iRampedVolume = iRampedVolume + KPhoneVideoVolumeRampStep;
+        if ( iRampedVolume >= iRingingVolume )
+            {
+            // target volume level reached
+            iRampedVolume = iRingingVolume;
+            iVolumeRampTimer->Cancel();
+            }
+        }
+        
+    TRAP_IGNORE( iVideoPlayer->SetVolumeL( ConvertVolume( iRampedVolume ) ) );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::VolumeRampTimerCallback
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDVideoPlayer::VolumeRampTimerCallback( TAny* aObj )
+    {
+    return static_cast<CFLDVideoPlayer*>( aObj )->DoVolumeRamp();
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::ConvertVolume()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CFLDVideoPlayer::ConvertVolume( TInt aVolume )
+    {
+    TInt result( 0 );
+    TBool audioEnabled( EFalse );
+
+	TRAP_IGNORE( audioEnabled = iVideoPlayer->AudioEnabledL() );
+
+	if( audioEnabled )
+		{
+	    if ( iVideoPlayerStatus == EVideoPlayerInitialized ||
+    	    iVideoPlayerStatus == EVideoPlayerPlaying )
+        	{
+            result = BaseConvertVolume( aVolume, iVideoPlayer->MaxVolume() );
+
+			//if user has selected silent ringing type
+			// or beeb once, set volume off
+			if( ( iRingingType == ERingingTypeSilent ) ||
+			 ( iRingingType == ERingingTypeBeepOnce ) )
+				{
+				result = 0;
+				}
+        	}
+		}
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::MvpuoOpenComplete
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::MvpuoOpenComplete(TInt aError)
+	{
+	if ( !aError && iVideoPlayerStatus == EVideoPlayerInitializing )
+		{
+		iVideoPlayer->Prepare();
+		}
+	else
+		{
+		Cancel();
+        if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )
+            {
+            // Don't care about leave, if the note can't be displayed.
+            TRAP_IGNORE( DisplayErrorNoteL() );
+            }
+		}
+	}
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::MvpuoFrameReady
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::MvpuoFrameReady(CFbsBitmap& /*aFrame*/,TInt /*aError*/)
+	{
+
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::MvpuoEvent
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::MvpuoEvent(const TMMFEvent& /*aEvent*/)
+	{
+
+	}
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::MvpuoPrepareComplete
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::MvpuoPrepareComplete(TInt aError)
+	{
+	if ( !aError && iVideoPlayerStatus == EVideoPlayerInitializing )
+        {
+        iVideoPlayerStatus = EVideoPlayerInitialized;
+        DoSetRingingType( iRingingType );
+
+		TInt startVolume( KFLDMinVolumeLevel );
+		if( iRingingType != ERingingTypeAscending )
+			{
+			startVolume = ConvertVolume( iRingingVolume );
+			}
+		else
+			{
+			// Ascending starts from minimum volume level
+			startVolume = ConvertVolume( KFLDMinVolumeLevel );
+			}			
+		
+        TRAP_IGNORE( iVideoPlayer->SetVolumeL( startVolume ) );
+
+		// Unfortunately SetPriorityL uses always priority/preference
+		// settings which are given in videoPlayer constructor and ONLY
+		// after that sets SetPriorityL parameter to its member data
+		// which leads to a situation that we need to make SetPriorityL
+		// call twice to make new settings effect.
+        TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview,
+        	TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra :
+                                             KAudioPrefRingFilePreview ) ) );
+		TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview,
+        	TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra :
+                                             KAudioPrefRingFilePreview ) ) );                                             
+ 		iVideoPlayer->Play();
+		iVideoPlayerStatus = EVideoPlayerPlaying;
+		}
+	else
+		{
+		 Cancel();
+        if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )
+            {
+            // Don't care about leave, if the note can't be displayed.
+            TRAP_IGNORE( DisplayErrorNoteL() );
+            }
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::MvpuoPlayComplete
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::MvpuoPlayComplete(TInt aError)
+	{
+	if ( !aError && iVideoPlayerStatus == EVideoPlayerPlaying )
+		{
+		if( iRingingType != ERingingTypeRingOnce )
+			{
+			iVideoPlayer->Play();
+			}
+		else
+			{
+			Cancel();
+			iVideoPlayerStatus = EVideoPlayerReady;
+			}
+		}
+	else
+		{
+		Cancel();
+        if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )
+            {
+            // Don't care about leave, if the note can't be displayed.
+            TRAP_IGNORE( DisplayErrorNoteL() );
+            }
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::VideoResolution
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TSize CFLDVideoPlayer::VideoFrameSize() const
+    {
+    // Original implementation taken from phone application
+
+    TSize frameSize( 0,0 );
+
+    TRAPD( err, iVideoPlayer->VideoFrameSizeL( frameSize ) );
+
+    if ( err != KErrNone )
+        {
+        return TSize(0,0);
+        }
+
+    return frameSize;
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDVideoPlayer::AdjustToWindow
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CFLDVideoPlayer::AdjustToWindow( RWindow& aDisplayWindow )
+    {
+	// Original implementation taken from phone application
+
+    // Get video frame dimensions
+    TSize frameSize( VideoFrameSize() );
+
+    if ( frameSize.iWidth == 0 || frameSize.iHeight == 0  )
+        {
+        return;
+        }
+
+    // Get display dimensions
+    TPoint displayPosition( aDisplayWindow.AbsPosition() );
+    TSize  displaySize( aDisplayWindow.Size() );
+    TRect  displayRect( displayPosition, displaySize );
+
+
+    // To cover display by video:
+    // 1) Video is scaled to be >= display size
+    // 2) If scaled size > display, then video is cropped
+    // Assumption is that video can be scaled to 50,150 or 200
+    // percent from its original size (can't be scaled freely).
+
+    /////////////////////////////
+    // Calculate scaling factor
+    /////////////////////////////
+    TInt dScaleFactor(100); // use integer arithmetic
+
+    TInt xDelta( displaySize.iWidth - frameSize.iWidth );
+    TInt yDelta( displaySize.iHeight - frameSize.iHeight );
+
+    if ( xDelta == 0 && yDelta == 0 )
+        {
+        // correct size, scaling not needed
+        }
+    else if ( xDelta < 0 && yDelta == 0 )
+        {
+        // wide, but cannot downscale -> just crop
+        }
+    else if ( yDelta < 0 && xDelta == 0 )
+        {
+        // tall, but cannot downscale -> just crop
+        }
+    else if ( xDelta > 0 && yDelta > 0 )
+        {
+        // small, narrow and flat  -> enlarge
+        TInt xProp( (100 * displaySize.iWidth) / frameSize.iWidth );
+        TInt yProp( (100 * displaySize.iHeight) / frameSize.iHeight );
+
+        dScaleFactor = xProp > yProp ? xProp : yProp;
+        }
+    else if ( xDelta < 0 && yDelta < 0 )
+        {
+        // large, wide and tall -> downscale
+        TInt xProp( ( 100 * displaySize.iWidth) / frameSize.iWidth );
+        TInt yProp( ( 100 * displaySize.iHeight) / frameSize.iHeight );
+
+        dScaleFactor = xProp > yProp ? xProp : yProp;
+        }
+    else if ( xDelta > 0 && yDelta <= 0 )
+        {
+        // narrow -> enlarge
+        dScaleFactor = (100 * displaySize.iWidth) / frameSize.iWidth;
+        }
+    else if ( yDelta > 0 && xDelta <= 0 )
+        {
+        // flat  -> enlarge
+        dScaleFactor = (100 * displaySize.iHeight) / frameSize.iHeight;
+        }
+    else
+        {
+        // do nothing
+        }
+
+    // Convert to float: 0.5, 1.5, 2.0 ..
+    TInt scaleFactor( dScaleFactor / 100 );
+    TInt remainder( dScaleFactor % 100 );
+    TReal32 fScaleFactor = (TReal) scaleFactor ;
+
+    if ( scaleFactor > 0 ) // upscale
+        {
+        if ( remainder > 50 )
+            {
+            fScaleFactor = fScaleFactor + 1.0;
+            }
+        else if ( remainder > 0 )
+            {
+            fScaleFactor = fScaleFactor + 0.5;
+            }
+        else // 0
+            {
+            }
+        }
+    else // downscale
+        {
+        if ( remainder > 50 )
+            {
+            fScaleFactor = 1.0;
+            }
+        else
+            {
+            fScaleFactor = 0.5;
+            }
+        }
+
+    ////////////////////////////////////////////////
+    // Calculate scaled frame size (virtual canvas)
+    ////////////////////////////////////////////////
+    TReal32 canvasWidth = fScaleFactor * (TReal32)frameSize.iWidth;
+    TReal32 canvasHeight = fScaleFactor * (TReal32)frameSize.iHeight;
+    TSize canvasSize( (TInt)canvasWidth, (TInt)canvasHeight );
+
+    ////////////////////////////////////////////////
+    // Crop by centering displayRect to canvasRect
+    ////////////////////////////////////////////////
+    TRect canvasRect( displayPosition, canvasSize );
+    TInt offsetX = (displaySize.iWidth - canvasSize.iWidth) / 2;
+    TInt offsetY = (displaySize.iHeight - canvasSize.iHeight) / 2;
+    canvasRect.Move( offsetX, offsetY );
+
+    ////////////////////////////////////////////////
+    // Update settings to player
+    ////////////////////////////////////////////////
+    TRAP_IGNORE( iVideoPlayer->SetDisplayWindowL(
+           CCoeEnv::Static()->WsSession(),
+           *CCoeEnv::Static()->ScreenDevice(),
+           aDisplayWindow,
+           canvasRect,
+           displayRect ) );
+
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDVideoPlayer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*	Creates a video player and starts video preview
+*
+*
+*/
+
+
+#ifndef __CFLDVIDEOPLAYER_H__
+#define __CFLDVIDEOPLAYER_H__
+
+// INTERNAL INCLUDES
+#include "CFLDPlayerBase.h"
+
+// EXTERNAL INCLUDES
+#include <e32property.h>
+#include <videoplayer.h> // For MVideoPlayerUtilityObserver
+
+// FORWARD DECLARATIONS
+class RWindow;
+
+//  CLASS DECLARATION
+
+/**
+* Creates a video player and starts video preview
+*
+* @lib filelist.lib
+* @since 3.1
+*/
+NONSHARABLE_CLASS( CFLDVideoPlayer )
+	 : public CFLDPlayerBase,
+	  public MVideoPlayerUtilityObserver
+    {
+
+	  private:  // Enumerations
+
+    // These match with the ones in Profile Engine
+   		 enum TRingingTypes
+    		{
+         	ERingingTypeRinging = 0,
+         	ERingingTypeAscending,
+         	ERingingTypeRingOnce,
+         	ERingingTypeBeepOnce,
+         	ERingingTypeSilent
+         	};
+
+    	 enum TVideoPlayerStatus
+            {
+            EVideoPlayerNotCreated = 0,
+            EVideoPlayerInitializing,
+            EVideoPlayerInitialized,
+            EVideoPlayerReady,
+            EVideoPlayerPlaying
+            };
+
+		enum TFLAllowScreenSaver
+			{
+			EFLScreenSaverAllowed = 0,
+			EFLScreenSaverNotAllowed
+			};
+
+		public:     // Constructors and destructors
+
+        /**
+         * Two-phase static constructor
+         * @param aShowErrorMsgs Show an error note if the file format is not supported
+         * @return A pointer to a fully constructed CFLDVideoPlayer instance
+         */
+        static CFLDVideoPlayer* NewL( TBool aShowErrorMsgs = ETrue );
+
+        /**
+         * Destructor
+         */
+        virtual ~CFLDVideoPlayer();
+
+    private:    // Constructors and destructors
+
+        /**
+         * Constructor
+         * @param aShowErrorMsgs Show an error note if the file format is not supported
+         */
+        CFLDVideoPlayer( TBool aShowErrorMsgs);
+
+        /**
+         * Second phase constructor
+         */
+        void ConstructL();
+
+    public:		// From MFLDFileProcessor
+
+        /**
+         * Derived from MFLDFileProcessor. Starts playing the sound file
+         */
+		void ProcessFileL( const TDesC& aFileName, RWindow* aWindow );
+		
+		/**
+         * Derived from MFLDFileProcessor. Stops playing the file.
+         */
+        void Cancel();
+        
+	private:	// From MVidePlayerUtilityObserver
+		void MvpuoOpenComplete(TInt aError);
+		void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
+		void MvpuoPlayComplete(TInt aError);
+		void MvpuoEvent(const TMMFEvent& aEvent);
+		void MvpuoPrepareComplete(TInt aError);
+
+    private:    // New methods
+
+    	/** When videoplayer is ready, set its ringing type
+        * @param aRingingType The ringing type (see enum TRingingTypes)
+        */
+        void DoSetRingingType( TInt aRingingType );
+
+		/**
+        * Converts volume from 1 to 10 to audio driver understandable value.
+        * @param aVolume Volume level to be converted.
+        * @return Returns converted volume level
+        */
+		TInt ConvertVolume( TInt aVolume );
+
+		/**
+         * Callback function for ascending ringing type
+         * @param aObj Pointer to callback instance
+         */
+		static TInt VolumeRampTimerCallback( TAny* aObj );
+		/**
+         * Performs volume ramping
+         */
+		TInt DoVolumeRamp();
+		/**
+         * Performs video scaling and cropping
+         * @param aDisplayWindow Reference to window handle
+         */
+		void AdjustToWindow( RWindow& aDisplayWindow );
+		/**
+         * Returns video frame size
+         * @return size of the video frame
+         */
+		TSize VideoFrameSize() const;
+
+        /**
+        * Callback function to do inactivity timer resetting.
+        */
+        static TInt DoResetInactivityTimer( TAny* aObject );
+
+    private:	// Data
+
+    	/// Own: video player
+    	CVideoPlayerUtility* iVideoPlayer;
+        /// Own: Ascending volume timer
+        CPeriodic* iVolumeRampTimer;
+        /// Ref: handle to window
+        RWindow* iWindow;
+		/// Player state
+        TVideoPlayerStatus iVideoPlayerStatus;
+        /// Ascending volume
+        TInt iRampedVolume;
+
+        /**
+		* Pub&Sub property.
+		* For setting the state of the screen saver.
+		*/
+        RProperty iPropScreenSaver;
+
+        /**
+		* Timer for resetting the user inactivity timeout
+		*/
+		CPeriodic* iBacklightTimer;
+
+    };
+
+#endif      //  __CFLDVIDEOPLAYER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDWaitNote.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CFLDWaitNote.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CFLDWaitNote.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CFLDWaitNote::CFLDWaitNote
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CFLDWaitNote::CFLDWaitNote( const TInt aWaitNoteResourceId )
+	: iWaitNoteResourceId (aWaitNoteResourceId)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDWaitNote::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CFLDWaitNote* CFLDWaitNote::NewL( const TInt aWaitNoteResourceId )
+    {
+    CFLDWaitNote* self = new (ELeave) CFLDWaitNote( aWaitNoteResourceId );
+    return self;
+    }
+
+// Destructor
+CFLDWaitNote::~CFLDWaitNote()
+    {
+    if( iWaitDialog )
+        {
+        // Do not delete CAknWaitDialog object:
+        // CAknWaitDialog::ProcessFinishedL should be used instead.
+        TRAP_IGNORE( iWaitDialog->ProcessFinishedL() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDWaitNote::DialogDismissedL
+// Gets called when the dialog is dismissed/closed.
+// -----------------------------------------------------------------------------
+//
+void CFLDWaitNote::DialogDismissedL( const TInt /*aButtonId*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDWaitNote::CloseWaitNoteL
+// Close the wait note dialog.
+// -----------------------------------------------------------------------------
+//
+void CFLDWaitNote::CloseWaitNoteL()
+    {
+    // Close and delete the wait note dialog,
+    // if it has not been dismissed yet
+    if( iWaitDialog )
+        {
+        iWaitDialog->ProcessFinishedL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDWaitNote::OpenWaitNoteL
+// Open the wait note dialog.
+// -----------------------------------------------------------------------------
+//
+void CFLDWaitNote::OpenWaitNoteL()
+    {
+    CloseWaitNoteL();
+
+    // Create and view the wait note dialog
+    iWaitDialog = new (ELeave) CAknWaitDialog(
+        reinterpret_cast<CEikDialog**>( &iWaitDialog ) );
+    iWaitDialog->SetCallback( this );
+    iWaitDialog->ExecuteLD( iWaitNoteResourceId ); // CSI: 50 # Pointer to iWaitDialog variable is given to iWaitDialog itself, so won't dare to set it NULL below
+    }
+
+// -----------------------------------------------------------------------------
+// CFLDWaitNote::IsRunning
+// Gets called by the model to see if the wait note (refresh) is already running.
+// -----------------------------------------------------------------------------
+//
+TBool CFLDWaitNote::IsRunning()
+    {
+    if( iWaitDialog == NULL )
+        {
+        return EFalse;
+        }
+    else
+        {
+        return ETrue;
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/CFLDWaitNote.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implements wait note when CLF is refreshed.
+*
+*/
+
+
+
+#ifndef __CFLDWAITNOTE_H__
+#define __CFLDWAITNOTE_H__
+
+//  EXTERNAL INCLUDES
+#include <e32base.h>
+#include <AknWaitDialog.h>
+#include <AknWaitNoteWrapper.h>
+
+// CLASS DECLARATION
+
+/**
+*	Implements wait note when CLF is refreshed
+*/
+NONSHARABLE_CLASS( CFLDWaitNote )
+    : public CBase,
+      public MProgressDialogCallback
+    {
+    public:  // Constructors and destructor
+
+		/**
+		 * Creates and returns a new instance of this class.
+	     * @param aResourceId Wait note resource id
+		 * @return Pointer to the CFLDWaitNote object
+		 */
+	    static CFLDWaitNote* NewL( const TInt aWaitNoteResourceId );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CFLDWaitNote();
+
+    private:    // Constructors
+        /**
+        * C++ default constructor.
+        */
+        CFLDWaitNote( const TInt aWaitNoteResourceId );
+
+    protected:  // Methods derived from MProgressDialogCallback
+        
+        void DialogDismissedL( const TInt aButtonId );
+
+    public:     // New functions
+
+        /**
+        * Close the wait note dialog.
+        */
+        void CloseWaitNoteL();
+
+        /**
+        * Open the wait note dialog.
+        */
+        void OpenWaitNoteL();
+
+        /**
+        * Is wait note running.
+        */
+        TBool IsRunning();
+
+    private:    // Data
+
+        /// Own: Wait note dialog for indicating refresh operation
+        /// of the List Model (owned)
+		CAknWaitDialog* iWaitDialog;
+		
+		/// Wait note resource
+		const TInt iWaitNoteResourceId;
+
+    };
+
+#endif // __CFLDWAITNOTE_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/FLDListBoxTemplate.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Template for a listbox class which forwards listbox events
+*                to an observer.
+*
+*/
+
+
+#ifndef FLDLISTBOXTEMPLATE_H
+#define FLDLISTBOXTEMPLATE_H
+
+#include <coedef.h> // TKeyResponse
+#include <w32std.h> // TKeyEvent, TEventCode
+#include "MFLDFileListBoxObserver.h"
+#include "CFLDFileListModel.h"
+#include "CFLDPopupList.h"
+
+// CLASS DECLARATION
+
+/**
+*  Template for a listbox class which forwards listbox events to an observer.
+*
+*  @lib filelist.lib
+*  @since Series 60 2.6
+*/
+template<class T>
+class FLDListBoxTemplate : public T
+    {
+    public:     // Constructors and destructor
+
+        /**
+        * Constructor
+        */
+        FLDListBoxTemplate(
+            MFLDFileListBoxObserver& aObserver, CFLDFileListModel& aModel )
+            : iObserver( aObserver ), iModel( aModel ) {}
+
+        virtual ~FLDListBoxTemplate()
+            {
+            iObserver.HandleFileListBoxEventL(
+                MFLDFileListBoxObserver::EListBoxClosed );
+            }
+
+	public:		// New functions
+	
+		/**
+		* Sets populist
+		*/
+		void SetListBox( CFLDPopupList* aPopupList )
+			{
+			iPopupList = aPopupList;
+			}
+
+    public:     // Functions from base classes
+
+        /**
+        * Method modified to send listbox events to an observer, when
+        * focus changes from one list item to another
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+            {
+            /// Current softkeystate
+			MFLDFileListBoxObserver::TFileListSoftKeyState softKeyState;
+	        iObserver.HandleSoftKeyState( softKeyState );
+	        
+            if( aType == EEventKey )
+                {
+                // Get current item index
+                TInt oldIndex( T::CurrentItemIndex() );
+                // Call OfferKeyEventL
+                TKeyResponse response( T::OfferKeyEventL( aKeyEvent, aType ) );
+                // Get new item index
+                TInt newIndex( T::CurrentItemIndex() );
+                // Get current filename
+                TFileName filename;
+            	iModel.GetFileName( filename, T::CurrentItemIndex() );
+                // Compare new and old index
+                if( oldIndex != newIndex )
+                    {
+                    // Notify focus change if focus changes
+                    iObserver.HandleFileListBoxEventL(
+                        MFLDFileListBoxObserver::EFocusChanged, filename );
+
+#ifdef RD_VIDEO_AS_RINGING_TONE	             
+					// When video is drawn over popuplist and user changes focus
+					// or interrupts the video by using other key
+					//  screen must be forced to be redrawn	                
+					if( ( iPopupList ) &&
+					 ( softKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) )
+						{
+                        // Set the vertical scroll bar and listbox to not dimmed.
+                        if ( iPopupList )
+                            {
+                            iPopupList->ListBox()->SetDimmed( EFalse );
+                            iPopupList->ListBox()->ScrollBarFrame()->
+                                VerticalScrollBar()->SetDimmed( EFalse );                            
+                            }
+
+						iPopupList->DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
+						}	
+#endif                        
+                    }
+                else
+                    {
+#ifdef RD_VIDEO_AS_RINGING_TONE	                    
+	                if( ( iModel.MediaFileType( filename ) == ECLFMediaTypeVideo ) &&
+	                    ( aKeyEvent.iScanCode == EStdKeyDevice3 ) )
+    	            	{
+    	                // Do not notify observer
+    	                // when joystick key is pressed
+    	                // and current file is a video file
+	                    }
+	                else
+	                	{
+   	                	iObserver.HandleFileListBoxEventL(
+	   	                	MFLDFileListBoxObserver::EOtherKeyEvent );
+	   	                	
+ 						// When video is drawn over popuplist and user changes focus
+						// or interrupts the video by using other key
+						//  screen must be forced to be redrawn	                
+						if( ( iPopupList ) &&
+					 	 ( softKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) )
+							{
+                            // Set the vertical scroll bar and listbox to not dimmed.
+                            if ( iPopupList )
+                                {
+                                iPopupList->ListBox()->SetDimmed( EFalse );
+                                iPopupList->ListBox()->ScrollBarFrame()->
+                                    VerticalScrollBar()->SetDimmed( EFalse );                            
+                                }
+
+							iPopupList->DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
+							}		                	
+	                	}
+            
+#else
+					iObserver.HandleFileListBoxEventL(
+	   	                	MFLDFileListBoxObserver::EOtherKeyEvent );
+#endif	                	
+	                }
+                return response;
+                }
+            return T::OfferKeyEventL( aKeyEvent, aType );
+            }
+
+    private:    // Data
+
+        /// Ref: The list box observer, which gets notified about list item focus changes
+        MFLDFileListBoxObserver& iObserver;
+
+        /// Ref: File list model
+        CFLDFileListModel& iModel;
+        
+        /// Ref: File list popuplist
+        CFLDPopupList* iPopupList;
+
+    };
+
+#endif // FLDLISTBOXTEMPLATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/MFLDEntryFormatter.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     MFLDEntryFormatter defines an abstract interface to create
+*     formatted presentations of directory entries
+*
+*
+*/
+
+
+
+#ifndef __MFLDENTRYFORMATTER_H__
+#define __MFLDENTRYFORMATTER_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CFLDEntryReference;
+
+// CLASS DEFINITION
+
+/**
+* MFLDEntryFormatter defines an abstract interface to create
+* formatted presentations of directory entries
+*/
+class MFLDEntryFormatter
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Destructor.
+        */
+        virtual ~MFLDEntryFormatter() {}
+
+    public: // New functions
+
+        /**
+        * Formats a single entry
+        * @param aEntry The entry to be formatted
+        */
+        virtual void FormatL( CFLDEntryReference& aEntry ) = 0;
+
+        /**
+        * Formats a null item text (see CFLDFileListModel::InsertNullItemL).
+        * Default implementation does no modifications to the given text
+        * (to maintain BC).
+        * @param aText The text to be formatted.
+        * @return Returns an allocated formatted HBufC.
+        *         Ownership is returned to the caller.
+        * @since Series 60 2.6
+        */
+        virtual HBufC* FormatTextLC( const TDesC& aText )
+            { return aText.AllocLC(); }
+
+    };
+
+#endif      //  __MFLDENTRYFORMATTER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/MFLDFileObserver.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract interface for check media files.
+*
+*/
+
+
+
+#ifndef MFLDFILEOBSERVER_H
+#define MFLDFILEOBSERVER_H
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+
+// CLASS DEFINITION
+
+/**
+*  Abstract interface for check media files.
+*
+*  @lib filelist.lib
+*  @since 2.1
+*/
+class MFLDFileObserver
+    {
+    public: // Enumerations
+
+        // An enumeration which tells what is the file used for.
+        enum TIntention
+            {
+            EPlay = 1,
+            ESelect = 2
+            };
+
+    public: // New functions
+
+        /**
+        * An abstract function for checking if a file is valid.
+        * @since 2.1
+        * @param aFileName Full path and filename.
+        * @param aIntention Describes what is the file used for.
+        * @return Returns ETrue if the file is valid for intended use.
+        */
+        virtual TBool IsFileValidL(
+            const TDesC& aFileName,
+            TIntention aIntention ) = 0;
+
+		/**
+        * An abstract function for checking media type
+        * @since 3.1
+        * @param aFileName Full path and filename.
+        * @return Returns media type
+        */
+        virtual TInt32 MediaFileType(
+         const TDesC& aFileName ) const = 0;
+
+    protected:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MFLDFileObserver() {}
+
+    };
+
+#endif      // MFLDFILEOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/Src/MFLDFileProcessor.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     MFLDFileProcessor defines an abstract interface for processing
+*     files (e.g. playing sound files or displaying image files).
+*
+*
+*/
+
+
+
+#ifndef __MFLDFILEPROCESSOR_H__
+#define __MFLDFILEPROCESSOR_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+
+// CLASS DEFINITION
+
+// FORWARD DECLARATIONS
+class RWindow;
+
+/**
+* MFLDFileProcessor defines an abstract interface for processing
+* files (e.g. playing sound files or displaying image files).
+*/
+class MFLDFileProcessor
+    {
+    public:     // Constructors and destructors
+
+        /**
+        * Destructor.
+        */
+        virtual ~MFLDFileProcessor() {}
+
+    public:     // New methods
+
+        /**
+        * Starts processing a file (e.g. playing a sound file)
+        * @param aFileName The file name to be processed
+        */
+        virtual void ProcessFileL( const TDesC& aFileName, RWindow* aWindow ) = 0;
+
+        /**
+        * Cancels processing a file (e.g. stop playing a sound file)
+        */
+        virtual void Cancel() = 0;
+        
+         /**
+        * Set the volume level on which the sound is played
+        * @param aVolume The volume level
+        */
+        virtual void SetVolume( TInt aVolume ) = 0;
+
+        /**
+        * Sets the ringing type
+        * @param aRingingType The ringing type (see enum TRingingTypes)
+        */
+        virtual void SetRingingType( TInt aRingingType ) = 0;
+
+        /**
+        * Sets vibrating alert on or off.
+        * @param aVibra True: Vibra is on. False: Vibra is off.
+        */
+        virtual void SetVibra( TBool aVibra ) = 0;
+        
+          /**
+        * Sets 3d-effects on or off.
+        * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off.
+        */
+        virtual void Set3dEffects( TBool a3dEffects ) = 0;
+
+    };
+
+#endif      //  __MFLDFILEPROCESSOR_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/group/FileList.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is project specification file for the File List.
+*
+*/
+
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          FileList.dll
+TARGETTYPE      DLL
+UID             0x1000008d 0x101f4678
+VENDORID 	VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH  ../Src
+SOURCE      CFLDFileListModel.cpp
+SOURCE      CFLDController.cpp
+SOURCE      CFLDPlayerBase.cpp
+SOURCE      CFLDRingingTonePlayer.cpp
+SOURCE      CFLDFileListContainer.cpp
+SOURCE      CFLDEntryReference.cpp
+SOURCE      CFLDPopupList.cpp
+SOURCE      CFLDBrowserLauncher.cpp
+SOURCE      CFLDCommandAbsorbingControl.cpp
+SOURCE      CFLDSingleGraphicEntryFormatter.cpp
+SOURCE      CFLDDRMImplementationCommon.cpp // Common DRM implementation
+
+SOURCE      CFLDDRMImplementation.cpp       // Full OMA DRM support
+LIBRARY     drmhelper.lib
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+SOURCE		CFLDVideoPlayer.cpp
+SOURCE		CFLDSoftKeyChanger.cpp
+#endif
+
+SOURCE		CFLDOperationObserver.cpp
+SOURCE		CFLDWaitNote.cpp
+SOURCE		CFLDChangedItemObserver.cpp
+
+USERINCLUDE     ../Inc ../Src ../group
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc  // subsystem internal includes
+
+START RESOURCE  ../group/FileList.rss
+  HEADER
+  TARGETPATH    RESOURCE_FILES_DIR
+  LANGUAGE_IDS
+END
+
+LIBRARY     apgrfx.lib  // RApaLsSession
+LIBRARY     apmime.lib  // TDataType
+LIBRARY     avkon.lib
+LIBRARY     bafl.lib
+LIBRARY     cone.lib
+LIBRARY     efsrv.lib
+LIBRARY     eikcoctl.lib
+LIBRARY     euser.lib
+LIBRARY     mediaclientaudio.lib
+LIBRARY     commonengine.lib
+LIBRARY     eikcore.lib
+LIBRARY     AknSkins.lib
+LIBRARY     FeatMgr.lib
+LIBRARY     platformenv.lib
+LIBRARY     browserlauncher.lib
+LIBRARY     CommonUI.lib // Document Handler
+LIBRARY		centralrepository.lib
+LIBRARY 	CenRepNotifHandler.lib
+LIBRARY     servicehandler.lib // CAiwGenericParamList
+LIBRARY	    ws32.lib // RWindow methods
+LIBRARY     ecom.lib	            // ECom
+LIBRARY     ProfileEng.lib
+
+LIBRARY		ContentListingFramework.lib
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+LIBRARY		mediaclientvideo.lib
+#endif
+
+LIBRARY		egul.lib	// CGulIcon 
+
+LIBRARY     DRMCommon.lib
+LIBRARY     DrmRights.lib
+
+#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+LIBRARY		drmutility.lib
+#endif
+
+LIBRARY		caf.lib	cafutils.lib // Content access framework
+LIBRARY		DrmAudioPlayUtility.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/group/FileList.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,184 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains all the resources for the FileList module.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    FLDR // 4 letter ID
+
+// INTERNAL INCLUDES
+#include "FileListModel.rh"	// For FILELISTDIRECTORIES
+#include <filelist.loc>
+
+// EXTERNAL INCLUDES
+#include <eikon.rh>
+#include <pathconfiguration.hrh>	// For text_rom_root_path
+#include <avkon.loc>
+#include <drmcommon.loc>
+#include <avkon.hrh> // For EAknSoftkeyOptions
+#include <avkon.rh>	// For AVKON_NOTE
+#include <avkon.rsg>	// For R_AVKON_SOFTKEYS_EMPTY
+#include <CLFContentListing.rh>
+#include <CLFContentListing.hrh>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF r_fld_qtn_profiles_error_not_enough_memory
+    {
+    buf = qtn_profiles_error_not_enough_memory;
+    }
+
+RESOURCE TBUF r_fld_qtn_file_format_error
+    {
+    buf = qtn_file_format_error;
+    }
+
+RESOURCE TBUF r_fld_qtn_profiles_download_tones
+    {
+    buf = qtn_profiles_download_tones;
+    }
+
+RESOURCE TBUF r_fld_qtn_drm_prev_rights_use
+    {
+    buf = qtn_drm_prev_rights_use;
+    }
+
+RESOURCE TBUF r_fld_qtn_drm_prev_rights_set
+    {
+    buf = qtn_drm_prev_rights_set;
+    }
+
+RESOURCE TBUF r_fld_qtn_profiles_info_tone_no_drm
+    {
+    buf = qtn_profiles_info_tone_no_drm;
+    }
+
+RESOURCE TBUF r_fld_qtn_drm_prof_rights_missing
+    {
+    buf = qtn_drm_prof_rights_missing;
+    }
+    
+RESOURCE TBUF r_fld_qtn_text_not_allowed
+	{
+	buf = text_not_allowed;
+	}
+
+RESOURCE TBUF r_fld_qtn_profiles_info_tone_drm_protected
+	{
+	buf = qtn_profiles_info_tone_drm_protected;
+	}
+	
+RESOURCE TBUF r_fld_qtn_drm_mgr_det_exp
+	{
+	buf = qtn_drm_mgr_det_exp;
+	}
+
+#ifdef RD_VIDEO_AS_RINGING_TONE	
+RESOURCE TBUF r_fld_qtn_text_softkey_preview
+    {
+    buf = text_softkey_preview;
+    }	            
+
+RESOURCE TBUF r_fld_qtn_text_softkey_preview_select
+    {
+    buf = text_softkey_select;
+    }
+    
+RESOURCE TBUF r_fld_qtn_text_softkey_back
+    {
+    buf = text_softkey_back;
+    }
+    
+RESOURCE TBUF r_fld_qtn_text_softkey_cancel
+    {
+    buf = text_softkey_cancel;
+    }
+#endif
+
+RESOURCE DIALOG r_fld_wait_note
+    {
+    flags = EAknWaitNoteFlags;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtNote;
+            id = EGeneralNote;
+            control = AVKON_NOTE
+                {
+                layout = EWaitLayout;
+                singular_label = qtn_gen_note_opening;
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+                };
+            }
+        };
+    }
+
+RESOURCE FILELISTDIRECTORIES r_fld_directories
+    {
+    // Scan these ROM directories
+    RomDirectories =
+        {
+        LBUF { txt = text_rom_root_path text_sounds_path; },
+        LBUF { txt = text_rom_root_path text_digital_sounds_path; },
+        LBUF { txt = text_rom_root_path text_simple_sounds_path; }
+#ifdef RD_VIDEO_AS_RINGING_TONE
+        ,LBUF { txt = text_rom_root_path text_videos_path; }
+#endif
+        };
+    
+    // Scan these these phone directories 
+  	PhoneDirectories =
+        {
+        };        
+    }
+    
+RESOURCE CLF_LIST_MODEL r_fld_list_model
+	{
+	mime_type_array = CLF_MIME_TYPE_ARRAY
+	 {
+         mime_types =
+             {
+             };
+         };
+
+     media_type_array = CLF_MEDIA_TYPE_ARRAY
+         {
+         media_types =
+             {
+#ifdef RD_VIDEO_AS_RINGING_TONE              
+             CLF_MEDIA_TYPE { media_type = ECLFMediaTypeVideo; },
+#endif
+             CLF_MEDIA_TYPE { media_type = ECLFMediaTypeMusic; },
+             CLF_MEDIA_TYPE { media_type = ECLFMediaTypeSound; }     
+             };
+         };
+         
+     sorting_style = CLF_SORTING_STYLE
+         {
+         ordering = ECLFOrderingAscending;
+         data_type = ECLFItemDataTypeDesC;
+         fields =
+             {
+             CLF_FIELD_ID { field_id = ECLFFieldIdFileName; }
+             };
+         };
+     }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file provides the information required for building
+*     File List.
+*
+*/
+
+
+// To get the APP_LAYER_DOMAIN_EXPORT_PATH-definition
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE filelist.mif
+  OPTION HEADERFILE filelist.mbg
+  OPTION SOURCES -c8,8 qgn_indi_fmgr_ms_add
+END
+
+
+PRJ_MMPFILES
+
+//gnumakefile filelist_icons_aif_scalable_dc.mk
+
+FileList.mmp
+
+PRJ_EXPORTS
+../rom/filelist.iby		CORE_APP_LAYER_IBY_EXPORT_PATH(filelist.iby)
+../rom/filelistResources.iby	LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(filelistResources.iby)
+../loc/FileList.loc		APP_LAYER_LOC_EXPORT_PATH(filelist.loc)
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/group/filelist_icons_aif_scalable_dc.mk	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,70 @@
+#
+# Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Icons makefile for project FileList.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# : Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\filelist.mif
+HEADERFILENAME=$(HEADERDIR)\filelist.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# : Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_indi_fmgr_ms_add.svg \
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/loc/FileList.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for FileList module.
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined.
+*
+*
+*/
+
+
+//d: Error message text for non-supported file formats
+//l: popup_note_window
+//
+#define qtn_file_format_error "Tone format not supported"
+
+//d: The first item in the tone selection list.
+//d: Launches browser for downloading new tones.
+//l: list_single_graphic_pane_t1_cp2
+//
+#define qtn_profiles_download_tones "Download tones"
+
+//d: Softkey label for previewing video files
+//l: control_pane_t1/opt7
+//w:
+//r:3.1
+#define text_softkey_preview "Preview"
+
+//d: Error message text for non-supported file formats
+//l: popup_note_window
+//w:
+//r:3.1
+#define qtn_profiles_info_tone_drm_protected "Protected file. Cannot be selected as ringing tone."
+
+//d: Error message indicating that because of a lack of memory, only
+//d: tones on ROM will be displayed.
+//l: popup_note_window
+//w:
+//r:5.0
+#define qtn_profiles_error_not_enough_memory "Not enough memory to display all tones. Only tones in ROM memory are displayed."
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/rom/filelist.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: IBY files for FileList
+*
+*/
+
+#ifndef __FILELIST_IBY__
+#define __FILELIST_IBY__
+
+file=ABI_DIR\BUILD_DIR\FileList.dll         SHARED_LIB_DIR\FileList.dll
+
+data=DATAZ_\BITMAP_DIR\filelist.mif         BITMAP_DIR\filelist.mif
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/rom/filelistResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: IBY files for FileList resources.
+*
+*/
+#ifndef __FILELIST_RESOURCES_IBY__
+#define __FILELIST_RESOURCES_IBY__
+
+//resourcefile for FileList (filelist.iby)
+data=ZRESOURCE\FILELIST.RSC                                          RESOURCE_FILES_DIR\FILELIST.RSC
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/bwins/T_CFLDFileListu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/eabi/T_CFLDFileListu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,7 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+	_ZTI16T_CFLDController @ 2 NONAME ; #<TI>#
+	_ZTI23T_CFLDFileListContainer @ 3 NONAME ; #<TI>#
+	_ZTV16T_CFLDController @ 4 NONAME ; #<VT>#
+	_ZTV23T_CFLDFileListContainer @ 5 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/group/FLDTest.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains all the resources for the FLDTest.
+*     ?description_line
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    FLDT // 4 letter ID
+
+// INTERNAL INCLUDES
+#include "FileListModel.rh"	// For FILELISTDIRECTORIES
+
+// EXTERNAL INCLUDES
+#include <eikon.rh>
+#include <CLFContentListing.rh>
+#include <CLFContentListing.hrh>
+
+//  CONSTANTS
+
+//  MACROS
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE { }
+
+
+RESOURCE FILELISTDIRECTORIES r_fld_test_rom_model
+    {
+    RomDirectories =
+        {
+        LBUF { txt = text_rom_root_path text_sounds_path; },
+        LBUF { txt = text_rom_root_path text_digital_sounds_path; },
+        LBUF { txt = text_rom_root_path text_simple_sounds_path; }
+        };
+  	PhoneDirectories =
+        {
+        };  
+    }
+    
+RESOURCE CLF_LIST_MODEL r_fld_test_model1
+	{
+	mime_type_array = CLF_MIME_TYPE_ARRAY
+	 {
+         mime_types =
+             {
+             };
+         };
+
+     media_type_array = CLF_MEDIA_TYPE_ARRAY
+         {
+         media_types =
+             {
+             CLF_MEDIA_TYPE { media_type = ECLFMediaTypeMusic; },
+             CLF_MEDIA_TYPE { media_type = ECLFMediaTypeSound; },
+             CLF_MEDIA_TYPE { media_type = ECLFMediaTypeVideo; }
+             };
+         };
+         
+     sorting_style = CLF_SORTING_STYLE
+         {
+         ordering = ECLFOrderingAscending;
+         data_type = ECLFItemDataTypeDesC;
+         fields =
+             {
+             CLF_FIELD_ID { field_id = ECLFFieldIdFileName; }
+             };
+         };
+     }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/group/T_CFLDFileList.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is project specification file for the FileList test cases.
+*
+*/
+
+////////////////////////////////////////////////////////////
+// T_CFLDFileList.mmp
+//
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+// DEFINES
+#define         KEUnitUid3 0x1000af59
+#define         KEUnitTestDllUid2 0x1000af5a
+
+// Build target
+TARGET          T_CFLDFileList.dll
+TARGETTYPE      DLL
+TARGETPATH      ../../../../wins/c/DigiaEUnit/Tests
+UID             KEUnitTestDllUid2 KEUnitUid3
+
+LANG        SC
+
+CAPABILITY      ALL -TCB
+
+// Source files location
+SOURCEPATH  .
+
+// Source files
+SOURCEPATH  	../src
+SOURCE          T_CFLDDllMain.cpp
+SOURCE          T_CFLDController.cpp
+SOURCE          T_CFLDFileListContainer.cpp
+
+// Include paths
+USERINCLUDE     .
+USERINCLUDE     ../inc
+USERINCLUDE     ../../../../src
+USERINCLUDE     ../../../../inc
+SYSTEMINCLUDE   /epoc32/include/Digia/EUnit
+APP_LAYER_SYSTEMINCLUDE
+
+START RESOURCE  ../group/FLDTest.rss
+  HEADER
+  TARGETPATH    RESOURCE_FILES_DIR
+END
+
+// Dependencies to system components
+LIBRARY         EUnit.lib
+LIBRARY         EUnitutil.lib
+LIBRARY         FileList.lib
+LIBRARY         avkon.lib
+LIBRARY         bafl.lib
+LIBRARY         cone.lib
+LIBRARY         efsrv.lib
+LIBRARY         euser.lib
+LIBRARY         commonengine.lib
+LIBRARY         ws32.lib
+
+// dependencies for tested classes
+LIBRARY         eikcoctl.lib
+LIBRARY         eikcore.lib
+LIBRARY         CommonUI.lib // Document Handler
+LIBRARY         apmime.lib // TDataType
+LIBRARY    	servicehandler.lib // CAiwGenericParamList
+LIBRARY		platformenv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file provides the information required for building
+*     FileList test cases.
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+// Part of EUnit library test
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_TESTEXPORTS
+
+PRJ_TESTMMPFILES
+    T_CFLDFileList.mmp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/inc/FLDTestConst.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*  Constant definitions for FileList test cases.
+*
+*
+*/
+
+
+#ifndef __FLDTestConst_H__
+#define __FLDTestConst_H__
+
+// INCLUDES
+
+//  CONSTANTS
+_LIT( KFLDResourceFile, "z:\\Resource\\FLDTest.rSC" );
+_LIT( KFLDTestNullItem, "Nulltext" );
+_LIT( KFLDTestNullItemRingingTone, "c:\\data\\sounds\\digital\\test.wav" );
+
+#endif      //  __FLDTestConst_H__
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/inc/T_CFLDController.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  CFLDController test class.
+*
+*
+*/
+
+
+#ifndef __T_CFLDController_H__
+#define __T_CFLDController_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+//  FORWARD DECLARATIONS
+class CFLDController;
+
+//  CLASS DEFINITION
+
+/*
+-----------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    Test suite for class CEUnitTestCase.
+
+-----------------------------------------------------------------------------
+*/
+class T_CFLDController
+    : public CEUnitTestSuiteClass
+    {
+    public:		// Constructors and destructors
+        static T_CFLDController* NewLC();
+        ~T_CFLDController();
+
+    private:	// New methods
+        T_CFLDController();
+        void ConstructL();
+
+    private:    // Test case functions
+        void SetupL();
+        void EmptySetupL();
+        void Teardown();
+
+        // tests:
+        void TestCreateObjectL();
+
+        void HandleFileListBoxEventTestL();
+        void SetDelayTestL();
+
+        void SetVolumeTestL();
+        void SetRingingTypeTestL();
+        void SetVibraTestL();
+        void Set3dEffectsTestL();
+        void SetFileObserverTestL();
+
+    private:  // Implementation
+        EUNIT_DECLARE_TEST_TABLE;
+
+    private:	// Data
+        CFLDController* iController; // own
+    };
+
+#endif      //  __T_CFLDController_H__
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/inc/T_CFLDFileListContainer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  CFLDFileListContainer test class.
+*
+*
+*/
+
+
+#ifndef __T_CFLDFileListContainer_H__
+#define __T_CFLDFileListContainer_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <coneresloader.h>
+#include <W32STD.H>
+
+#include <f32file.h>
+#include <badesca.h>
+#include <CLFContentListing.hrh>
+
+
+class CFLDFileListContainer;
+
+//  CLASS DEFINITION
+
+/*
+-----------------------------------------------------------------------------
+
+    DESCRIPTION
+
+    Test suite for class CEUnitTestCase.
+
+-----------------------------------------------------------------------------
+*/
+class T_CFLDFileListContainer
+    : public CEUnitTestSuiteClass
+    {
+    public:		// Constructors and destructors
+        static T_CFLDFileListContainer* NewLC();
+        ~T_CFLDFileListContainer();
+
+    private:	// New methods
+        T_CFLDFileListContainer();
+        void ConstructL();
+
+    private:    // Test case functions
+        void EmptySetupL();
+        void SetupL();
+        void Teardown();
+
+        // tests:
+        void TestCreateObjectL();
+
+        void LaunchTestL();
+        void InsertNullItemTestL();
+        void InsertEndNullItemTestL();
+        void SetDelayTestL();
+        void SetVolumeTestL();
+        void SetRingingTypeTestL();
+        void SetVibraTestL();
+
+		void SetAutomatedTypeTestL();
+		void Set3dEffectsTestL();
+		void SetMaxFileSizeTestL();
+		
+		void AddExclusiveMimeTypeTestL();
+		void AddExclusiveMediaTypeTestL();
+		void SetWantedMimeTypesTestL();
+		void SetWantedMediaTypesTestL();
+		void ResetExclusiveMimeTypesTestL();
+		void ResetExclusiveMediaTypesTestL();
+
+    private:  // Implementation
+        EUNIT_DECLARE_TEST_TABLE;
+
+    private:	// Data
+    	RConeResourceLoader* iResourceLoader;
+        
+        CFLDFileListContainer* iContainer;
+        CFLDFileListContainer* iContainer1;
+        CFLDFileListContainer* iContainer2;
+        CFLDFileListContainer* iContainer3;
+        CFLDFileListContainer* iContainer4;
+        CFLDFileListContainer* iContainer5;
+        RWsSession iWsSession;
+
+        CDesCArray* iMimeTypeArray;
+        RArray<TCLFMediaType> iMediaTypeArray;
+
+    };
+
+#endif      //  __T_CFLDFileListContainer_H__
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/rom/FileList_ats3.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  ROM image definition for FileList automated tests
+*       
+*
+*/
+
+#ifndef __FILELIST_ATS3_IBY__
+#define __FILELIST_ATS3_IBY__
+
+// THESE ARE INCLUDED IN PROFILESAPPLICATION_ATS3_IBY
+
+//file=ABI_DIR\BUILD_DIR\T_CFLDFileList.dll	SHARED_LIB_DIR\T_CFLDFileList.dll
+// Resource file for FileList tests
+//data=ZRESOURCE\FLDTEST.RSC            RESOURCE_FILES_DIR\FLDTEST.RSC
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/src/T_CFLDController.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  CFLDController test class.
+*
+*
+*/
+
+
+//  Include Files
+#include "T_CFLDController.h"
+#define private public
+#define protected public
+#include "CFLDController.h"
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+#include <CEUnitAllocTestCaseDecorator.h>
+
+namespace
+	{
+	// Default delay 1000000 = 1sec
+	const TInt KDefaultDelay( 1000000 );
+	}
+
+// CONSTRUCTION
+// Static constructor
+T_CFLDController* T_CFLDController::NewLC()
+    {
+    T_CFLDController* self = new(ELeave) T_CFLDController;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+T_CFLDController::~T_CFLDController()
+    {
+    delete iController;
+    iController = NULL;
+    }
+
+// Second phase construct
+void T_CFLDController::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_CFLDController::T_CFLDController()
+    {
+    }
+
+//---------------------------------------------------------------
+//----------------- TEST CASE METHODS ---------------------------
+//---------------------------------------------------------------
+
+//  METHODS
+
+// Setup nothing.
+void T_CFLDController::EmptySetupL()
+    {
+    }
+
+void T_CFLDController::SetupL()
+    {
+    EmptySetupL();
+    TBool showErrorMsgs( ETrue );
+ 
+    iController = CFLDController::NewL( showErrorMsgs, KDefaultDelay );
+    }
+
+// Teardown nothing.
+void T_CFLDController::Teardown()
+    {
+    delete iController;
+    iController = NULL;
+    }
+
+// CREATIONAL TESTS
+void T_CFLDController::TestCreateObjectL()
+    {
+    TBool showErrorMsgs( ETrue );
+    
+    CFLDController* controller = NULL;
+    controller = CFLDController::NewL( showErrorMsgs, KDefaultDelay );
+    delete controller;
+    controller = NULL;
+
+    controller = CFLDController::NewLC( showErrorMsgs, KDefaultDelay );
+    if( controller )
+    	{
+    	RWindow *dummy = NULL;
+    	controller->CompleteConstructionL( *dummy );
+    	}
+    CleanupStack::Pop( controller );
+    delete controller;
+    }
+
+void T_CFLDController::SetDelayTestL()
+    {
+    __UHEAP_MARK;
+    iController->SetDelay( 1000000 );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDController::SetVolumeTestL()
+    {
+    __UHEAP_MARK;
+    iController->SetVolume( 1 );
+    __UHEAP_MARKEND;
+    }
+void T_CFLDController::SetRingingTypeTestL()
+    {
+    __UHEAP_MARK;
+    iController->SetRingingType( 1 );
+    __UHEAP_MARKEND;
+    }
+void T_CFLDController::SetVibraTestL()
+    {
+    __UHEAP_MARK;
+    iController->SetVibra( EFalse );
+    __UHEAP_MARKEND;
+    }
+void T_CFLDController::Set3dEffectsTestL()
+    {
+    __UHEAP_MARK;
+    iController->Set3dEffects( EFalse );
+    __UHEAP_MARKEND;
+    }
+void T_CFLDController::SetFileObserverTestL()
+    {
+    __UHEAP_MARK;
+    iController->SetFileObserver( NULL );
+    __UHEAP_MARKEND;
+    }
+void T_CFLDController::HandleFileListBoxEventTestL()
+    {
+    __UHEAP_MARK;
+    iController->HandleFileListBoxEventL( MFLDFileListBoxObserver::EVideoPreviewSelected, KNullDesC );
+    __UHEAP_MARKEND;
+    }
+
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE(
+    T_CFLDController,
+    "T_CFLDController test suite",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Create and delete",
+    "CFLDController",
+    "NewL",
+    "FUNCTIONALITY",
+    EmptySetupL, TestCreateObjectL, Teardown )
+EUNIT_TEST(
+    "Set delay",
+    "CFLDController",
+    "SetDelay",
+    "FUNCTIONALITY",
+    SetupL, SetDelayTestL, Teardown )
+EUNIT_TEST(
+    "Set volume",
+    "CFLDController",
+    "SetVolume",
+    "FUNCTIONALITY",
+    SetupL, SetVolumeTestL, Teardown )
+EUNIT_TEST(
+    "Set ringing type",
+    "CFLDController",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    SetupL, SetRingingTypeTestL, Teardown )
+EUNIT_TEST(
+    "Set vibra",
+    "CFLDController",
+    "SetVibra",
+    "FUNCTIONALITY",
+    SetupL, SetVibraTestL, Teardown )
+EUNIT_TEST(
+    "Set 3D effects",
+    "CFLDController",
+    "Set3dEffects",
+    "FUNCTIONALITY",
+    SetupL, Set3dEffectsTestL, Teardown )
+EUNIT_TEST(
+    "Set file observer",
+    "CFLDController",
+    "SetFileObserver",
+    "FUNCTIONALITY",
+    SetupL, SetFileObserverTestL, Teardown )
+EUNIT_TEST(
+    "Handle ListBox Event",
+    "CFLDController",
+    "HandleFileListBoxEventL",
+    "FUNCTIONALITY",
+    SetupL, HandleFileListBoxEventTestL, Teardown )
+EUNIT_END_TEST_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/src/T_CFLDDllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  FileList test suite.
+*
+*
+*/
+
+
+//  CLASS HEADER
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+
+#include "T_CFLDController.h"
+#include "T_CFLDFileListContainer.h"
+
+/**
+ * T_CFLDFileList.dll test suite factory function.
+ */
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    CEUnitTestSuite* mainSuite = CEUnitTestSuite::NewLC(_L("T_FileList Module Tests"));
+
+    // NewLC leaves the pointer to cleanupstack until AddL finishes
+    mainSuite->AddL( T_CFLDController::NewLC() );
+    CleanupStack::Pop();
+    mainSuite->AddL( T_CFLDFileListContainer::NewLC() );
+    CleanupStack::Pop();
+    CleanupStack::Pop( mainSuite );
+    return mainSuite;
+    }
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/FileList/tsrc/public/basic/src/T_CFLDFileListContainer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,395 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  CFLDFileListContainer test class.
+*
+*
+*/
+
+//  Include Files
+#include "T_CFLDFileListContainer.h"
+#include <CFLDFileListContainer.h>
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+#include <CEUnitAllocTestCaseDecorator.h>
+#include <coemain.h>
+#include <FLDTest.rsg>
+#include "FLDTestConst.h"
+
+
+namespace
+	{
+	_LIT( KFLDTestMimeMP4, "audio/mp4" );
+	_LIT( KFLDTestMime3GPP, "video/3gpp" );
+	_LIT( KFLDTestMimeRNG, "application/vnd.nokia.ringing-tone" );
+	}
+
+
+// Classes under test include
+
+//  LOCAL FUNCTIONS
+
+// CONSTRUCTION
+// Static constructor
+T_CFLDFileListContainer* T_CFLDFileListContainer::NewLC()
+    {
+    T_CFLDFileListContainer* self = new(ELeave) T_CFLDFileListContainer;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+T_CFLDFileListContainer::~T_CFLDFileListContainer()
+    {
+    delete iContainer;
+    delete iContainer1;
+    if( iResourceLoader )
+        {
+        iResourceLoader->Close();
+        delete iResourceLoader;
+        }
+    iWsSession.Close();
+    }
+
+// Second phase construct
+void T_CFLDFileListContainer::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_CFLDFileListContainer::T_CFLDFileListContainer()
+    {
+    }
+
+//---------------------------------------------------------------
+//----------------- TEST CASE METHODS ---------------------------
+//---------------------------------------------------------------
+
+//  METHODS
+
+// Setup nothing.
+void T_CFLDFileListContainer::EmptySetupL()
+    {
+    iResourceLoader = new ( ELeave ) RConeResourceLoader( *CCoeEnv::Static() );
+    TFileName fileName( KFLDResourceFile );
+    User::LeaveIfError( iResourceLoader->Open( fileName ) );
+    }
+
+void T_CFLDFileListContainer::SetupL()
+    {
+    EmptySetupL();
+	
+    iContainer = CFLDFileListContainer::NewL();
+    iContainer1 = CFLDFileListContainer::NewLC();
+    CleanupStack::Pop();
+    iContainer2 = CFLDFileListContainer::NewL( R_FLD_TEST_MODEL1 );
+    iContainer3 = CFLDFileListContainer::NewLC( R_FLD_TEST_MODEL1 );
+    CleanupStack::Pop();
+    iContainer4 = CFLDFileListContainer::NewL( R_FLD_TEST_MODEL1, R_FLD_TEST_ROM_MODEL );
+    iContainer5 = CFLDFileListContainer::NewLC( R_FLD_TEST_MODEL1, R_FLD_TEST_ROM_MODEL );
+    CleanupStack::Pop();
+    
+    iWsSession.Connect();
+
+    iMimeTypeArray = new (ELeave) CDesCArrayFlat( 8 );
+    }
+
+void T_CFLDFileListContainer::Teardown()
+    {
+    delete iContainer;
+    iContainer = NULL;
+    
+    delete iContainer1;
+    iContainer1 = NULL;
+    
+    delete iContainer2;
+    iContainer2 = NULL;
+    
+    delete iContainer3;
+    iContainer3 = NULL;
+    
+    delete iContainer4;
+    iContainer4 = NULL;
+    
+    delete iContainer5;
+    iContainer5 = NULL;
+    
+    if( iResourceLoader )
+        {
+        iResourceLoader->Close();
+        delete iResourceLoader;
+        iResourceLoader = NULL;
+        }
+    iWsSession.Close();
+
+    delete iMimeTypeArray;
+    iMimeTypeArray = NULL;
+
+    iMediaTypeArray.Reset();
+    iMediaTypeArray.Close();
+    }
+
+// CREATIONAL TESTS
+void T_CFLDFileListContainer::TestCreateObjectL()
+    {
+    CFLDFileListContainer* container = CFLDFileListContainer::NewL();
+    EUNIT_ASSERT( container );
+    delete container;
+    container = NULL;
+
+    container = CFLDFileListContainer::NewLC();
+    EUNIT_ASSERT( container );
+    CleanupStack::PopAndDestroy();
+    }
+
+void T_CFLDFileListContainer::LaunchTestL()
+    {
+    _LIT( KFLDTestFileName, "" );
+    _LIT( KFLDTestPopupTitle, "PopupTitle" );
+    TFileName fn( KFLDTestFileName );
+
+    iContainer->LaunchL( fn );
+    iContainer->LaunchL( fn, KFLDTestPopupTitle );
+    }
+
+void T_CFLDFileListContainer::InsertNullItemTestL()
+    {
+    iContainer->InsertNullItemL( KFLDTestNullItem );
+    iContainer->InsertNullItemL( KFLDTestNullItem, KFLDTestNullItemRingingTone );
+    }
+
+void T_CFLDFileListContainer::InsertEndNullItemTestL()
+    {
+    iContainer->InsertEndNullItemL( KFLDTestNullItem );
+    iContainer->InsertEndNullItemL( KFLDTestNullItem, KFLDTestNullItemRingingTone );
+    }
+
+void T_CFLDFileListContainer::SetDelayTestL()
+    {
+    __UHEAP_MARK;
+    iContainer->SetDelay( 0 );
+    iContainer->SetDelay( 1000000 );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDFileListContainer::SetVolumeTestL()
+    {
+    __UHEAP_MARK;
+    iContainer->SetVolume( 5 );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDFileListContainer::SetRingingTypeTestL()
+    {
+    __UHEAP_MARK;
+    iContainer->SetRingingType( 0 );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDFileListContainer::SetVibraTestL()
+    {
+    __UHEAP_MARK;
+    iContainer->SetVibra( EFalse );
+    iContainer->SetVibra( ETrue );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDFileListContainer::Set3dEffectsTestL()
+    {
+    __UHEAP_MARK;
+    iContainer->Set3dEffects( EFalse );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDFileListContainer::SetAutomatedTypeTestL()
+    {
+    __UHEAP_MARK;
+    iContainer->SetAutomatedType( CDRMHelper::EAutomatedTypeRingingTone );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDFileListContainer::SetMaxFileSizeTestL()
+    {
+    __UHEAP_MARK;
+    iContainer->SetMaxFileSize( 0 );
+    __UHEAP_MARKEND;
+    }
+
+void T_CFLDFileListContainer::AddExclusiveMimeTypeTestL()
+    {
+    iContainer->AddExclusiveMimeTypeL( KFLDTestMimeRNG );
+    iContainer->AddExclusiveMimeTypeL( KFLDTestMimeMP4 );
+    iContainer->AddExclusiveMimeTypeL( KFLDTestMime3GPP );
+
+    iContainer->ResetExclusiveMimeTypes();
+    }
+
+void T_CFLDFileListContainer::AddExclusiveMediaTypeTestL()
+    {
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound );
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeMusic );
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeVideo );
+
+    iContainer->ResetExclusiveMediaTypes();
+    }
+
+void T_CFLDFileListContainer::ResetExclusiveMimeTypesTestL()
+	{
+    iContainer->AddExclusiveMimeTypeL( KFLDTestMimeRNG );
+    iContainer->ResetExclusiveMimeTypes();
+	}
+
+void T_CFLDFileListContainer::ResetExclusiveMediaTypesTestL()
+	{
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound );
+    iContainer->ResetExclusiveMediaTypes();
+	}
+
+void T_CFLDFileListContainer::SetWantedMimeTypesTestL()
+	{
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound );
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeMusic );
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeVideo );
+
+	iMimeTypeArray->Reset();
+    iMimeTypeArray->AppendL( _L("*") );
+    iContainer->SetWantedMimeTypesL( *iMimeTypeArray );
+	}
+
+void T_CFLDFileListContainer::SetWantedMediaTypesTestL()
+	{
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound );
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeMusic );
+    iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeVideo );
+    
+    iMediaTypeArray.AppendL( ECLFMediaTypeSound );
+    iMediaTypeArray.AppendL( ECLFMediaTypeMusic );
+    iContainer->SetWantedMediaTypesL( iMediaTypeArray.Array() );
+	}
+
+
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE(
+    T_CFLDFileListContainer,
+    "T_CFLDFileListContainer test suite",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Create and delete",
+    "CFLDFileListContainer",
+    "NewL",
+    "FUNCTIONALITY",
+    EmptySetupL, TestCreateObjectL, Teardown )
+EUNIT_TEST(
+    "Launch, CAknPopupList causes resource imbalance",
+    "CFLDFileListContainer",
+    "LaunchL",
+    "FUNCTIONALITY",
+    SetupL, LaunchTestL, Teardown )
+EUNIT_TEST(
+    "Insert null item",
+    "CFLDFileListContainer",
+    "InsertNullItemL",
+    "FUNCTIONALITY",
+    SetupL, InsertNullItemTestL, Teardown )
+EUNIT_TEST(
+    "Insert end null item",
+    "CFLDFileListContainer",
+    "InsertEndNullItemL",
+    "FUNCTIONALITY",
+    SetupL, InsertEndNullItemTestL, Teardown )
+EUNIT_TEST(
+    "Set delay",
+    "CFLDFileListContainer",
+    "SetDelay",
+    "FUNCTIONALITY",
+    SetupL, SetDelayTestL, Teardown )
+EUNIT_TEST(
+    "Set volume",
+    "CFLDFileListContainer",
+    "SetVolume",
+    "FUNCTIONALITY",
+    SetupL, SetVolumeTestL, Teardown )
+EUNIT_TEST(
+    "Set Ringing type",
+    "CFLDFileListContainer",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    SetupL, SetRingingTypeTestL, Teardown )
+EUNIT_TEST(
+    "Set Vibra",
+    "CFLDFileListContainer",
+    "SetVibra",
+    "FUNCTIONALITY",
+    SetupL, SetVibraTestL, Teardown )
+EUNIT_TEST(
+    "Set automated type",
+    "CFLDFileListContainer",
+    "SetAutomatedType",
+    "FUNCTIONALITY",
+    SetupL, SetAutomatedTypeTestL, Teardown )
+EUNIT_TEST(
+    "Set 3d effects",
+    "CFLDFileListContainer",
+    "Set3dEffects",
+    "FUNCTIONALITY",
+    SetupL, Set3dEffectsTestL, Teardown )
+EUNIT_TEST(
+    "Set max file size",
+    "CFLDFileListContainer",
+    "SetMaxFileSize",
+    "FUNCTIONALITY",
+    SetupL, SetMaxFileSizeTestL, Teardown )
+EUNIT_TEST(
+    "Add exclusive MIME type",
+    "CFLDFileListContainer",
+    "AddExclusiveMimeType",
+    "FUNCTIONALITY",
+    SetupL, AddExclusiveMimeTypeTestL, Teardown )
+EUNIT_TEST(
+    "Add exclusive media type",
+    "CFLDFileListContainer",
+    "AddExclusiveMediaType",
+    "FUNCTIONALITY",
+    SetupL, AddExclusiveMediaTypeTestL, Teardown )
+EUNIT_TEST(
+    "Set wanted MIME types",
+    "CFLDFileListContainer",
+    "SetWantedMimeTypes",
+    "FUNCTIONALITY",
+    SetupL, SetWantedMimeTypesTestL, Teardown )
+EUNIT_TEST(
+    "Set wanted media types",
+    "CFLDFileListContainer",
+    "SetWantedMediaTypes",
+    "FUNCTIONALITY",
+    SetupL, SetWantedMediaTypesTestL, Teardown )
+EUNIT_TEST(
+    "Reset exclusive MIME types",
+    "CFLDFileListContainer",
+    "ResetExclusiveMimeTypes",
+    "FUNCTIONALITY",
+    SetupL, ResetExclusiveMimeTypesTestL, Teardown )
+EUNIT_TEST(
+    "Reset exclusive media types",
+    "CFLDFileListContainer",
+    "ResetExclusiveMediaTypes",
+    "FUNCTIONALITY",
+    SetupL, ResetExclusiveMediaTypesTestL, Teardown )
+
+EUNIT_END_TEST_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafiledialog.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,499 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Header file of mediafiledialog. UI control of mediafilelist
+*
+*/
+
+
+
+
+#ifndef MEDIALFILEDIALOG_H
+#define MEDIALFILEDIALOG_H
+
+
+//  INCLUDES
+#include "mediafiledialogutils.h"
+#include "mediafilepreview.h"
+#include "mediafilehandler.h"
+#include "mediafiledialogstate.h"
+#include "mediafilewaitnote.h"
+
+
+#include <e32base.h>
+#include <aknlists.h>
+#include <AknDialog.h>
+#include <AknInfoPopupNoteController.h> // CAknInfoPopupNoteController
+#include <eikedwin.h>
+#include <aknsfld.h>
+#include <peninputsrveventhandler.h>
+#include <peninputclient.h>
+
+
+// CONSTANTS
+
+// CLASS DECLARATION
+class CMFDialogTest;
+class CMFProtectionHandler;
+class CAknInputBlock;
+class CVideoPreviewDialog;
+
+
+
+/**
+* CMFListHandlerObserver
+* 
+* CMFListHandler uses CMFListHandlerObserver to get listbox item texts.
+*/
+NONSHARABLE_CLASS (CMFListHandlerObserver)
+    {
+    public:
+        virtual TPtrC ConstructListboxItem( TInt aListIndex ) = 0;
+        virtual TInt ListboxItemCount() = 0;
+    };
+
+
+/**
+* CMFListHandler
+* 
+* This class is used as listbox model's item array. Listbox uses it to draw 
+* list items. CMFListHandler gets list item texts from CMediaFileHandler
+* (metadata query result). This way there is no need to copy all list items
+* into listbox model.  
+*/
+NONSHARABLE_CLASS (CMFListHandler) : public MDesCArray
+    {
+    public:
+	    static CMFListHandler* NewL();
+	    ~CMFListHandler();
+    private:	
+	    void ConstructL(void);
+        CMFListHandler();
+
+    public:  // from MDesCArray
+	    TInt MdcaCount() const;
+	    TPtrC16 MdcaPoint(TInt aIndex) const;
+
+    public:
+  	    void SetObserver( CMFListHandlerObserver* aObserver );
+	    static void Panic( TInt aReason );
+	    
+    private:
+	    CMFListHandlerObserver* iObserver;  // does not own
+    };
+
+
+
+
+
+
+/**
+* CMediaFileDialog
+*
+* CMediaFileDialog provides UI for selecting/previewing media files.
+*/
+NONSHARABLE_CLASS (CMediaFileDialog) :  public CAknDialog, 
+                                        public MEikListBoxObserver,
+                                        public MCoeForegroundObserver,
+                                        public CMFListHandlerObserver,
+                                        public MMediaFileHandlerObserver,
+                                        public MMFActiveCallerObserver,
+                                        public MPreviewHandlerObserver,
+                                        public MMediaFileWaitNoteObserver,
+                                        public MAdaptiveSearchTextObserver,  // not used
+                                        public MPenUiActivationHandler
+
+    {
+    
+#ifdef _DEBUG     
+    friend class CMFDialogTest;
+#endif    
+    
+    enum TListOperationType
+        {
+        EAttrSelect,
+        EAttrOpen,
+        EAttrClicked,
+        EAttrDoubleClicked
+        };
+
+    enum TDelayedOperationType
+        {
+        EAttrPreview,
+        EAttrSearch,
+        EAttrChangeCba
+        };
+
+
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CMediaFileDialog* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMediaFileDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMediaFileDialog();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	public:
+		TBool ShowDialogL( TDes* aFileName, TInt* aNullItem,
+		                   TInt* aInfo, TDes* aDesInfo );
+		
+		void SetAttrL( TInt aAttr, TInt aValue );
+		void SetAttrL( TInt aAttr, const TDesC& aValue );
+		void SetAttrL( TInt aAttr, TAny* aValue );
+        void SetNullItemL( const TDesC& aText, const TDesC& aMediaFile,
+	                       TInt aMediaFileType, TInt aIconId );
+		
+	private:
+        /**
+        * From MEikListBoxObserver, called by framework.
+        * @param aListBox.
+        * @param aEventType.
+		* @return None
+        */
+		void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
+
+        /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool OkToExitL( TInt aButtonId );
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param aType.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        /**
+        * From the base class.
+		* Called by framework when dialog is activated.
+        * @param None.
+		* @return None.
+        */
+		void ActivateL();
+
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL( TInt aResourceID, CEikMenuPane* aMenuPane );
+
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL( TInt aCommandId );
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange( TInt aType );
+        
+        /** SetSizeAndPosition
+        * From CAknDialog.
+        * Sets dialog's size to whole main pane.
+        * @param aSize ignored
+        */
+        void SetSizeAndPosition( const TSize &aSize );
+        
+        SEikControlInfo CreateCustomControlL( TInt aControlType );
+        
+        virtual CCoeControl* ComponentControl( TInt aIndex ) const;
+        virtual TInt CountComponentControls() const;
+        
+
+    private:
+		TBool DoHandleOKL( TInt aAttr );
+		TBool HandleOKL( TInt aAttr );
+		TBool DoHandleBackL();
+		TBool HandleBackL();
+        void SearchL();
+        void DoSearchL();
+        static TInt StartRomScaning( TAny* aInstance );
+        void StartRomScan();
+
+    private:
+        void ResetDialogL( TInt aError);
+		void QueryL( TInt aFolderId, TBool aDatabaseChanged = EFalse );
+		void GetSelectedItemFileName( TInt aListboxIndex, TDes& aFileName );
+		TInt CurrentItemListIndex();
+		void SetIconsL();
+		CAknSearchField* FindBox() const;
+		void ResetFindBoxL();
+		void FindBoxCursorMoveL( TInt aType );
+		void ShowContextMenuL( TInt aResource );
+		void PreviewL( TInt aMediaType );
+		void PreviewVideoL( const TDesC& aFileName );
+		void PreviewNullItemL( TInt aFolderId );
+		void StartPreviewWithDelay();
+		void CancelPreview();
+		void StartSearchWithDelay();
+		TBool IsVideoFile( TInt aCurrentIndex );
+		TBool IsValidVideoFileL( TInt aCurrentIndex, TInt aIntention );
+		TInt MediaTypeIcon( TInt aListboxIndex );
+		TInt StorageTypeIcon( TInt aListboxIndex );
+		void GetListItemText( TInt aListboxIndex, TDes& aText );
+		
+    private:
+		void CheckListboxIndex();
+		void HandleMediaFileChanged();
+		
+    private:
+		void UpdateListBoxL( TBool aRestFindBox = ETrue );
+		void DoUpdateListBoxL( TBool aRestFindBox );
+		void UpdateCbaL( TInt aAttr );
+    	TInt MapAttribute( TInt aFolderId );
+		
+		void ShowErrorNoteL( TInt aError );
+    	void ShowPreviewErrorNoteL( TInt aError, TInt aMediaType );
+		void DeleteMenuItem( CEikMenuPane* aMenuPane, TInt aCommandId );
+		CGulIcon* IconL( TAknsItemID aId, const TDesC& aFileName,
+		                 TInt aFileIndex, TInt aFileMaskIndex );
+		static TInt CloseDialog( TAny *aObj );
+		void CloseDialogWithDelayL();
+		
+    private:
+        void ShowWaitNoteL( TBool aDatabaseChanged );
+		void ShowPopupNoteL( const TDesC& aText );
+		void ShowDetailsPopupL();
+		void GetPopupText( CMediaFileData* aData, TDes& aText );
+		TBool MatchFound( const TDesC& aAttribute, const TDesC& aText );
+
+
+    private:
+		static void Panic( TInt aReason );
+
+    private:  // from CMFListHandlerObserver
+        TPtrC ConstructListboxItem( TInt aListboxIndex );
+        TInt ListboxItemCount();
+        
+    private:   // from MPreviewHandlerObserver
+        void HandlePreviewEventL( TInt aEvent, TInt aError );
+
+    private:   // from MMediaFileHandlerObserver
+        void HandleMFEventL( TInt aEvent, TInt aError );
+        
+    private:   // from MMFActiveCallerObserver
+        void HandleActiveCallL( TInt aCallId );
+        
+    private:  //from MCoeControlObserver
+        void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
+        
+    private:  // from MCoeForegroundObserver
+        void HandleGainingForeground();
+        void HandleLosingForeground();
+        
+    private:  // from MAdaptiveSearchTextObserver
+        void AdaptiveSearchTextChanged( CAknSearchField* aSearchField );
+        
+    private:  // from MPenUiActivationHandler
+        void OnPeninputUiDeactivated();
+        void OnPeninputUiActivated();
+        
+    private:  // MMediaFileWaitNoteObserver
+        void HandleWaitNoteL( TInt aButtonId );
+    
+#ifdef _DEBUG
+    private: // test code
+        CMFDialogTest* iTest;
+#endif
+   
+    private:
+		// listbox
+		CAknSingleGraphicStyleListBox* iListBox;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// long buffer for string handling
+		TBuf<KBufSize256> iBuf;
+		
+		// long buffer for string handling
+		TBuf<KBufSize256> iPopupText;
+		
+		// long buffers for listbox items
+		TBuf<KBufSize128> iListboxItemText1;
+		TBuf<KBufSize256> iListboxItemText2;
+		
+		// text from search field
+		TBuf<KBufSize128> iSearchText;
+	
+		// long buffers for icon file names
+		TFileName iIconFileName;
+		
+		// list box model item array
+		CMFListHandler* iMFListHandler;
+		
+		// dialog state
+		CMediaFileDialogState* iState;
+		
+		// metadata engine wrapper
+		CMediaFileHandler* iMediaFileHandler;
+		
+		// search box
+		CAknSearchField* iFindCtrl;
+		
+		// for generating active object calls
+		CMFActiveCaller* iCaller;
+		CMFActiveCaller* iSearchCaller;
+		
+		// for previewing video files
+		CMFVideoPreviewHandler* iVideoPreviewHandler;
+		
+		// for previewing audio files
+		CMFAudioPreviewHandler* iAudioPreviewHandler;
+        
+		// popup note
+        CAknInfoPopupNoteController* iPopupNote;
+
+		// cancel note in case database query takes more than 2 seconds
+		CMediaFileWaitNote* iWaitNote;
+	
+		// needed for finding out whether search field is in pen input mode
+		RPeninputServer iPeninputServer;
+		
+		// for file protection information (drm etc)
+		CMFProtectionHandler* iProtectionHandler;
+		
+		// for closing dialog
+		CIdle* iIdle;
+		
+		TBool ifilevalid;
+        // is dialog in foreground (visible)
+        TBool iForeGround;
+        
+        // dll resource file id
+        TInt iResourceFileId;
+        
+        // is metadata databse open
+        TBool iDatabaseOpen;
+        
+        // is pen input active
+        TBool iPeninputActive;
+
+        // dialog attribute values
+        HBufC* iNullItemFileNameOne;
+        HBufC* iNullItemFileNameTwo;
+        TInt iNullItemFileTypeOne;
+        TInt iNullItemFileTypeTwo;
+        TBuf<KBufSize128> iDialogTitle;
+        
+        CAknInputBlock* iInputBlock;
+		
+		// dialog output parameters
+		
+		// selected media file
+	    TDes* iFileName;
+	    // selected null item
+	    TInt*iNullItem;
+	    // extra parameter for later use
+	    TInt* iInfo;
+	    // extra parameter for later use
+	    TDes* iDesInfo;
+	    //is double clicked the item of the listbox
+	    TBool iIsDoubleClicked;
+	    TBool iFileisvalid;
+	    // Video preview dialogue, model dialog
+	    CVideoPreviewDialog* iVideoPreviewDlg;
+    };
+
+
+
+/**
+* CFindControl
+*
+* Search field functionality (CFindControl) is copied from
+* AknSelectionLis (s60/mw/classicui/uifw/AvKon/src/AknSelectionList.cpp).
+* Example code can also be found in 
+* s60/app/imppapplications/wvuing/wvuiave/AppSrc/CCAContactSelectionDialog.cpp
+*/
+NONSHARABLE_CLASS (CFindControl) : public CCoeControl 
+    {
+public:
+    CAknSearchField *iFind;
+    ~CFindControl() { delete iFind; }
+    void Draw(const TRect &) const
+        {
+        // this removes flicker from CEikDialog's Draw().
+        }
+    void SizeChanged()
+        {
+        TRect mainPane;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
+        
+        TAknLayoutRect listRect;
+    
+        listRect.LayoutRect( mainPane, AknLayout::list_gen_pane(0) );
+
+        TRect r( listRect.Rect() );
+        iPosition = TPoint( r.iTl );
+        iSize.SetSize( r.Width(), r.Height() );
+        }
+
+    TSize MinimumSize()
+        {
+        if ( iFind )
+            {
+            if ( iFind->Size() != TSize( 0, 0 ) )
+                {
+                return iFind->Size();
+                }
+            }
+            
+        return iSize;
+        }
+    };
+
+
+
+
+#endif      // MEDIALFILEDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafiledialogstate.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,280 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Header file of mediafiledialogstate.
+*                Class used to deal with the items of the Main view
+*
+*/
+
+
+
+#ifndef MEDIAFILEDIALOGSTATE_H
+#define MEDIAFILEDIALOGSTATE_H
+
+// INCLUDES
+#include "mediafiledialogutils.h"
+
+#include <e32base.h>
+
+
+// CONSTANTS
+
+
+enum TMediaFileListFolder
+	{
+	EEFolderRoot = 0,
+	EEFolderDownload,
+	EEFolderTones,
+	EEFolderMusic,
+	EEFolderVideos,
+	EEFolderRecordings,
+	EEFolderSearch,
+	EEFolderAllMusic,
+	EEFolderArtistRoot,
+	EEFolderArtist,
+	EEFolderArtistUnknown,  // 10
+	EEFolderArtistAll,
+	EEFolderArtistAlbum,
+	EEFolderArtistAlbumUnknown,
+	EEFolderAlbumRoot,
+	EEFolderAlbum,
+	EEFolderAlbumUnknown,
+	EEFolderGenreRoot,
+	EEFolderGenre,
+	EEFolderGenreUnknown,
+	EEFolderComposerRoot,  // 20
+	EEFolderComposer,
+	EEFolderComposerUnknown,
+	EEFolderNullItemOne,
+	EEFolderNullItemTwo,
+	EEFolderRecent,
+	EEFolderNone,
+	EEFolderPersistent,
+	EEFolderUnknown,
+	EEFolderSearchMusic
+	};
+
+
+enum TMediaFileListIcons
+	{
+	EEIconMusic = 0,
+	EEIconTone = 1,
+	EEIconVideo = 2,
+	EEIconRecording = 3,
+	EEIconArtist = 4,
+    EEIconAlbum = 5,
+    EEIconGenre = 6,
+    EEIconComposer = 7,
+    EEIconFolder = 8,
+    EEIconUnknown = 9,
+    EEIconFolderDownload = 10,
+    EEIconNullItemOff = 11,
+	EEIconMemoryCard = 12,
+	EEIconMassStorage = 13,
+    EEIconEmpty = 14	
+    };
+
+enum TMediaFileListQueryDirection
+    {
+    EEQueryUp,
+    EEQueryDown,
+    EEQueryUpdate
+    };
+
+
+
+// CLASS DECLARATION
+
+NONSHARABLE_CLASS (TMFListItem)
+	{
+    public:
+        // position in listbox
+        TInt iListIndex;
+        
+        // one of TMediaFileListFolder
+        TInt iFolderId;
+        
+        // one of TMediaFileListFolder
+        TInt iParentFolderId;
+        
+        // non-persistent child items from metadata (folders or file names)
+        TInt iChildFolderId;
+        
+        // is list item a persistent folder 
+        TBool iPersistent;
+        
+        // is list item hidden
+        TBool iHidden;
+
+        // icon that is shown in listbox
+        TInt iIconId;
+        
+        // icon that is shown in listbox
+        TInt iChildIconId;
+        
+        // count of unknown items in this folder
+        TInt iUnknownCount;
+
+        // text that is shown in listox
+        TBuf<KBufSize128> iText;
+        
+        // text that is shown in navi pane
+        TBuf<KBufSize128> iTitle;
+        
+        
+    public:
+        TMFListItem();
+	};
+
+/**
+* TMFCurrentItemInfo
+* 
+* Used for maintaining the open item info in a list box
+* folder and current list item position.
+*/
+
+NONSHARABLE_CLASS (TMFCurrentItemInfo)
+    {
+    public:
+        // has media file database changed 
+        TBool iIndexCheckNeeded;
+        
+        // current item listbox index
+        TInt iItemIndex;
+        
+        // currently selected media file id
+        TInt iMediaFileId;
+        
+        // currently selected persistent folder id
+        TInt iFolderId;
+        
+        // currently selected non-persistent folder id
+        TBuf<KBufSize128> iFolderText;
+        
+    public:
+        void Reset();
+    };
+
+
+
+
+/**
+* CMediaFileDialogState
+* 
+* Used for maintaining MediaFileDialog state eg currently open
+* folder and current list item position.
+*/
+NONSHARABLE_CLASS (CMediaFileDialogState) : public CBase
+	{
+    public:
+        static CMediaFileDialogState* NewL();
+        virtual ~CMediaFileDialogState();
+    
+    private:
+        CMediaFileDialogState();
+        void ConstructL();
+	
+    public:
+        void Init();
+        void AddPermanentItemsL();
+    
+        TInt NextFolderUp();
+        TInt NextFolderDown( TInt aListIndex );
+        void SetQueryInfo( TInt aQueryId, const TDesC& aQueryText,
+                           TInt aQueryListPosition, TInt aQueryDirection );
+        void SetStateAfterQuery();
+        
+    public:        
+        void SetCurrentFolder( TInt aFolderId );
+        TInt CurrentFolder();
+     
+        TBool FindBoxNeeded();
+        TBool QueryNeeded();
+        TBool QueryNeeded( TInt aFolderId );
+        TInt QueryFolder();
+
+        void SetText( TInt aFolderId, const TDesC& aText );
+        void GetText( TInt aFolderId, TDes& aText );
+        void SetTitle( TInt aFolderId, const TDesC& aText );
+        void GetTitle( TInt aFolderId, TDes& aText );
+        void GetSearchTitleL( TDes& aText, TInt aCount );
+        void GetSearchTitle( TDes& aText, TInt aCount );
+
+        void SetUnknownFolderPosition( TInt aQueryCount );
+        void SetListIndex( TInt aFolderId, TInt aListIndex );
+        TInt ListIndex( TInt aFolderId );
+        void EnableNullItemL( TInt aFolderId, const TDesC& aText, TInt aIconId );
+
+
+    private:
+        TInt IndexFromId( TInt aFolderId );
+        TInt FolderIndex( TInt aListIndex );
+        
+    public:
+        TInt PersistentFolderCount( TInt aFolderId );
+        TInt PersistentFolderCount();
+        TInt LeadingPersistentFolderCount();
+        TInt CurrentItemIndex();
+        void SetCurrentItemIndex( TInt aIndex );
+        TInt FolderId( TInt aListIndex );
+        void GetFolderInfo( TInt aListIndex, TInt& aId, TDes& aText,
+                             TBool& aPersistent, TInt& aIconId );
+
+    public:
+        TMFCurrentItemInfo& CurrentItemInfo();
+        TInt QueryDirection();
+        TInt PreviousFolderId();
+        TBool IsPersistent( TInt aFolderId );
+
+    public:
+        void ResetUnknownCount();
+        void SetUnknownCount( TInt aFolderId, TInt aCount );
+        TInt UnknownCount( TInt aFolderId );
+        void HideUnknownFolders();
+        void HideUnknownFolder( TInt aFolderId, TInt aUnknownCount );
+        void HideRootFolder( TInt aFolderId, TBool aHidden,
+                             const TDesC& aText, TInt aIconId );
+     
+    public:
+        void PrintCurrentFolder();
+        
+    public:
+        static void GetFolderTypeText(TDes& aText, TInt aType);
+        
+    private:
+        static void Panic( TInt aReason );
+        
+    private:
+        RArray<TMFListItem> iList;
+        TInt iCurrentFolderId;
+        TInt iCurrentFolderIndex;
+        TInt iListPosition;
+        
+        // temporary query info - iList is updated after successful query 
+        TInt iQueryFolderId;
+        TInt iQueryDirection;
+        TBuf<KBufSize128> iQueryText;
+        
+        // previous folder id
+        TInt iPreviousFolderId;
+        
+        // current item info, needed for setting focus to current item
+        // when media file database changes
+        TMFCurrentItemInfo iCurrentItemInfo;
+	};
+
+
+
+#endif  // MEDIAFILEDIALOGSTATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafiledialogutils.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,425 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Basic functionality of MediaFileList.
+*
+*/
+
+
+
+
+#ifndef MEDIALFILEDIALOGUTILS_H
+#define MEDIALFILEDIALOGUTILS_H
+
+
+//  INCLUDES
+
+#include <e32base.h>
+#include <s32strm.h>  // RReadStream RWriteStream
+#include <f32file.h>  // RFs
+
+#include <eikspane.h>   // CEikStatusPane
+#include <aknnavi.h>    // CAknNavigationControlContainer
+#include <eikimage.h>   // CEikImage
+
+#include <DownloadedContentHandler.h> // MDownloadedContentHandler
+
+
+// CONSTANTS
+
+const TInt KBufSize64  = 64;
+const TInt KBufSize128 = 128;
+const TInt KBufSize256 = 256;
+const TInt KBufSize512 = 512;
+
+
+//	FORWARD DECLARATIONS
+
+class CAknAppUi;
+class CRepository;
+
+class CDocumentHandler;
+class CBrowserLauncher;
+
+
+
+/**
+* TMFDialogUtil
+*
+* TMFDialogUtil is utility class for media file dialog.
+*/
+NONSHARABLE_CLASS (TMFDialogUtil)
+    {
+    public:
+
+    enum TMFDialogPrivateAttribute
+        {
+        EAttrFileName = 100,
+        EAttrDrawingWindow
+        };
+    
+        
+    public:
+        static void ShowInformationQueryL( const TDesC& aText );
+        static void ShowInformationQueryL( TInt aResource );
+        static void ShowInformationNoteL( const TDesC& aText );
+        static void ShowInformationNoteL( TInt aResource );
+
+        static void ShowErrorNoteL( const TDesC& aText );
+        static void ShowErrorNoteL( TInt aResource );
+        static void ShowErrorNoteL( const TDesC& aText, TInt aError );
+        static TBool ShowNumberQueryL( TInt& aNumber, const TDesC& aTitle );
+        
+        static TBool ShowListQueryL( const TDesC& aTitle, CDesCArray* aList,
+                                     TInt* aSelectedIndex );
+
+        
+        static TInt AddResFileL();
+        static void StrCopy( TDes& aTarget, const TDesC& aSource );
+        static void Panic( TInt aReason );
+        static void SetIconFileNameL( const TDesC& aName, TDes& aFullName );
+        static CEikImage* CreateImageLC( TAknsItemID aId, const TDesC& aFileName,
+                                         TInt aFileBitmapId, TInt aFileMaskId );
+        static TBool IsEmpty( const TDesC& aText );
+        
+    };
+
+
+/**
+* MMFActiveCallerObserver
+*
+* MMFActiveCallerObserver is for observing CMFActiveCaller.
+*/
+NONSHARABLE_CLASS (MMFActiveCallerObserver)
+    {
+    public:
+	    virtual void HandleActiveCallL( TInt aCallId ) = 0;
+    };
+
+
+
+
+/**
+* CMFActiveCaller
+*
+* CMFActiveCaller is used for generating a call from active scheduler.
+* Typical use is to start some operation after a short delay.
+*/
+NONSHARABLE_CLASS (CMFActiveCaller) : public CActive
+    {
+    public:
+        static CMFActiveCaller* NewL( MMFActiveCallerObserver* aObserver );
+        virtual ~CMFActiveCaller();
+
+    private:
+	    CMFActiveCaller( MMFActiveCallerObserver* aObserver );
+	    void ConstructL();
+
+	public:
+		void Start( TInt aCallId, TInt aMilliseconds );
+		void Stop();
+		void Request();
+
+    private:
+	    void RunL();
+	    void DoCancel();
+        
+    private:
+		// call that is passed to observer
+		TInt iCallId;
+
+		// timer
+		RTimer iTimer;
+
+		// observer that gets called
+		MMFActiveCallerObserver* iObserver;
+    };
+
+
+
+/**
+* CNaviPaneHandler
+* 
+* This class is used for changing navipane title.
+*/
+NONSHARABLE_CLASS (CNaviPaneHandler) : public CBase
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        virtual ~CNaviPaneHandler();
+
+        /**
+        * C++ default constructor.
+        */
+        CNaviPaneHandler(CEikStatusPane* aStatusPane);
+
+    public:
+
+        /**
+        * Sets navi pane title.
+        * @param aTitle.
+        * @return None.
+        */
+        void SetNaviPaneTitleL(const TDesC& aTitle);
+        
+        /**
+        * Store navi pane.
+        * @param None.
+        * @return None.
+        */
+        void StoreNavipaneL();
+
+    private:
+        // status pane
+        CEikStatusPane* iStatusPane;
+    
+        // navi Pane
+        CAknNavigationControlContainer* iNaviPane;
+        
+        // navi decorator
+        CAknNavigationDecorator* iNaviDecorator;
+        
+        // has Navidecorator been pushed into navi pane
+        TBool iNavidecoratorPushed;
+        
+        // has navi pane been pushed into navigation pane's object stack
+        TBool iNavipanePushed;
+    };
+
+
+
+/**
+* CStatusPaneHandler
+* 
+* This class is used for changing dialog title and image.
+*/
+NONSHARABLE_CLASS (CStatusPaneHandler) : public CBase
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CStatusPaneHandler* NewL( CAknAppUi* aAppUi );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CStatusPaneHandler();
+
+    private:
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+        CStatusPaneHandler( CAknAppUi* aAppUi );
+
+    public:
+        /**
+        * Stores original title so it can be restored when dialog closes.
+        * @param  None.
+        * @return None.
+        */
+        void StoreOriginalTitleL();
+
+        /**
+        * Restores original title.
+        * @param  None.
+        * @return None.
+        */
+        void RestoreOriginalTitleL();
+
+        /**
+        * Sets dialog title.
+        * @param  aText.
+        * @return None.
+        */
+        void SetTitleL( const TDesC& aText );
+
+        /**
+        * Sets dialog title.
+        * @param  aResourceId.
+        * @return None.
+        */
+        void SetTitleL( TInt aResourceId );
+
+    public:
+        /**
+        * Sets dialog title.
+        * @param aAppUi.
+        * @param aText.
+        * @return Return code.
+        */
+        static TBool SetTitleL( CAknAppUi* aAppUi, const TDesC& aText );
+
+        /**
+        * Gets dialog title.
+        * @param aAppUi.
+        * @param aText.
+        * @return Return code.
+        */
+        static TBool GetTitleL( CAknAppUi* aAppUi, TDes& aText );
+        
+        /**
+        * Sets navi pane title.
+        * @param aTitle.
+        * @return None.
+        */
+        void SetNaviPaneTitleL( const TDesC& aTitle );
+        
+        /**
+        * Sets navi pane title.
+        * @param aTitle.
+        * @return None.
+        */
+        void SetNaviPaneTitle( const TDesC& aTitle );
+        
+        /**
+        * Sets navi pane title.
+        * @param aTitle.
+        * @return None.
+        */
+        void SetNaviPaneTitleL( TInt aResource );
+        
+        /**
+        * Store navi pane.
+        * @param None.
+        * @return None.
+        */
+        void StoreNavipaneL();
+
+    private:
+        // access to app ui
+        CAknAppUi* iAppUi;
+
+        // original status pane title
+        TBuf<KBufSize256> iOriginalTitle;
+        
+        // is original status pane title stored
+        TBool iOriginalTitleStored;
+
+        // original context pane image
+        CEikImage* iOriginalImage;
+        
+        CNaviPaneHandler* iNaviPaneHandler;
+    };
+
+
+
+
+/**
+* CDriveUtil
+*
+* CDriveUtil is used for getting drive information.
+*/
+NONSHARABLE_CLASS (CDriveUtil) : public CBase
+    {
+    public:
+        static CDriveUtil* NewL();
+        virtual ~CDriveUtil();
+
+    private:
+        CDriveUtil();
+        void ConstructL();
+
+    public:
+        TBool IsMemoryCard( const TDesC& aFullPath );
+        TBool IsMassStorage( const TDesC& aFullPath );
+        TBool IsRom( const TDesC& aFullPath );
+        
+    private:
+        RFs iFsSession;
+    };
+
+
+/**
+* CMimeTypeList
+*
+* CMimeTypeList is used for storing mime types that 
+* are excluded from media file list.
+*/
+NONSHARABLE_CLASS (CMimeTypeList) : public CBase
+    {
+    public:
+        static CMimeTypeList* NewL();
+        virtual ~CMimeTypeList();
+
+    private:
+        CMimeTypeList();
+        void ConstructL();
+
+    public:
+        void ResetL();
+        TInt Count();
+        const TDesC& MimeType( TInt aIndex );
+        void AddMimeTypeL( const TDesC& aText );
+        TBool FindMimeTypeL( const TDesC& aText );
+        
+       
+    public:
+        static TInt Compare( const TFileName& aFirst, const TFileName& aSecond );        
+    
+    private:
+        RArray<TFileName> iList;
+    };
+
+
+/**
+* CWebBrowserLauncher
+*
+* CWebBrowserLauncher is used for launching web browser.
+*/
+NONSHARABLE_CLASS(CWebBrowserLauncher) : public CBase,
+                                         public MDownloadedContentHandler
+    {
+    public:
+        static CWebBrowserLauncher* NewLC();
+        virtual ~CWebBrowserLauncher();
+
+    private:
+        CWebBrowserLauncher();
+        void ConstructL();
+
+    public:
+        void LaunchBrowserL();
+
+    public:
+        TBool HandleContentL( const TDesC& aFileName,
+                              const CAiwGenericParamList& aParamList,
+                              TBool& aContinue );
+        
+        TAny* DownloadedContentHandlerReserved1( TAny* aAnyParam );
+
+
+    private:
+        // Browser Launcher
+        CBrowserLauncher* iBrowserLauncher;
+
+        // Document Handler for saving downloaded tones.
+        CDocumentHandler* iDocumentHandler;
+    };
+
+
+
+
+
+#endif      // MEDIALFILEDIALOGUTILS_H
+
+
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafilehandler.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,566 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Used to interact with the MDE. 
+*
+*/
+
+
+
+#ifndef MEDIAFILEHANDLER_H
+#define MEDIAFILEHANDLER_H
+
+
+// INCLUDES
+
+#include "mediafiledialogutils.h"
+
+
+#include <mdesession.h>
+#include <mdequery.h>
+#include <mdelogiccondition.h>
+#include <mdeconstants.h>
+#include <mdeobjectquery.h>
+#include <mdccommon.h>
+#include <mdeitem.h>
+#include <mdeobject.h>
+
+
+// FORWARD DECLARATIONS
+class CSearchList;
+class CRomFileList;
+class CArtistQuery;
+
+// CONSTANTS
+
+_LIT( KMimeTypeAMR, "audio/amr" );
+_LIT( KMimeTypeWAV, "audio/wav" );
+_LIT( KMimeMp3, "mp3" );
+_LIT( KDriveZ, "z:\\" );
+_LIT( KSpace, " " );
+
+
+/**
+* CMediaFileData
+* 
+* Used for storing metadata information for one media file.
+*/
+NONSHARABLE_CLASS (CMediaFileData) : public CBase
+    {
+    public:
+        static CMediaFileData* NewL();
+        virtual ~CMediaFileData();
+
+    private:
+        CMediaFileData();
+        void ConstructL();
+        
+    public:
+        const TDesC& Attr( TInt aAttr );
+        void GetAttr( TInt aAttr, TDes& aValue );
+        void SetAttrL( TInt aAttr, const TDesC& aValue );
+
+    public:
+        TInt iMediaFileType;
+        
+    private:
+        HBufC* iFullName;
+        HBufC* iName;
+        HBufC* iArtist;
+        HBufC* iAlbum;
+        HBufC* iGenre;
+        HBufC* iComposer;
+    };
+
+
+/**
+* MMediaFileHandlerObserver
+*
+* For observing CMediaFileHandler events.  
+*/
+NONSHARABLE_CLASS (MMediaFileHandlerObserver)
+	{
+    public:
+    enum TMediaFileHandlerEvent
+        {
+        EInitComplete,
+        EQueryComplete,
+        EQueryCanceled,
+        EUnknownQueryComplete,
+        EMediaFileChanged,
+        EScanRomComplete,
+        EError
+        };
+    
+    enum TScanRomState
+        {
+        ENoneRomScan,
+        ERomScanInProgress,
+        ERomScanComplete,
+        ERomScanError
+        };
+	
+	public:
+		virtual void HandleMFEventL( TInt aEvent, TInt aError ) = 0;
+	};
+
+
+
+/**
+* CMediaFileHandler
+*
+* Used for making media file queries. For example get all songs for
+* one artist. Uses metadata engine.
+*/
+NONSHARABLE_CLASS (CMediaFileHandler) : public CBase, 
+                                        public MMdESessionObserver,
+                                        public MMdEQueryObserver,
+                                        public MMdEObjectObserver,
+                                        public MMdEObjectPresentObserver,
+                                        public MMFActiveCallerObserver
+    {
+    public:
+    enum TMediaType
+        {
+        EMediaTypeTone = 0,
+        EMediaTypeVideo,
+        EMediaTypeRecording,
+        EMediaTypeMusic
+        };
+
+    enum TStorageType
+         {
+         EPhoneMemory = 0,
+         ERomStorage,
+         EMassStorage,
+         EMemoryCard
+         };
+
+    enum TQueryAttribute
+        {
+        EAttrMediaType = 20,  // integer
+        EAttrFileSize,        // integer
+        EAttrStorageType,     // integer
+        EAttrMediaFileId,     // integer
+        EAttrFileName,     // string
+        EAttrFullName,     // string
+        EAttrSongName,     // string
+        EAttrArtist,       // string
+        EAttrAlbum,        // string
+        EAttrGenre,        // string
+        EAttrComposer      // string
+        };
+
+    enum TQueryType
+        {
+        EQueryNone = 0,
+        EQueryAudio,
+        EQueryMusic,
+        EQueryVideo,
+        EQueryRecording,
+        EQueryTone,
+        ESearchAudio,
+        ESearchVideo,
+        ESearchMusic,
+        ESearchTones,
+        EQueryEmpty,
+        EQueryUnknown,
+        
+        EQueryArtist,
+        EQueryArtistAlbum,
+        EQueryArtistAll,
+        EQueryArtistUnknown,
+        EQueryArtistEmpty,
+        };
+
+    public:
+        static CMediaFileHandler* NewL();
+        virtual ~CMediaFileHandler();
+
+    private:
+	    CMediaFileHandler();
+        void ConstructL();
+
+    public:
+        void SetAttrL( TInt aAttr, TInt aValue );
+        void SetAttrL( TInt aAttr, const TDesC& aValue );
+        void SetAttrL( TInt aAttr, TAny* aValue );
+
+    public:
+        void QueryMusicL( TInt aAttr );
+        void QueryMusicL( TInt aAttr, const TDesC& aFindText );
+        void QueryMusicUnknownL( TInt aAttr );
+        void QueryMusicUnknownCountL( TInt aAttr );
+        void QueryAttributeValuesL( TInt aAttr );
+        void QueryArtistL( TInt aAttr, const TDesC& aArtist, 
+                           const TDesC& aAlbum, TBool aRefresh = EFalse );
+        void QueryArtistEmptyL();
+        void QueryEmptyL();
+        void QueryRomEmptyL( TInt aQueryType );
+        
+        void QueryVideosL( TInt aAttr );
+        void QueryRecordingsL( TInt aAttr );
+        void QueryTonesL( TInt aAttr );
+        void QueryDefaultTonesL( TInt /*aAttr*/ );
+       
+        void SearchL( const TDesC& aSearchText );
+        void SearchAudioL( const TDesC& aSearchText );
+        
+        void StartRomScaning( TInt aQueryType );
+        
+    public:
+        TInt UnknownArtistCount();
+        TInt UnknownArtistCountL();
+        TInt ResultCount();
+        TBool QueryReady();
+        TInt Attribute( TInt aIndex, TInt aAttr, TInt aQueryId );
+        void GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue, TInt aQueryId );
+        void GetAttribute( TInt aIndex, TInt aAttr, TDes& aValue, TInt aQueryId );
+        CMediaFileData* ReadMediaFileDataL( TInt aId );
+        void CancelQuery();
+
+    public:
+        TInt ItemIndex( const TDesC& aItemText, TInt aIndex );
+        TInt ItemIndex( TInt aItemId, TInt aIndex );
+        
+    private:
+        
+        void SearchVideoL( const TDesC& aSearchText );
+        void SearchMusicL( const TDesC& aSearchText );
+        void SearchTonesL( const TDesC& aSearchText );
+        static TInt SearchTones( TAny *aObj );
+        static TInt SearchVideo( TAny *aObj );
+
+      
+    public:
+        void SetObserver( MMediaFileHandlerObserver* aObserver );
+        void SetQueryId( TInt aId );
+        void EnableObserverCall( TBool aEnable );
+        
+        
+    public:
+	CMediaFileData* RomMediaFileDataL( TInt aId ,TInt aMediaType );
+           
+    private:
+        CMdEPropertyDef& PropertyDefL( TInt aAttr );
+        void StrCopy( TDes& aTarget, const TDesC& aSource );
+        void CheckAttrL( TInt aAttr );
+        void CallObserverWithDelay();
+        void CallObserver( TInt aEvent, TInt aError );
+        void AddObjectObserverL();
+        
+    public:
+        static CMdEPropertyDef& PropertyDefL( CMdESession* aSession, TInt aAttr );
+        
+    private:
+        void ExcludeRecordingsL( CMdELogicCondition& aCondition );
+        void ExcludeRomFilesL( CMdELogicCondition& aCondition );
+        void ExcludeMimeTypesL( CMdELogicCondition& aCondition, TInt aAttr );
+        void IncludeMusicPropertiesL( CMdELogicCondition& aCondition );
+        void ExcludeMusicPropertiesL( CMdELogicCondition& aCondition );
+        void IncludeMusicSearchConditionL( CMdELogicCondition& aCondition,
+                                           const TDesC& aSearchText );
+        void IncludeToneSearchConditionL( CMdELogicCondition& aCondition,
+                                           const TDesC& aSearchText );
+        void IncludeVideoSearchConditionL( CMdELogicCondition& aCondition,
+                                           const TDesC& aSearchText );
+
+
+        
+    private:
+        void LeaveIfSessionClosedL();
+        void Panic( TInt aReason );
+        TInt MediaType( TInt aQueryType );
+        
+
+    private:  // from MMdESessionObserver
+        void HandleSessionOpened(CMdESession& aSession, TInt aError);
+        void HandleSessionError(CMdESession& aSession, TInt aError);
+        
+    
+    private:  // from MMdEQueryObserver (mdequery.h)
+        void HandleQueryNewResults( CMdEQuery& aQuery, TInt aFirstNewItemIndex,
+                                    TInt aNewItemCount );
+        void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError );
+        void HandleQueryCompletedL( CMdEQuery& aQuery, TInt aError );
+        
+    private:  // from MMdEObjectObserver
+        void HandleObjectNotification( CMdESession& aSession, 
+                                       TObserverNotificationType aType,
+                                       const RArray<TItemId>& aObjectIdArray);
+                                       
+    private:  // from MMdEObjectPresentObserver
+        void HandleObjectPresentNotification( CMdESession& aSession, 
+                         TBool aPresent, const RArray<TItemId>& aObjectIdArray);
+        
+    private:   // from MMFActiveCallerObserver
+         void HandleActiveCallL( TInt aCallId );
+
+    private:
+    
+        // media file event observer
+        MMediaFileHandlerObserver* iObserver;
+       
+        // session to metadata engine
+        CMdESession* iSession;
+      
+        // metadata query
+        CMdEObjectQuery* iQuery;
+        
+        // used for optimizing artist queries
+        CArtistQuery* iArtistQuery;
+
+        // search result list - ui shows items from this list
+        CSearchList* iSearchList;
+
+        // metadata search text
+        TBuf<KBufSize128> iSearchText;
+         
+        // for generating active object calls
+        CMFActiveCaller* iQueryCaller;
+        // for generating active object calls
+        CMFActiveCaller* iObjectNotificationCaller;
+        
+        // for finding out file drive type
+        CDriveUtil* iDriveUtil;
+        
+        // mime types that are exluded from queries
+        CMimeTypeList* iExcludedMimeTypes;
+
+        // for starting video query after short delay
+        CIdle* iIdle;
+
+        // used to prevent observer call when query is canceled fro ui
+        TBool iObserverCallEnabled;
+        
+        // query id from UI, not used in this class
+        TInt iQueryId;
+        
+        // max audio file file size
+        TInt iMaxFileSize;
+        
+        // is metadata session open
+        TBool iSessionOpen;
+
+        // query type 
+        TInt iQueryType;
+
+        // query error
+        TInt iQueryError;
+        
+        // query event
+        TInt iQueryEvent;
+        
+	    TBool iVideoSearchDisabled; 
+        
+        TInt iMediaFileCounter;
+        //for scan data from rom
+        CRomFileList* iRomFileList;
+	    //Record the rom scan state.
+	    TInt iRomScanState;
+	    //Tone query in progress
+	    TBool iQueryinProgress;
+
+    };
+
+
+
+
+/**
+* CSearchListItem
+*
+* Data for one media file item CSearchList.
+*/
+NONSHARABLE_CLASS (CSearchListItem) : public CBase 
+    {
+    public:
+        static CSearchListItem* NewLC();
+        static CSearchListItem* NewL();
+        virtual ~CSearchListItem();
+
+    private:
+        CSearchListItem();
+        void ConstructL();
+        
+    public:
+        void SetTitleL( const TDesC& aText, TBool aFullName );
+        const TDesC& Title() const;
+ 
+    public:
+        TInt iId;
+        TInt iMediaType;
+        TInt iStorageType;
+    private:
+        HBufC* iTitle;
+    };
+
+
+/**
+* CRomFileList
+* 
+* Used for reading media files from rom.
+*/
+NONSHARABLE_CLASS (CRomFileList) : public CBase
+    {
+    public:
+        static CRomFileList* NewL();
+        virtual ~CRomFileList();
+
+    private:
+        CRomFileList();
+        void ConstructL();
+    public:
+        void ReadDirectoryL( const TDesC& aDirectory, RArray<TFileName>& aList );
+        void ReadDirectoryL( const TDesC& aDirectory, 
+                                         RPointerArray<CSearchListItem>& aList );
+
+        void ReadRomFilesL();
+        void ReadRomVediosL();
+        const TDesC& Item( TInt aIndex , TInt aType );
+        TInt RomFileItem( CSearchListItem* aItem, TInt aIndex);
+        TInt RomVedioItem( CSearchListItem* aItem, TInt aIndex);
+        TInt Count( TInt aType );
+        void Reset();
+        
+    public:
+//    //Used to return the rom file attribute in rom;
+//    TInt RomFileAttribute(TInt aIndex, TInt aAttr);
+    //Used to return the title of rom item
+    TInt GetRomFileName(TInt aIndex, TInt aType, TDes& aValue);
+private:
+    CSearchListItem* SearchListItemFromRomL(const TDesC& aFileName,
+            TInt aIndex);
+	//Used to get the title of rom item
+	void RomItemTitle(TInt aIndex, TDes& aTitle );
+        
+private:
+        TFileName iFileName;
+        RArray<TFileName> iList;
+        RArray<TFileName> iVedioList;
+        RPointerArray<CSearchListItem> iRomToneList;
+        RPointerArray<CSearchListItem> iRomVideoList;
+
+    };
+
+/**
+* CSearchList
+*
+* List for storing search result for one (most recent) metadata query.
+*/
+NONSHARABLE_CLASS (CSearchList) : public CBase 
+    {
+    public:
+        static CSearchList* NewL();
+        virtual ~CSearchList();
+
+    private:
+        CSearchList();
+        void ConstructL();
+        
+    public:
+        void SetSession( CMdESession* aSession );
+        void SetRomFileList( CRomFileList* aRomFileList );
+        void TakeResultL( CMdEObjectQuery* aQuery, TInt aMediaType );
+        void TakeArtistResultL( CArtistQuery* aArtistQuery );
+        void TakeDistinctResultL( CMdEObjectQuery* aQuery, TInt aMediaType );
+        void SearchInToneL( CRomFileList* aQuery,  const TDesC& aSearchText );
+        void VideoSearchInRomL( CRomFileList* aQuery,  const TDesC& aSearchText );
+  
+        void AddAlbumItemL( const TDesC& aAlbum );
+        void AddItemL( CMdEObject& aObject, TInt aMediaType );
+        void AddRomItemL( CRomFileList* aRomList, TInt aMediaType );
+        void AddArtistItemL( CMdEObject& aObject, TInt aQueryType, const TDesC& aAlbum );
+
+        void Reset();
+        void Sort();
+        TInt Count();
+        void GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue );
+        TInt Attribute( TInt aIndex, TInt aAttr );
+        void SetSearchId( TInt aId );
+        TInt SearchId();
+        
+    public:
+        TInt ItemIndex( TInt aId );
+        TInt ItemIndex( const TDesC& aText );
+        TInt ItemIndex( const TDesC& aText, TInt aIndex );
+        TInt ItemIndex( TInt aId, TInt aIndex );
+        
+    private:
+        static TInt Compare( const CSearchListItem& aFirst, 
+                             const CSearchListItem& aSecond );
+        void Panic( TInt aReason );
+        const TDesC& TextL( CMdEObject& aObject, TInt aId );
+       
+    private:
+        CMdESession* iSession;  // does not own
+        
+        CRomFileList* iRomFileList; //does not own
+        
+        // list of search results
+        RPointerArray<CSearchListItem> iList;
+        
+        // for finding out drive type (eg memory card)
+        CDriveUtil* iDriveUtil;
+        
+        // search id - not used in this class
+        TInt iSearchId;
+    };
+
+
+
+
+
+/**
+* CArtistQuery
+* 
+* CArtistQuery is for storing all metadata for one artist.
+* Once CArtistQuery is initialized it can be used to get artist 
+* subqueries without making more metadata queries.
+*/
+NONSHARABLE_CLASS (CArtistQuery) : public CBase 
+    {
+    public:
+        static CArtistQuery* NewL();
+        virtual ~CArtistQuery();
+
+    private:
+        CArtistQuery();
+        void ConstructL();
+        
+    public:
+        void ResetL();
+        
+        void SetArtistL( const TDesC& aText );
+        void SetAlbumL( const TDesC& aText );
+        void SetQueryType( TInt aType );
+        void SetQuery( CMdEObjectQuery* aQuery );
+
+        const TDesC& Artist();
+        const TDesC& Album();
+        TInt QueryType();
+        CMdEObjectQuery* Query();
+        TInt UnknownCount();
+        
+    private:
+        CMdEObjectQuery* iQuery;
+        TInt iQueryType;
+        
+        HBufC* iArtist;
+        HBufC* iAlbum;
+    };
+
+
+
+#endif  // MEDIAFILEHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafilelist.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Interface of MediaFileList. Provide some API for 
+*                the user to use mediafilelist
+*
+*/
+
+
+
+
+#ifndef MEDIALFILELIST_H
+#define MEDIALFILELIST_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32file.h>
+
+
+// FORWARD DECLARATIONS
+class CMediaFileDialog;
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Public API for displaying media file list. List is used for 
+*  selecting/previewing audio and video files. 
+* 
+*  @lib mediafilelist.lib
+*  @since Series60_5.1
+*  
+*/
+class CMediaFileList : public CBase
+    {
+    public:
+    enum TMediaFileListAttribute
+        {
+        // max media file size
+        EAttrFileSize = 0,
+        // ringing volume (TProfileRingingVolume from Profile.hrh)
+        EAttrVolume,
+        // ringing type,  (TProfileRingingType from Profile.hrh)
+        EAttrRingingType,
+        // vibra on/off   (Boolean) 
+        EAttrVibra,
+        // 3D effect      (TProfile3DToneEffect from ProfileInternal.hrh)
+        EAttr3DEffect,
+        // 3D echo        (TProfile3DToneEcho from ProfileInternal.hrh)
+        EAttr3DEcho,
+        // excluded mime type text
+        EAttrExcludeMimeType,
+        // for file protection checking
+        EAttrAutomatedType,
+        // media file dialog title
+        EAttrTitle,
+        // excluded folder (see enum TFolderType)
+        EAttrExcludeFolder
+        };
+
+    enum TMediaFileType
+        {
+        EMediaFileTypeAudio = 0,
+        EMediaFileTypeVideo
+        };
+
+    enum TNullItemIcon
+        {
+        ENullItemIconNone = 0,
+        ENullItemIconDefaultTone,
+        ENullItemIconOff
+        };
+
+    enum TFolderType
+        {
+        EFolderDownload = 0,
+        EFolderVideos
+        };
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CMediaFileList* NewL();
+
+        /**
+        * Destructor.
+        */
+	    IMPORT_C virtual ~CMediaFileList();
+
+    private:
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+        CMediaFileList();
+
+    public:
+
+       /**
+        * Shows Media file list.
+        * @since Series60_5.1
+        * @param aFileName Selected media file name full path.
+        * @param aNullItem Selected null item index. Possible values:
+        *        KErrNotFound - item is not null item or Download item
+        *        0 - Download item
+        *        1 - first null item
+        *        2 - second null item
+        *  
+        * @param aInfo Extra information, set to NULL if not used.
+        * @param aDesInfo Extra information, set to KNullDesC if not used.
+        * @return ETrue if user selected media file, EFalse otherwise.
+        */
+	    IMPORT_C TBool ShowMediaFileListL( TDes* aFileName, TInt* aNullItem,
+	                                       TInt* aInfo, TDes* aDesInfo );
+
+        /**
+        * Set Media file list attribute. See enum TMediaFileListAttribute for
+        * list of supported attributes.
+        * @since Series60_5.1
+        * @param aAttr Attribute id. 
+        * @param aValue Attribute value. 
+        * @return None.
+        */
+       	IMPORT_C void SetAttrL( TInt aAttr, TInt aValue );
+
+        /**
+        * Set Media file list attribute. See enum TMediaFileListAttribute for
+        * list of supported attributes.
+        * @since Series60_5.1
+        * @param aAttr Attribute id. 
+        * @param aValue Attribute value. 
+        * @return None.
+        */
+	    IMPORT_C void SetAttrL( TInt aAttr, const TDesC& aValue );
+
+        /**
+        * Set Media file list attribute. Currently not in use.
+        * @since Series60_5.1
+        * @param aAttr Attribute id. 
+        * @param aValue Attribute value. 
+        * @return None.
+        */
+	    IMPORT_C void SetAttrL( TInt aAttr, TAny* aValue );
+
+        /**
+        * Set Media file list null item. Null items are custom list items
+        * that appear at the end of the media file list main view.
+        * @since Series60_5.1
+        * @param aText Null item text.
+        * @param aMediaFile File that is played when null items gets focused.
+        *        Use KNullDesC if not used.
+        * @param aMediaFileType Media file type. See enum TMediaFileType for
+                 supported media types.
+        * @param aIconId Null item icon id. See enum TNullItemIcon for
+                 supported icons.
+        * @return None.
+        */
+	    IMPORT_C void SetNullItemL( const TDesC& aText, const TDesC& aMediaFile,
+	                                TInt aMediaFileType, TInt aIconId );
+
+	
+
+    private:
+		CMediaFileDialog* iDialog;
+    };
+
+
+
+#endif      // MEDIALFILELIST_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafilelistdebug.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Tools for making logs
+*
+*/
+
+
+
+#ifdef _DEBUG
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFileName,"mfl.txt");
+_LIT(KLogDirFullName,"c:\\logs\\");
+_LIT(KLogDir,"mfl");
+
+// Declare the FPrint function
+inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFileName, EFileLoggingModeAppend, aFmt, list);
+    }
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#define FLOG(arg...)   { FPrint(arg); }
+//#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+//#define FLOG(arg...) { RDebug::Print(arg);  }
+#define FLOG(arg...)   { FPrint(arg); }
+#define FTRACE(a) { a; }
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG(arg...)
+#define FTRACE(a)
+
+#endif // _DEBUG
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafilepreview.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,353 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class for preview audio and video
+*
+*/
+
+
+
+#ifndef MEDIAFILEPREVIEW_H
+#define MEDIAFILEPREVIEW_H
+
+#include "mediafiledialogutils.h"
+
+//  INCLUDES
+
+#include <e32base.h>
+#include <DrmAudioSamplePlayer.h>
+#include <mdaaudiotoneplayer.h>
+#include <videoplayer.h>
+#include <centralrepository.h>
+#include <apgcli.h>  // for RApaLsSession
+#include <e32property.h>
+
+
+
+// CONSTANTS
+
+
+//	FORWARD DECLARATIONS
+class C3DRingingToneInterface;
+class RWindow;
+
+
+
+
+/**
+* MPreviewHandlerObserver
+* 
+* For observing media file preview events.
+*
+*/
+NONSHARABLE_CLASS (MPreviewHandlerObserver)
+	{
+    public:
+    enum TPreviewHandler
+        {
+        EVideoPreviewComplete,
+        EAudioPreviewComplete,
+        EPreviewError
+        };
+	
+	public:
+		virtual void HandlePreviewEventL( TInt aEvent, TInt aError ) = 0;
+	};
+
+
+
+
+/**
+* CMFPreviewHandlerBase
+*
+* Base class for CMFAudioPreviewHandler and CMFVideoPreviewHandler.
+*/
+NONSHARABLE_CLASS (CMFPreviewHandlerBase) : public CBase
+    {
+    public:
+        enum TPlayerStatus
+            {
+            EPlayerNotCreated,
+            EPlayerInitializing,
+            EPlayerReady,
+            EPlayerPlaying,
+			EPlayerInitialized,
+			EPlayerPlayingWith3DEffect
+            };
+
+        // these must match with the ones in Profile Engine
+        enum TRingingTypes
+            {
+            ERingingTypeRinging = 0,
+            ERingingTypeAscending,
+            ERingingTypeRingOnce,
+            ERingingTypeBeepOnce,
+            ERingingTypeSilent
+            };
+
+		enum TFLAllowScreenSaver
+			{
+			EFLScreenSaverAllowed = 0,
+			EFLScreenSaverNotAllowed
+			};
+    
+    protected:// Constructors and destructor
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMFPreviewHandlerBase();
+    
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CMFPreviewHandlerBase();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	public:
+		void SetAttrL( TInt aAttr, TInt aValue );
+		void SetAttrL( TInt aAttr, const TDesC& aValue );
+		void SetAttrL( TInt aAttr, TAny* aValue );
+		TInt Attr( TInt aAttr );
+		void SetObserver( MPreviewHandlerObserver* aObserver );
+        virtual void PlayL() = 0;
+        virtual void Stop() = 0;
+        virtual TBool IsPlaying() = 0;
+
+    protected:
+        TInt ConvertVolume( TInt aVolume );
+        void ReadActiveProfileL();
+        TInt GetDataType( const TDesC& aFileName, TDataType& aDataType );
+        void ReadDefaultToneL();
+        void Panic( TInt aReason );
+        void EnableScreenSaver( TBool aEnable );
+        
+        void DisableBackLight();
+        		
+        static TInt DoResetInactivityTimer( TAny* aObject );
+    protected:
+        TInt RingingVolume();
+        TInt RingingType();
+        TInt Vibra();
+        TInt Echo3D();
+        TInt Effect3D();
+        
+    protected:
+        static TInt ConvertVolume( TInt aVolume, TInt aMaxVolume );
+        static TBool IsCallOngoing();
+        
+    protected:
+        TInt iRingingVolume;
+        TInt iRingingType;
+        TInt iVibra;
+        TInt i3DEffect;
+        TInt i3DEcho;
+        TInt iMediaType;
+        TInt iFileSize;
+        HBufC* iFullName;
+        
+        TBool iActiveProfileRead;
+        TInt iActiveProfileRingingVolume;
+        TInt iActiveProfileRingingType;
+        TInt iActiveProfileVibra;
+        TInt iActiveProfile3DEffect;
+        TInt iActiveProfile3DEcho;
+
+
+        MPreviewHandlerObserver* iObserver;
+        
+        TInt iPlayerStatus;
+        
+        // handle to window
+        RWindow* iWindow;  // does not own
+        
+        // for getting file MIME types
+        RApaLsSession iApaSession;
+        
+        // for setting screensaver on/off
+        RProperty iProperty;
+        
+        // default ringing tone
+        TFileName iDefaultTone;
+        
+        // file server session
+        //RFs iFsSession;
+        
+        /**
+		* Timer for resetting the user inactivity timeout
+		*/
+		CPeriodic* iBacklightTimer;
+    };
+
+
+
+/**
+* CMFVideoPreviewHandler
+* 
+* For previewing video files.
+*/
+NONSHARABLE_CLASS (CMFVideoPreviewHandler) : public CMFPreviewHandlerBase,
+                                             public MVideoPlayerUtilityObserver
+    {
+
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CMFVideoPreviewHandler* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMFVideoPreviewHandler();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMFVideoPreviewHandler();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	public:
+        void PlayL();
+        void Stop();
+        TBool IsPlaying();
+        void SetDisplayWindowL();
+
+    
+    private:
+        TInt VolumeRamp();
+        void SetRingingType( TInt aRingingType );
+        TInt ConvertVolume( TInt aVolume );
+        void Cancel();
+        void GetRectData( TRect aRect, TDes& aText );
+        
+
+        
+    private:
+        static TInt VolumeRampTimerCallback( TAny* aObj );
+        
+	private:	// from MVidePlayerUtilityObserver
+		void MvpuoOpenComplete( TInt aError );
+		void MvpuoFrameReady( CFbsBitmap& aFrame, TInt aError );
+		void MvpuoPlayComplete( TInt aError );
+		void MvpuoEvent( const TMMFEvent& aEvent );
+		void MvpuoPrepareComplete( TInt aError );
+        
+        
+    private:
+        
+    	//  video player
+    	CVideoPlayerUtility* iVideoPlayer;
+        
+        // ascending volume timer
+        CPeriodic* iVolumeRampTimer;
+        
+        // Ascending volume
+        TInt iRampedVolume;
+    };
+    
+
+
+/**
+* CMFAudioPreviewHandler
+* 
+* For previewing audio files (tones, music and recordings).
+*
+*/
+NONSHARABLE_CLASS (CMFAudioPreviewHandler) : public CMFPreviewHandlerBase,
+                                        public MDrmAudioPlayerCallback,
+                                        public MMdaAudioToneObserver
+
+    {
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CMFAudioPreviewHandler* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMFAudioPreviewHandler();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMFAudioPreviewHandler();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	public:
+        void PlayL();
+        void Stop();
+        TBool IsPlaying();
+
+    private:
+        void Cancel();
+        void SetAudioRingingType( TInt aRingingType );
+        void SetToneRingingType( TInt aRingingType );
+        TInt ConvertVolume( TInt aVolume );
+        
+        
+    private:  // from MMdaAudioToneObserver
+	    virtual void MatoPrepareComplete( TInt aError );
+	    virtual void MatoPlayComplete( TInt aError );
+
+    private:  // from MDrmAudioPlayerCallback
+        void MdapcInitComplete( TInt aError, const TTimeIntervalMicroSeconds& aDuration );
+        void MdapcPlayComplete( TInt aError );
+
+    private:
+        // audio player
+        CDrmPlayerUtility* iAudioPlayer;
+
+		/// Audioplayer status
+        TPlayerStatus iAudioPlayerStatus;
+
+		/// toneplayer
+        CMdaAudioToneUtility* iTonePlayer;
+
+		/// Toneplayer status
+        TPlayerStatus iTonePlayerStatus;
+        
+        // plugin for playing 3D effects
+        C3DRingingToneInterface* i3dRingingTonePlugin;
+        
+    };
+    
+
+    
+
+
+#endif  // MEDIAFILEPREVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafileprotection.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class used to check the protection of the 
+*                media files.
+*
+*/
+
+
+
+#ifndef MEDIAFILEPROTECTION_H
+#define MEDIAFILEPROTECTION_H
+
+#include "mediafiledialogutils.h"
+#include "mediafilevariation.h"
+
+//  INCLUDES
+
+#include <e32base.h>
+#include <DRMHelper.h>
+#include <apgcli.h>   // RApaLsSession
+
+
+// CONSTANTS
+
+
+//	FORWARD DECLARATIONS
+
+
+
+/**
+* CMFProtectionHandler
+* 
+* For gettting media file protection information (eg drm protection).
+* If media is protected and does not have necessary rights it cannot
+* be used eg as ringing tone. 
+*
+*/
+NONSHARABLE_CLASS (CMFProtectionHandler) : public CBase
+    {
+    public:
+    // enumeration which tells what is the file used for.
+    enum TIntention
+        {
+        EPlay,
+        ESelect
+        };
+    
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CMFProtectionHandler* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMFProtectionHandler();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMFProtectionHandler();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+    public: // Functions from base classes
+
+        /**
+        * Checks if an unprotected file is valid.
+        * @param aFileName Full path and filename.
+        * @param aIntention Describes what the file is used for.
+        * @return ETrue if the file is valid for intended use.
+        */
+        TBool IsFileValidL( const TDesC& aFileName, TIntention aIntention );
+        TBool IsFileValid( const TDesC& aFileName, TIntention aIntention );
+        TBool IsVideoValidL( const TDesC& aFileName, TIntention aIntention );
+        TBool IsVideoValid( const TDesC& aFileName, TIntention aIntention );
+
+        void SetAttrL( TInt aAttr, TInt aValue );
+        void SetAttrL( TInt aAttr, const TDesC& aValue );
+        
+
+    private:
+        /**
+        * Return media file type
+        */
+        //TInt32 MediaFileType( const TDesC& aFileName );
+
+        /**
+        * Set the automated content type
+        * @param  aAutomatedType: type of automated content
+        */
+        void SetAutomatedType(
+             CDRMHelper::TDRMHelperAutomatedType aAutomatedType );
+
+    private:
+
+        /**
+        * Displays an error note.
+        * @param @aResourceId Resource ID
+        */
+        void ShowErrorNoteL( TInt aResourceId );
+
+        /**
+        * Checks if an unprotected file is valid.
+        * @param aFileName Full path and filename.
+        * @param aIntention Describes what the file is used for.
+        * @return ETrue if the file is valid for intended use.
+        */
+        TBool IsFileValidUnprotectedL(
+              const TDesC& aFileName, TIntention aIntention );
+
+        /**
+        * Returns info whether demoplay is allowed for given filetype
+        * @param aDataType Tone MIME type
+        * @return ETrue if tone allowed to be played
+        */
+        //TBool AllowDemoPlay( const TDesC& aDataType );
+
+        /**
+        * Returns info whether given filetype is allowed as ringingtone
+        * @param aDataType Tone MIME type
+        * @return ETrue if tone is allowed to be selected
+        */
+        //TBool AllowSelect( const TDesC& aDataType ) const;
+
+        /**
+        * Finds out the MIME type of a given file
+        * @param aFileName File to be checked
+        * @return Returns datatype of a file
+        */
+        TDataType DataTypeL( const TDesC& aFileName );
+        
+        /**
+        * Finds out DRM restrictions for a given file
+        * @param aFileName File to be checked
+        * @param aInfoBits(out) Determines CFM protection
+        * @return Returns EFalse if file is corrupted or has no rights
+        */
+        TBool GetFileInfoL( const TDesC& aFileName, TInt32& aInfoBits );
+
+        /**
+        * Checks if file is WMDRM protected.
+        * @param aFileName Name of the file to be checked.
+        * @return ETrue if file is WMDRM protected, EFalse otherwise.
+        */
+        TBool   IsFileWMDRMProtectedL( const TDesC& aFileName );
+        
+        TBool CheckFileSize( const TDesC& aFile, const TDesC& aMimeType );
+
+
+    private:
+        // DRM common functions
+        DRMCommon* iDRMCommon;
+
+        // DRM helper
+        CDRMHelper* iDRMHelper;
+        
+        // for finding out drive type (eg memory card)
+        CDriveUtil* iDriveUtil;
+        
+        // for media file list variation
+        CMediaFileDialogVariation* iVariation;
+          
+        // Automated content type
+        CDRMHelper::TDRMHelperAutomatedType iAutomatedType;
+        
+        // max file size
+        TInt iMaxFileSize;
+        
+        // excluded mime types 
+        CMimeTypeList* iExcludedMimeTypes;
+        
+        RApaLsSession iApaLsSession;
+        RFs iFsSession;
+
+    };
+    
+
+    
+
+
+#endif  // MEDIAFILEPROTECTION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafiletest.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,275 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class create for testing.
+*
+*/
+
+
+#ifndef MEDIAFILETEST_H_
+#define MEDIAFILETEST_H_
+
+
+//  INCLUDES
+#include "mediafiledialogutils.h"
+
+#include <e32base.h>
+#include <AknDialog.h>
+#include <e32math.h>  // Math::FRand
+#include <AknInfoPopupNoteController.h> // CAknInfoPopupNoteController
+
+// for metadata engine
+#include <harvesterclient.h>
+
+
+
+#ifdef _DEBUG
+
+// CLASS DECLARATION
+class CMFVideoPreviewHandler;
+class CMediaFileDialog;
+class CMdeTest;
+ 
+
+/**
+* CRandomNum
+*
+* CRandomNum is used for generating random numbers.
+*/
+NONSHARABLE_CLASS (CRandomNum) :  public CBase
+    {
+    public:
+        static CRandomNum* NewLC();
+        static CRandomNum* NewL();
+        ~CRandomNum();
+    private:
+        CRandomNum();
+
+    public:
+        TInt Random(TInt aMax);
+        TInt Random( TInt aMin, TInt aMax );
+        TBool Match(TInt aPercentage);
+
+    private:
+        TInt64 iSeed;
+    };
+
+
+
+/**
+* CMFDialogTest
+*/
+NONSHARABLE_CLASS (CMFDialogTest) :  public CBase,
+                                     public MMFActiveCallerObserver
+    {
+    enum TNextStep
+        {
+        ENextFolder = 0,
+        ENextListItem = 1,
+        EMovePosition = 2
+        };
+
+    public:// Constructors and destructor
+
+        static CMFDialogTest* NewL( CMediaFileDialog* aDialog );
+        virtual ~CMFDialogTest();
+    
+    private:
+
+        CMFDialogTest( CMediaFileDialog* aDialog );
+        void ConstructL();
+        
+    public:
+        
+        TBool TestL( TInt aAttr );
+        void Test1L( TInt aAttr );
+        void Test2L( TInt aAttr );
+        void PrintTimeL( const TDesC& aText );
+        void SetTime();
+        
+    private:
+        void NextListItemL();
+        void MovePositionL();
+        void NextFolderL();
+        
+    private:
+        void SimulateKeyEventL( TInt aEvent );
+        void SimulateOpenEventL();
+        void SimulateBackEventL();
+        void SimulateSearchEventL();
+        
+    private:   // from MMFActiveCallerObserver
+        void HandleActiveCallL( TInt aCallId );
+
+    private:
+        void SetScreenSaverPeriod( TInt aPeriod );
+        void SetScreenSaverPeriodL( TInt aPeriod );
+        TInt ScreenSaverPeriodL();
+    private:
+        static TInt64 TimeAfter( TTime aBefore );
+        static TTime TimeBefore();
+    private:
+        void ShowPopupNoteL( const TDesC& aText );
+        
+        
+    public:
+        TTime iTime;
+        TInt iTestCounter;
+        TInt iBottomVisited;
+        TInt* iDestroyedPtr;
+    private:
+        CMediaFileDialog* iDlg;
+        CRandomNum* iRandomNum;
+        CMFActiveCaller* iTestCaller;
+        TInt iNewIndex;
+        TInt iScreenSaverPeriod;
+        
+        // popup note
+        CAknInfoPopupNoteController* iPopupNote;
+
+    };
+
+
+
+
+/**
+* CMediaFileDialog3
+*
+*/
+/*
+NONSHARABLE_CLASS (CMediaFileDialog3) : public CAknDialog
+    {
+    
+    public:// Constructors and destructor
+        static CMediaFileDialog3* NewL();
+        virtual ~CMediaFileDialog3();
+    
+    public:
+        static TBool ShowDialogL();
+    private:
+
+        CMediaFileDialog3();
+    
+        void ConstructL();
+        
+    private:
+        void PreLayoutDynInitL();
+        TBool OkToExitL( TInt aButtonId );
+        void ProcessCommandL(TInt aCommandId);
+        
+    private:
+        CMFVideoPreviewHandler* iVideoPreviewHandler;
+    };
+    
+*/
+
+
+/**
+* TMediaFileHistoryItem
+*
+*/
+NONSHARABLE_CLASS (TMediaFileHistoryItem)
+    {
+    public:
+        void SetId( TInt64 aId );
+        TInt64 Id();
+        void SetTime( TTime aTime );
+        TTime Time();
+        void InternalizeL( RReadStream& aStream );
+        void ExternalizeL( RWriteStream& aStream );
+
+
+    public:
+        // media file id 
+        TInt64 iId;
+        
+        // time stamp
+        TTime iTime;
+        
+        // media file name and path
+        TFileName iFullName;
+        
+        // does item exist
+        TBool iPresent;
+    };
+
+
+
+/**
+* CMediaFileHistory
+*
+* CMediaFileHistory is used for storing list of mediafile ids
+* (and time stapms). These ids refer to most recently selected
+* ringing tones. Notice that each media file list client has its
+* own most recent list (in its private folder).
+*   
+*/
+NONSHARABLE_CLASS (CMediaFileHistory) : public CBase
+    {
+    static const TInt KMaxHistoryItemCount = 3;
+    
+    public:
+        static CMediaFileHistory* NewL();
+        virtual ~CMediaFileHistory();
+    
+    private:
+        CMediaFileHistory();
+        void ConstructL();
+
+    public:  // public api
+        void AddItemL( TInt64 aId );
+        TInt Count();
+        void Sort();
+        void Clean();
+        void SetPresent( TBool aPresent, TInt aIndex );
+        void SetFileNameL( const TDesC& aFullName, TInt aIndex );
+        const TDesC& FileName( TInt aIndex );
+        TInt64 Id( TInt aIndex );
+        
+    private:
+        void WriteHistoryL();
+        void ReadHistoryL();
+        TInt ItemIndex( TInt aId );
+        void AddItemL( TMediaFileHistoryItem aItem );
+        TMediaFileHistoryItem& Item( TInt index );
+
+        TBool RemoveOldItem();
+        void Reset();
+    
+    private:
+        void InternalizeL( RReadStream& aStream );
+        void ExternalizeL( RWriteStream& aStream );
+        
+    
+    private:
+        static TInt CompareItems( const TMediaFileHistoryItem& aFirst, 
+                                  const TMediaFileHistoryItem& aSecond );
+
+    private:
+        static void GetTimeText( TDes& aText, TTime aTime );
+        
+    private:
+        // list of query items
+        RArray<TMediaFileHistoryItem> iList;
+        
+        // file server session
+        RFs iFsSession;
+        
+        // history file path
+        TFileName iPath;
+    };
+
+
+#endif // #ifdef _DEBUG
+
+#endif /*MEDIAFILETEST_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafilevariation.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Variation functionality class
+*
+*/
+
+
+
+#ifndef MEDIAFILEVARIATION_H
+#define MEDIAFILEVARIATION_H
+
+
+//  INCLUDES
+#include <e32base.h>
+
+
+// CONSTANTS
+
+//FORWARD DECLARATIONS
+class CRepository;    
+
+
+/**
+* CMediaFileDialogVariation
+* 
+* CMediaFileDialogVariation is used to varitate media file dialog.
+* Main purpose is to prevent selecting certain mime types. These
+* 'blocked' mime types are stored in central repository.  
+* Notice: This code is a copy from CProfilesLocalFeatures.  
+*/
+NONSHARABLE_CLASS(CMediaFileDialogVariation) : public CBase
+    {
+    public: // Constructors and destructor
+        static CMediaFileDialogVariation* NewL();
+        ~CMediaFileDialogVariation();
+
+    private:
+        void ConstructL();
+        CMediaFileDialogVariation( TInt aFeatureBitMask );
+
+    public:
+        TBool IsFeatureSupported( TInt aLocalFeatureId );
+        TBool IsBlockedType( const TDesC& aMimeType );
+        TBool IsBlockedUnprotectedType( const TDesC& aMimeType );
+        TBool IsBlockedProtectedType( const TDesC& aMimeType );
+        TBool IsBlockedDemoPlayType( const TDesC& aMimeType );
+        TBool IsExcludedType( const TDesC& aMimeType );
+
+    private:
+
+        void ReadListKeyL( CRepository& aCenRep, TUint32 aKey,
+                           RBuf& aValue );
+        TBool ContainsMimeType( const TDesC& aList, const TDesC& aMimeType );
+
+
+    private:
+
+        // the key containing boolean type features
+        TInt iFeatureBitMask;
+
+        // contains space separated list of blocked MIME-types
+        RBuf iBlockedTones;
+
+        // contains space separated list of blocked unprotected MIME-types
+        RBuf iBlockedUnprotectedTones;
+
+        // contains space separated list of blocked protected MIME-types
+        RBuf iBlockedProtectedTones;
+
+        // contains space separated list of blocked demo-play MIME-types
+        RBuf iBlockedDemoPlayTones;
+
+        // contains space separated list of excluded MIME-types
+        RBuf iExcludedTones;
+
+        // helper buffer for mime-type matching
+        RBuf iMimeBuf;
+    };
+    
+
+
+#endif  // MEDIAFILEVARIATION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafilevideopreviewdialog.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Dialog create for video preview
+*
+*/
+
+
+
+
+#ifndef VIDEOPREVIEWDIALOG_H_
+#define VIDEOPREVIEWDIALOG_H_
+
+
+//  INCLUDES
+#include <AknDialog.h>
+
+#include "mediafilepreview.h"
+
+// CLASS DECLARATION
+
+
+/**
+* CVideoPreviewDialog
+*
+*/
+NONSHARABLE_CLASS (CVideoPreviewDialog) : public CAknDialog,
+                                          public MPreviewHandlerObserver,
+                                          public MCoeForegroundObserver
+    {
+    public:// Constructors and destructor
+        static CVideoPreviewDialog* NewL( TAny* aVideoHandler );
+        virtual ~CVideoPreviewDialog();
+    
+    public:
+        TBool ShowDialogLD( TInt* aError );
+        void SetAttrL( TInt aAttr, TInt aValue );
+        void SetAttrL( TInt aAttr, const TDesC& aValue );
+        void SetAttrL( TInt aAttr, TAny* aValue );
+        // Close the dialogue to cancel the preview
+        void CloseDialogL();
+
+
+    private:
+        CVideoPreviewDialog( TAny* aVideoHandler );
+        void ConstructL();
+        
+    private:
+        void PreLayoutDynInitL();
+        void PostLayoutDynInitL();
+        TBool OkToExitL( TInt aButtonId );
+        void ProcessCommandL(TInt aCommandId);
+        void HandleResourceChange(TInt aType);
+        
+    private:
+        void CloseDialogWithDelayL();
+        static TInt CloseDialog( TAny *aObj );
+        
+    private:   // from MPreviewHandlerObserver
+        void HandlePreviewEventL( TInt aEvent, TInt aError );
+        
+    private:
+        void HandleGainingForeground();
+        void HandleLosingForeground();
+        
+        
+    private:
+        CMFVideoPreviewHandler* iVideoHandler;
+        TBool iVideoHandlerCreated;
+        
+        // for closing dialog
+        CIdle* iIdle;
+        
+        TInt* iError;
+        
+    };
+
+
+#endif /*VIDEOPREVIEWDIALOG_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Inc/mediafilewaitnote.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Waiting note for query
+*
+*/
+
+
+
+#ifndef MEDIAFILEWAITNOTE_H
+#define MEDIAFILEWAITNOTE_H
+
+
+//  INCLUDES
+#include "mediafiledialogutils.h"
+
+#include <e32base.h>
+#include <AknWaitDialog.h>
+#include <AknProgressDialog.h>
+#include <AknsItemID.h>
+
+
+// CLASS DECLARATIONS
+
+
+/**
+* MMediaFileWaitNoteObserver
+* 
+* Observer interface function for observing wait note.
+*/
+NONSHARABLE_CLASS (MMediaFileWaitNoteObserver)
+    {
+    public:
+        /**
+        * Callback method
+        * Get's called when a dialog is dismissed.
+        */
+        virtual void HandleWaitNoteL( TInt aButtonId ) = 0;
+    };
+
+
+
+
+/**
+* MMediaFileWaitNote
+*  
+* MMediaFileWaitNote shows progress dialog.
+*/
+NONSHARABLE_CLASS (CMediaFileWaitNote) : public CBase,
+                                         public MProgressDialogCallback
+    {
+
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CMediaFileWaitNote* NewL( MMediaFileWaitNoteObserver* aObserver );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMediaFileWaitNote();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMediaFileWaitNote( MMediaFileWaitNoteObserver* aObserver );
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+        
+		/**
+		* From MProgressDialogCallback.
+        * Called by the framework when dialog is dismissed.
+        * @param aButtonId
+        * @return None
+        */
+        void DialogDismissedL( TInt aButtonId );
+
+    public:        
+        
+        /**
+        * Launches progress dialog.
+        * @return None.
+        */
+        void LaunchL( const TDesC& aLabel );
+
+        
+        /**
+        * Closes progress dialog.
+        * @param None
+        * @return None
+        */
+        void CancelProgressDialogL();
+        
+        /**
+        * Set dialog label text.
+        * @param aText.
+        * @return None.
+        */
+        void SetTextL( const TDesC& aText );
+        
+        /**
+        * Set image data.
+        * @param aId.
+        * @param aFileName.
+        * @param aFileBitmapId.
+        * @param aFileMaskId.
+        * @return None.
+        */
+        void SetImageL( TAknsItemID aId, const TDesC& aImageFile,
+                        TInt aBitmapId, TInt aBitmapMaskId );
+
+        /**
+        * Set progress bar state.
+        * @param aValue.
+        * @return None
+        */
+        void SetProgress( TInt aValue );
+
+        /**
+        * Set progress bar state.
+        * @param aFinalValue.
+        * @return None
+        */
+        void SetFinalProgress( TInt aFinalValue );
+
+        /**
+        * Gets CAknNoteControl from CAknProgressDialog.
+        * @param None
+        * @return CAknNoteControl.
+        */
+		CAknNoteControl* NoteControl();
+
+       /**
+        * Cancels animation.
+        * @param None.
+        * @return None.
+        */
+		void CancelAnimation();
+        
+		/**
+        * Starts animation.
+        * @param None
+        * @return None.
+        */
+		void StartAnimationL();
+		
+		/**
+        * Hides cancel button.
+        * @param None
+        * @return None.
+        */
+		void HideButtonL();
+
+
+    private:
+    
+        // progress dialog
+        CAknProgressDialog* iProgressDialog;
+
+        // progress dialog info
+        CEikProgressInfo* iProgressInfo;
+
+		// last label text
+		TBuf<KBufSize128> iLastText;
+
+		// animation state
+		TBool iAnimation;
+
+		// dialog observer
+		MMediaFileWaitNoteObserver*	iObserver;
+			    
+		TFileName iImageFile;
+		TAknsItemID iImageId;
+	    TInt iBitmapId;
+	    TInt iBitmapMaskId;
+	    
+	    // is observer call needed
+	    TBool iObserverCallNeeded;
+        
+	    // has dialog's DialogDismissedL called (ie has it been closed)
+	    TBool iDialogDismissed;
+    };
+
+
+
+
+#endif      // MEDIAFILEWAITNOTE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafiledialog.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3259 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class of Mediafiledialog. UI control of mediafilelist
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "mediafiledialog.h"
+#include "mediafiledialogutils.h"
+#include "mediafilelist.h"
+#include "mediafilehandler.h"
+#include "mediafilelistdebug.h"
+#include "mediafileprotection.h"
+#include "mediafilevideopreviewdialog.h"
+#include "mediafiletest.h"  // test code
+
+#include <eikclbd.h>        // for CColumnListBoxData
+#include <coecobs.h>        // MCoeControlObserver
+#include <AknUtils.h>       // AknTextUtils AknFind
+#include <AknIconArray.h>   // for GulArray
+#include <AknWaitDialog.h>
+#include <textresolver.h>
+#include <StringLoader.h>
+#include <akninputblock.h>      // CAknInputBlock
+#include <mmferrors.h> 
+// search field
+#include <aknselectionlist.h>  // AknSelectionList.cpp
+#include <aknsfld.h>           // CAknSearchField
+#include <eikcapc.h>         // CEikCaptionedControl
+
+#include <aknconsts.h>         // KAvkonBitmapFile, KAvkonVariatedBitmapsFile
+#include <AknsConstants.h>     // icon constants
+#include <aknmemorycardui.mbg> // memory card icon
+#include <avkon.mbg>
+
+#include <avkon.loc>
+#include <mediafilelist.rsg>
+#include <mediafilelist.mbg>
+#include <data_caging_path_literals.hrh> // KDC_APP_RESOURCE_DIR
+
+
+
+
+
+/******************************************************************************
+ * class CMediaFileDialog
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CMediaFileDialog* CMediaFileDialog::NewL()
+    {
+    FLOG( _L("CMediaFileDialog::NewL START") );
+
+    CMediaFileDialog* self = new (ELeave) CMediaFileDialog();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    FLOG( _L("CMediaFileDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::CMediaFileDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileDialog::CMediaFileDialog()
+	{
+	FLOG( _L("CMediaFileDialog::CMediaFileDialog START") );
+    
+	iResourceFileId = KErrNotFound;
+    iForeGround = ETrue;
+    iDatabaseOpen = EFalse;
+    iPeninputActive = EFalse;
+    
+    iNullItemFileTypeOne = KErrNotFound;
+    iNullItemFileTypeTwo = KErrNotFound;
+    iDialogTitle = KNullDesC;
+    iIsDoubleClicked = EFalse;
+   
+    FLOG( _L("CMediaFileDialog::CMediaFileDialog END") );
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMediaFileDialog::~CMediaFileDialog()
+    {
+    FLOG( _L("CMediaFileDialog::~CMediaFileDialog START") );
+
+    if ( iResourceFileId != KErrNotFound )
+        {
+        CEikonEnv::Static()->DeleteResourceFile( iResourceFileId );
+        }
+ 	
+    delete iStatusPaneHandler;
+ 	delete iMFListHandler;
+ 	delete iMediaFileHandler;
+ 	delete iState;
+	
+    delete iFindCtrl;
+    delete iCaller;
+    delete iSearchCaller;
+    
+    delete iAudioPreviewHandler;
+    delete iVideoPreviewHandler;
+    
+    delete iNullItemFileNameOne;
+    delete iNullItemFileNameTwo;
+    
+    if ( iAvkonAppUi )
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+    	
+    CCoeEnv::Static()->RemoveForegroundObserver( *this );
+    
+    if ( iPopupNote )
+        {
+        iPopupNote->HideInfoPopupNote();
+        delete iPopupNote;
+        }
+    
+    delete iWaitNote;
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        iPeninputServer.RemovePenUiActivationHandler();
+        iPeninputServer.Close();
+        }
+    
+    delete iIdle;
+    
+    delete iProtectionHandler;
+    
+    delete iInputBlock;
+   
+#ifdef _DEBUG    
+    delete iTest;  // test code
+#endif
+	
+    FLOG( _L("CMediaFileDialog::~CMediaFileDialog END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::ConstructL()
+    {
+    FLOG( _L("CMediaFileDialog::ConstructL START") );
+	
+    iResourceFileId = TMFDialogUtil::AddResFileL();
+    
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    coeEnv->AddForegroundObserverL( *this );
+
+	CAknDialog::ConstructL( R_MEDIA_FILE_DIALOG_MENU );
+	
+    if ( iMenuBar )
+        {
+    	iMenuBar->SetContextMenuTitleResourceId(
+		R_MEDIA_FILE_DIALOG_CONTEXT_MENU );
+	    }
+	
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL( iAvkonAppUi );
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	iMediaFileHandler = CMediaFileHandler::NewL();
+	iMediaFileHandler->SetObserver( this );
+	
+    iState = CMediaFileDialogState::NewL();
+    
+#ifndef RD_VIDEO_AS_RINGING_TONE    
+    iState->HideRootFolder( EEFolderVideos, ETrue,
+                            KNullDesC, KErrNotFound );
+    
+    iMediaFileHandler->SetAttrL( CMediaFileList::EAttrExcludeFolder, CMediaFileList::EFolderVideos );
+#endif
+ 
+    iMFListHandler = CMFListHandler::NewL();
+    iMFListHandler->SetObserver( this );
+    
+    iCaller = CMFActiveCaller::NewL( this );
+    iSearchCaller = CMFActiveCaller::NewL( this );
+    
+    iAudioPreviewHandler = CMFAudioPreviewHandler::NewL();
+    iVideoPreviewHandler = CMFVideoPreviewHandler::NewL();
+    
+    iAudioPreviewHandler->SetObserver( this );
+    
+    iPopupNote = CAknInfoPopupNoteController::NewL();
+    
+    iWaitNote = CMediaFileWaitNote::NewL( this );
+    
+    if ( AknLayoutUtils::PenEnabled() )
+        { 
+        User::LeaveIfError( iPeninputServer.Connect() ); 
+        iPeninputServer.AddPenUiActivationHandler( this, EPluginInputModeAll );
+        }
+    
+    iProtectionHandler = CMFProtectionHandler::NewL();
+    
+#ifdef _DEBUG    
+    iTest = CMFDialogTest::NewL( this );  // test code
+#endif
+   
+	FLOG( _L("CMediaFileDialog::ConstructL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CMediaFileDialog::ShowDialogL( TDes* aFileName, TInt* aNullItem,
+                                     TInt* aInfo, TDes* aDesInfo )
+	{
+	__ASSERT_ALWAYS( aFileName, Panic( KErrGeneral ) );
+	__ASSERT_ALWAYS( aNullItem, Panic( KErrGeneral ) );
+	
+	iFileName = aFileName;
+	
+	iNullItem = aNullItem;
+	*iNullItem = KErrNotFound;
+	
+	iInfo = aInfo;
+	iDesInfo = aDesInfo;
+	
+	TBool ret = ExecuteLD( R_MEDIA_FILE_DIALOG );
+	
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+void CMediaFileDialog::SetAttrL( TInt aAttr, TInt aValue )
+	{
+	iAudioPreviewHandler->SetAttrL( aAttr, aValue );
+	iVideoPreviewHandler->SetAttrL( aAttr, aValue );
+	iMediaFileHandler->SetAttrL( aAttr, aValue );
+	iProtectionHandler->SetAttrL( aAttr, aValue );
+
+    if ( aAttr == CMediaFileList::EAttrExcludeFolder )
+        {
+        if ( aValue  == CMediaFileList::EFolderDownload )
+            {
+            iState->HideRootFolder( EEFolderDownload, ETrue,
+                                    KNullDesC, KErrNotFound );
+            }
+        if ( aValue  == CMediaFileList::EFolderVideos )
+            {
+            iState->HideRootFolder( EEFolderVideos, ETrue,
+                                    KNullDesC, KErrNotFound );
+            }
+        }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+void CMediaFileDialog::SetAttrL( TInt aAttr, const TDesC& aValue )
+	{
+	iAudioPreviewHandler->SetAttrL( aAttr, aValue );
+	iVideoPreviewHandler->SetAttrL( aAttr, aValue );
+	iMediaFileHandler->SetAttrL( aAttr, aValue );
+    iProtectionHandler->SetAttrL( aAttr, aValue );
+	
+	if ( aAttr == CMediaFileList::EAttrTitle )
+	    {
+	    TMFDialogUtil::StrCopy( iDialogTitle, aValue );
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+void CMediaFileDialog::SetAttrL( TInt aAttr, TAny* aValue )
+    {
+    iAudioPreviewHandler->SetAttrL( aAttr, aValue );
+    iVideoPreviewHandler->SetAttrL( aAttr, aValue );
+    iMediaFileHandler->SetAttrL( aAttr, aValue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::SetNullItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::SetNullItemL( const TDesC& aText, 
+                                     const TDesC& aMediaFile,
+                                     TInt aMediaFileType, TInt aIconId )
+    {
+    TInt iconId = EEIconEmpty;
+    if ( aIconId == CMediaFileList::ENullItemIconDefaultTone )
+        {
+        iconId = EEIconTone;
+        }
+    else if ( aIconId == CMediaFileList::ENullItemIconOff )
+        {
+        iconId = EEIconNullItemOff;
+        }
+        
+    TInt mediaType = CMediaFileList::EMediaFileTypeAudio;
+    if ( aMediaFileType == CMediaFileList::EMediaFileTypeVideo )
+        {
+        mediaType = CMediaFileList::EMediaFileTypeVideo;
+        }
+        
+        
+    if ( !iNullItemFileNameOne )
+        {
+        iNullItemFileNameOne = aMediaFile.AllocL();
+        iNullItemFileTypeOne = mediaType;
+        
+        iState->EnableNullItemL( EEFolderNullItemOne, aText, iconId );
+        }
+    else if ( !iNullItemFileNameTwo )
+        {
+        iNullItemFileNameTwo = aMediaFile.AllocL();
+        iNullItemFileTypeTwo = mediaType;
+        
+        iState->EnableNullItemL( EEFolderNullItemTwo, aText, iconId );
+        }
+    else
+        {
+        User::Leave( KErrNotSupported ); // two null items supported
+        }
+    }
+
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::ActivateL
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL( this );
+	AknFind::HandleFixedFindSizeChanged( this, iListBox, FindBox() );
+	DrawNow();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::PreLayoutDynInitL()
+    {
+    const TInt KFindBoxLength = 20;
+    
+    iListBox = (CAknSingleGraphicStyleListBox*) (ControlOrNull(1));
+    
+   	__ASSERT_ALWAYS( iListBox, TMFDialogUtil::Panic( KErrGeneral ) );
+    
+    iListBox->Model()->SetItemTextArray( iMFListHandler );
+    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    
+	iListBox->SetListBoxObserver( this );
+	iListBox->CreateScrollBarFrameL( ETrue );
+	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                 CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
+	
+	iListBox->SetContainerWindowL( *this );
+	
+	SetIconsL();
+	
+	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+
+
+    iState->Init();
+    
+    if ( iDialogTitle.Length() > 0 )
+        {
+        iStatusPaneHandler->SetTitleL( iDialogTitle );
+        }
+    else
+        {
+	    iStatusPaneHandler->SetTitleL( R_QTN_MEDIA_FILE_DIALOG_TITLE );
+        }
+	iStatusPaneHandler->SetNaviPaneTitleL( KNullDesC );
+	
+	
+    //
+    // create find box. NOTE: findbox functionality is quite complex and
+	// is implemented by copy pasting code from other apps.
+    //
+	
+    CFindControl* control = ( CFindControl* )ControlOrNull( EFindControl );
+    if ( control )
+        {
+        CAknSearchField::TSearchFieldStyle flags = CAknSearchField::EFixed;
+        control->iFind = CAknSearchField::NewL( 
+                                   *control, flags, 0, KFindBoxLength );
+        //control->iFind = searchField;
+        control->SetContainerWindowL( *this );
+        CEikEdwin& edwin = control->iFind->Editor(); 
+        control->iFind->AddAdaptiveSearchTextObserverL( this );
+        }	
+
+     if ( FindBox() )
+        {
+        CAknFilteredTextListBoxModel* model = 
+        STATIC_CAST( CAknFilteredTextListBoxModel*, iListBox->Model() );
+       
+        FindBox()->MakeVisible( EFalse );
+        }
+        
+      
+    UpdateListBoxL();
+    
+    DrawDeferred();
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::ProcessCommandL
+//
+// Handle commands from menu. NOTE: Current implemntation does not use menu.
+// Menu handling code is here for (possible) future use.
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::ProcessCommandL( TInt aCommandId )
+    {
+    HideMenu();
+    
+    switch (aCommandId)
+        {
+        case EAknCmdHelp:
+            {
+            break;
+            }
+
+        case EAknSoftkeySelect:
+            {
+            TBool ret = HandleOKL( EAttrSelect );
+            if ( ret )
+                {
+                TryExitL( EEikCmdExit );
+                }
+            break;
+            }
+            
+        case EAknSoftkeyView:
+            {
+            PreviewL( CMediaFileList::EMediaFileTypeVideo );
+            break;
+            }
+        case EAknCmdOpen:
+            {
+            HandleOKL( EAttrOpen );
+            break;
+            }
+
+        case EAknCmdExit:
+        case EEikCmdExit:
+            {
+            // close dialog and exit calling application
+            iAvkonAppUi->ProcessCommandL( EAknCmdExit );
+            break;
+            }
+
+        default:            
+            break;
+        }
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::OkToExitL
+//
+// Hanlde commands from cba.
+//------------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::OkToExitL(TInt aButtonId)
+    {
+    if ( aButtonId == EEikBidCancel )
+        {
+        return ETrue;  // close dialog
+        }
+
+    if ( aButtonId == EEikBidOk )
+        {
+        TBool ret = HandleOKL( EAttrSelect );
+        return ret;
+        }
+
+    if ( aButtonId == EAknSoftkeyBack )
+        {
+        if ( !HandleBackL() )
+            {
+#ifdef _DEBUG            
+            // start test code
+            TInt currentIndex = CurrentItemListIndex();
+            if ( iState->FolderId( currentIndex ) == EEFolderRecordings )
+                {
+                if ( !iTest->TestL( 0 ) )
+                    {
+                    return ETrue; // test canceled
+                    }
+                return EFalse;  // test accepted
+                }
+            // end test code
+#endif            
+            
+            return ETrue; // Back pressed in top level folder
+            }
+            
+        return EFalse; // leave dialog open
+        }
+
+    if ( aButtonId == EAknSoftkeyContextOptions )
+        {
+        ShowContextMenuL( R_MEDIA_FILE_DIALOG_CONTEXT_MENU );
+        return EFalse;
+        }
+
+    if ( aButtonId == EAknSoftkeyOpen )
+        {
+        TBool ret = HandleOKL( EAttrOpen );
+        return ret;
+        }
+    
+    if ( aButtonId == EAknSoftkeySelect )
+        {
+        TBool ret = HandleOKL( EAttrSelect );
+        return ret;
+        }
+    
+    if ( aButtonId == EAknSoftkeyView )
+        {
+        PreviewL( CMediaFileList::EMediaFileTypeVideo );
+        return EFalse;
+        }
+
+    if ( aButtonId == EAknSoftkeyEmpty )
+        {
+        return EFalse;
+        }
+
+    return CAknDialog::OkToExitL( aButtonId );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CMediaFileDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CMediaFileDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,
+                                                      TEventCode aType)
+    {
+    // must pass escape event to dialog - findbox and listbox "eat" escape events
+    TKeyResponse res = EKeyWasNotConsumed;
+    if ( aType == EEventKey && aKeyEvent.iCode == EKeyEscape )
+        {
+        res = CAknDialog::OfferKeyEventL( aKeyEvent, aType );
+        }
+    if ( res == EKeyWasConsumed ) 
+        {
+        return res;
+        }
+        
+
+    TBool backSpace = EFalse;
+    
+    if (aType == EEventKey)
+        {
+        switch (aKeyEvent.iCode)
+            {
+            case EKeyEnter:
+                {
+                break;
+                }
+            case EKeyUpArrow:
+            case EKeyDownArrow:
+                {
+                TInt itemCount = iListBox->Model()->NumberOfItems();
+                if ( itemCount == 1 )
+                    {
+                    PreviewL( CMediaFileList::EMediaFileTypeAudio );    
+                    }
+                break;
+                }
+
+            case EKeyLeftArrow:
+                {
+                if (FindBox() && FindBox()->IsVisible()
+                        && FindBox()->TextLength() != 0)
+                    {
+                    FindBoxCursorMoveL( 0 );
+                    res = EKeyWasConsumed;
+                    }
+                else
+                    {
+                    HandleBackL();
+                    return EKeyWasConsumed;
+                    }
+                break;
+                }
+
+            case EKeyRightArrow:
+                {
+                if (FindBox() && FindBox()->IsVisible()
+                        && FindBox()->TextLength() != 0)
+                    {
+                    FindBoxCursorMoveL( 1 );
+                    res = EKeyWasConsumed;
+                    }
+                else
+                    {
+                    HandleOKL( EAttrOpen );
+                    return EKeyWasConsumed;
+                    }
+                break;
+                }
+
+            case EKeyBackspace:
+                {  
+                backSpace = ETrue;
+                break;
+                }
+
+            default:
+                {
+                break;
+                }
+            }
+        
+    if ( FindBox() && FindBox()->IsVisible() )
+        {
+        res = FindBox()->OfferKeyEventL( aKeyEvent, aType );
+        
+        if ( backSpace && FindBox()->TextLength() == 0 &&
+             ( iState->CurrentFolder() == EEFolderSearch ||
+             iState->CurrentFolder() == EEFolderSearchMusic ) && !iPeninputActive )
+            {
+            // user cleared search field - go back to main view
+            HandleBackL();
+            return EKeyWasConsumed;
+            }
+        }
+        }
+        
+  
+    if ( res == EKeyWasNotConsumed )
+         {
+         res = CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+         }
+    return res;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::FindBoxCursorMoveL( TInt aType )
+//
+// NOTE: This function is used to move the cursor of the find box.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::FindBoxCursorMoveL( TInt aType )
+    {
+    if ( FindBox() && FindBox()->IsVisible() )
+        {
+        TInt pos = FindBox()->Editor().CursorPos();
+        TInt textLength = FindBox()->Editor().TextLength();
+        if ( aType == 0 )//left
+            {
+            pos = pos - 1;
+            if ( pos < 0 )
+                {
+                pos = textLength;
+                }
+            }
+        else if ( aType == 1 )
+            {
+            pos = pos + 1;
+            if ( pos > textLength )
+                {
+                pos = 0;
+                }
+            }
+        else
+            {
+            pos = textLength;
+            }
+        FindBox()->Editor().SetCursorPosL( pos ,EFalse );
+        }
+    }
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::SetSizeAndPosition (from CAknDialog)
+//
+// NOTE: This code is copy paste from elsewhere.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::SetSizeAndPosition( const TSize& /*aSize*/ )
+    {
+    TRect mainPane;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
+    
+    SetRect( mainPane );
+
+    if ( FindBox() && FindBox()->IsVisible() )
+        {
+        AknFind::HandleFixedFindSizeChanged( this, iListBox, FindBox() );
+        }
+
+    Line( ESelectionListControl)->SetRect( iListBox->Rect() );
+    if ( FindBox() ) 
+        {
+        Line( EFindControl )->SetRect( iListBox->Rect() );
+        }    
+    }
+
+
+// ----------------------------------------------------------------------------
+// CMediaFileDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleResourceChange(TInt aType)
+    {   
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        // handle change in layout orientation
+        CAknDialog::HandleResourceChange( aType );
+         if ( FindBox() && FindBox()->IsVisible() )
+	        {
+	        AknFind::HandleFixedFindSizeChanged( this, iListBox, FindBox() );
+	        }
+        return;
+        }
+        
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE( SetIconsL() );
+        }
+        
+    CCoeControl::HandleResourceChange( aType );
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::DynInitMenuPaneL
+//
+// Called by system before menu is shown. NOTE: Menu currently not used. 
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane )
+    {
+    TInt menu1 = R_MEDIA_FILE_DIALOG_MENU_PANE;
+    TInt menu2 = R_MEDIA_FILE_DIALOG_CONTEXT_MENU_PANE;
+    
+    if ( aResourceID != menu1 && aResourceID != menu2 )
+        {
+        return; // not one of our menus
+        }
+
+    TInt itemCount = iListBox->Model()->NumberOfItems();
+    TInt currentIndex = iListBox->CurrentItemIndex();
+    TInt folderId = iState->FolderId( currentIndex );
+    TInt currentFolderId = iState->CurrentFolder();
+
+
+    // context menu only used in video folder
+    if ( aResourceID == R_MEDIA_FILE_DIALOG_CONTEXT_MENU_PANE )
+        {
+        if ( itemCount == 0 )
+            {
+            // folder is empty
+            DeleteMenuItem( aMenuPane, EAknSoftkeySelect );
+            DeleteMenuItem( aMenuPane, EAknSoftkeyView );
+            }
+        return;
+        }
+
+    
+    if ( itemCount == 0 )
+        {
+        // list has no items
+        DeleteMenuItem( aMenuPane, EAknCmdOpen );
+        DeleteMenuItem( aMenuPane, EAknSoftkeySelect );
+        DeleteMenuItem( aMenuPane, EAknSoftkeyView );
+        return;
+        }
+    
+    if ( folderId == EEFolderDownload || folderId == EEFolderNullItemOne || 
+         folderId == EEFolderNullItemTwo )
+        {
+        // selected item is null item
+        DeleteMenuItem( aMenuPane, EAknCmdOpen );
+        DeleteMenuItem( aMenuPane, EAknSoftkeyView );
+        }
+    else if ( folderId != KErrNotFound )
+        {
+        // selected item is folder
+        DeleteMenuItem( aMenuPane, EAknSoftkeySelect );
+        DeleteMenuItem( aMenuPane, EAknSoftkeyView );
+        }
+    else
+        {
+        // selected item is file
+        if ( iState->CurrentFolder() == EEFolderVideos )
+            {
+            DeleteMenuItem( aMenuPane, EAknCmdOpen );
+            }
+        else if ( iState->CurrentFolder() == EEFolderSearch )
+            {
+            DeleteMenuItem( aMenuPane, EAknCmdOpen );
+        
+            if ( !IsVideoFile( currentIndex ) )
+                {
+                DeleteMenuItem( aMenuPane, EAknSoftkeyView );
+                }
+            }
+        else
+            {
+            DeleteMenuItem( aMenuPane, EAknCmdOpen );
+            DeleteMenuItem( aMenuPane, EAknSoftkeyView );    
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CMediaFileDialog::CountComponentControls
+//
+// Gets the number of controls contained in a compound control.
+// ---------------------------------------------------------------------------
+//
+TInt CMediaFileDialog::CountComponentControls() const
+    {
+    TInt newitems = 0;
+    if ( FindBox() )
+        {
+        newitems++;
+        }
+    return CAknDialog::CountComponentControls() + newitems;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CMediaFileDialog::CountComponentControls
+//
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CMediaFileDialog::ComponentControl( TInt aIndex ) const
+    {
+    if ( aIndex == CAknDialog::CountComponentControls() )
+        {
+        return FindBox();
+        }
+    return CAknDialog::ComponentControl( aIndex );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::FindBox
+//
+// -----------------------------------------------------------------------------
+//
+CAknSearchField* CMediaFileDialog::FindBox() const
+     {
+     CFindControl* control = ( CFindControl* )ControlOrNull( EFindControl );
+     if ( control )
+         {
+         return control->iFind;
+         }
+     else
+         {
+         return NULL;
+         }
+     }
+
+// ---------------------------------------------------------------------------
+// CMediaFileDialog::ResetFindBoxL
+//
+// ---------------------------------------------------------------------------
+//
+void CMediaFileDialog::ResetFindBoxL()
+    {
+    if ( !FindBox() )
+        {
+        return;
+        }
+   
+    CAknFilteredTextListBoxModel* model = 
+    STATIC_CAST( CAknFilteredTextListBoxModel*, iListBox->Model() );
+    CAknListBoxFilterItems* filter = model->Filter();
+    TInt currentFolder = iState->CurrentFolder();
+    
+    // reset find box
+    if ( filter )
+        {
+        filter->ResetFilteringL();
+        filter->SetObserver( NULL );
+        model->RemoveFilter();
+        
+        // CreateFilterL sets CAknSearchField to observe filter
+        // (CAknListBoxFilterItems) but RemoveFilter does not remove observer
+        FindBox()->SetObserver( NULL );
+        }
+    
+    if (FindBox()->TextLength() > 0 && (currentFolder != EEFolderSearch
+            && currentFolder != EEFolderSearchMusic))
+        {
+        FindBox()->SetSearchTextL( KNullDesC );    
+        }
+    
+ 
+    // show/hide find box
+    if ( iState->FindBoxNeeded() )
+        {
+        if ( currentFolder != EEFolderSearch && 
+             currentFolder != EEFolderSearchMusic &&
+             currentFolder != EEFolderRoot &&
+             currentFolder != EEFolderMusic )
+            {
+            // normal find only finds matches from listbox item texts
+            model->CreateFilterL( iListBox, FindBox() );
+            filter = model->Filter();
+            filter->ResetFilteringL();
+            filter->SetObserver( this );     // MCoeControlObserver
+            }
+        else
+            {
+            // search and root folders have custom find that makes
+            // database search
+            FindBox()->SetObserver( this );  // MCoeControlObserver
+            }
+//        if ( currentFolder == EEFolderSearch || 
+//             currentFolder == EEFolderSearchMusic )
+//            {
+//            FindBox()->SetSearchTextL( iSearchText );
+//            }
+ 
+        FindBox()->MakeVisible( ETrue );
+        }
+    else
+        {
+        FindBox()->MakeVisible( EFalse );
+        }
+            
+    TSize size;
+    SetSizeAndPosition( size );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::CreateCustomControlL (from CAknDialog)
+//
+// Create find control.
+// -----------------------------------------------------------------------------
+//
+SEikControlInfo CMediaFileDialog::CreateCustomControlL( TInt aControlType )
+    {
+    if ( aControlType != EAknCtSelectionListPopupFind &&
+         aControlType != EAknCtSelectionListFixedFind )
+        {
+        SEikControlInfo info;
+        info.iControl = NULL;
+        info.iFlags = 0;
+        info.iTrailerTextId = 0;
+        return info;
+        }
+
+    CCoeControl* findControl = NULL;
+    findControl = new (ELeave) CFindControl;
+
+    SEikControlInfo info;
+    info.iControl = findControl;
+    info.iFlags = 0;
+    info.iTrailerTextId = 0;
+    return info;
+    }
+
+    
+// ----------------------------------------------------------------------------
+// CMediaFileDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CMediaFileDialog::SetIconsL()
+    {
+    _LIT( KBitmapFile, "mediafilelist.mbm" );
+    
+        
+    if ( !iListBox )
+        {
+        return;
+        }
+    
+    TMFDialogUtil::SetIconFileNameL( KBitmapFile, iIconFileName );
+    
+    CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(1);
+    CleanupStack::PushL( icons );
+
+    
+    //
+    // NOTE: append order must match TMediaFileListIcons
+    //
+    
+    // music item icon
+    icons->AppendL( IconL( KAknsIIDQgnIndiAiNtMusic, iIconFileName,
+                           EMbmMediafilelistQgn_indi_ai_nt_music,
+                           EMbmMediafilelistQgn_indi_ai_nt_music_mask ) );
+
+    // tone item icon, default tone icon
+    icons->AppendL( IconL( KAknsIIDQgnPropMupAudio, iIconFileName,
+                           EMbmMediafilelistQgn_prop_mup_audio,
+                           EMbmMediafilelistQgn_prop_mup_audio_mask ) );
+
+    // video item icon
+    icons->AppendL( IconL( KAknsIIDQgnPropFmgrFileVideo, iIconFileName,
+                           EMbmMediafilelistQgn_prop_fmgr_file_video,
+                           EMbmMediafilelistQgn_prop_fmgr_file_video_mask ) );
+
+    // recording item icon
+    icons->AppendL( IconL( KAknsIIDQgnPropFmgrFileVoicerec, iIconFileName,
+                           EMbmMediafilelistQgn_prop_fmgr_file_voicerec,
+                           EMbmMediafilelistQgn_prop_fmgr_file_voicerec_mask ) );
+
+    // artist icon
+    icons->AppendL( IconL( KAknsIIDQgnPropMupArtist, iIconFileName,
+                           EMbmMediafilelistQgn_prop_mup_artist,
+                           EMbmMediafilelistQgn_prop_mup_artist_mask ) );
+
+    // album icon
+    icons->AppendL( IconL( KAknsIIDQgnPropMupAlbum, iIconFileName,
+                           EMbmMediafilelistQgn_prop_mup_album,
+                           EMbmMediafilelistQgn_prop_mup_album_mask ) );
+
+    // genre icon
+    icons->AppendL( IconL( KAknsIIDQgnPropMupGenre, iIconFileName,
+                           EMbmMediafilelistQgn_prop_mup_genre,
+                           EMbmMediafilelistQgn_prop_mup_genre_mask ) );
+
+    // composer icon
+    icons->AppendL( IconL( KAknsIIDQgnPropMupComposer, iIconFileName,
+                           EMbmMediafilelistQgn_prop_mup_composer,
+                           EMbmMediafilelistQgn_prop_mup_composer_mask ) );
+
+    // folder icon (tones, music, videos, recordings, all music, artist,
+    // album, genre, composer, artist all)
+    icons->AppendL( IconL( KAknsIIDQgnPropFolderSmall, iIconFileName,
+                           EMbmMediafilelistQgn_prop_folder_small,
+                           EMbmMediafilelistQgn_prop_folder_small_mask ) );
+
+    // unknown folder icon
+    icons->AppendL( IconL( KAknsIIDQgnPropMceUnknownRead, iIconFileName,
+                           EMbmMediafilelistQgn_prop_mce_unknown_read,
+                           EMbmMediafilelistQgn_prop_mce_unknown_read ) );
+
+    // download item icon (null item)
+    icons->AppendL( IconL( KAknsIIDQgnPropLinkEmbdSmall, iIconFileName,
+                           EMbmMediafilelistQgn_prop_link_embd_small,
+                           EMbmMediafilelistQgn_prop_link_embd_small_mask ) );
+
+    // off item icon (null item)
+    icons->AppendL( IconL( KAknsIIDQgnPropSmlSyncOff, iIconFileName,
+                           EMbmMediafilelistQgn_prop_sml_sync_off,
+                           EMbmMediafilelistQgn_prop_sml_sync_off_mask ) );
+
+    // memory card icon
+    icons->AppendL( IconL( KAknsIIDQgnIndiMmcAdd, iIconFileName,
+                           EMbmMediafilelistQgn_indi_mmc_add,
+                           EMbmMediafilelistQgn_indi_mmc_add_mask ) );
+
+     // mass storage icon
+    icons->AppendL( IconL( KAknsIIDQgnPropLinkEmbdSmall, iIconFileName,
+                           EMbmMediafilelistQgn_indi_fmgr_ms_add,
+                           EMbmMediafilelistQgn_indi_fmgr_ms_add_mask ) );
+
+    // empty icon
+    icons->AppendL( IconL( KAknsIIDQgnPropEmpty, KAvkonBitmapFile,
+                           EMbmAvkonQgn_prop_empty,
+                           EMbmAvkonQgn_prop_empty_mask ) );
+    
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr = iListBox->ItemDrawer()->ColumnData()->IconArray();
+    if ( arr )
+        {
+        arr->ResetAndDestroy();
+        delete arr;
+        arr = NULL;
+        }
+
+    iListBox->ItemDrawer()->ColumnData()->SetIconArray( icons );
+    CleanupStack::Pop( icons );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CMediaFileDialog::IconL(TAknsItemID aId, const TDesC& aFileName,
+                                   TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(), aId,
+                                aFileName, aFileIndex, aFileMaskIndex);
+	return icon;	
+	}
+
+
+// ----------------------------------------------------------------------------
+// CMediaFileDialog::ShowContextMenuL
+// 
+// ----------------------------------------------------------------------------
+//
+void CMediaFileDialog::ShowContextMenuL( TInt /*aResource*/ )
+	{
+	// Switch to Context specific options menu,
+	if ( iMenuBar )
+	    {
+	    TRAP_IGNORE( iMenuBar->TryDisplayContextMenuBarL() );    
+	    }
+	}
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::HandleBackL
+//
+//------------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::HandleBackL()
+	{
+	TInt err = KErrNone;
+	TBool ret = ETrue;
+
+	TRAP( err, ret = DoHandleBackL() );
+	
+    if ( err != KErrNone )
+        {
+        FLOG( _L("### CMediaFileDialog::HandleBackL (%d) ###"), err );
+        
+        ResetDialogL( err );
+        return ETrue;
+        }
+        
+    return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::DoHandleBackL
+//
+//------------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::DoHandleBackL()
+	{
+    if ( iState->CurrentFolder() == EEFolderRoot )
+        {
+        // return EFalse only when called from root folder
+        return EFalse;    
+        }
+
+	if ( !iMediaFileHandler->QueryReady() )
+	    {
+	    FLOG( _L("### CMediaFileDialog::DoHandleBackL: query in progress ###") );
+	    return ETrue;  // query in progress
+	    }
+  
+    TInt folderId = iState->NextFolderUp();
+    TInt currentIndex = CurrentItemListIndex();
+    
+    iState->SetQueryInfo( folderId, KNullDesC, currentIndex, EEQueryUp );
+    QueryL( folderId );
+    
+    return ETrue;
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::HandleOKL
+//
+//------------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::HandleOKL( TInt aAttr )
+	{
+    TInt err = KErrNone;
+    TBool ret = EFalse;
+    
+    TRAP( err, ret = DoHandleOKL( aAttr ) );
+    
+    if ( err != KErrNone )
+        {
+        FLOG( _L("### CMediaFileDialog::HandleOKL (%d) ###"), err );
+        
+        ResetDialogL( err );
+        return EFalse;
+        }
+        
+    return ret;
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::DoHandleOKL
+//
+// Selects file or opens folder. If file is selected (ie dialog can
+// be closed) return value is ETrue.
+//------------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::DoHandleOKL( TInt aAttr )
+	{
+	if ( !iMediaFileHandler->QueryReady() )
+	    {
+	    FLOG( _L("### CMediaFileDialog::DoHandleOKL: query in progress ###") );
+	    return EFalse;  // query in progress
+	    }
+	    
+    TInt currentIndex = CurrentItemListIndex();
+    if ( currentIndex == KErrNotFound )
+        {
+        return EFalse; // empty folder
+        }
+        
+    TBool isPersistent = EFalse;
+    TInt iconId = EEIconEmpty;
+    TInt folderId = KErrNotFound;
+    iState->GetFolderInfo( currentIndex, folderId, iBuf,
+                                         isPersistent, iconId );
+
+    if ( folderId == EEFolderDownload || folderId == EEFolderNullItemOne ||
+         folderId == EEFolderNullItemTwo || folderId == KErrNotFound )
+        {
+        if ( aAttr == EAttrOpen )
+            {
+            return EFalse;  // these can only be selected, not opened    
+            }
+        }
+        
+
+    if ( folderId == EEFolderDownload )
+        {
+        *iNullItem = 0;
+         // user selected 'Download' item - launch browser
+         CWebBrowserLauncher* launcher = CWebBrowserLauncher::NewLC();
+         launcher->LaunchBrowserL();
+         CleanupStack::PopAndDestroy( launcher );
+         return EFalse;
+        }
+
+    if ( folderId == EEFolderNullItemOne )
+        {
+        if ( iNullItemFileNameOne )
+            {
+            TMFDialogUtil::StrCopy( *iFileName, *iNullItemFileNameOne );
+            }
+        *iNullItem = 1;
+        return ETrue;
+        }
+
+    if ( folderId == EEFolderNullItemTwo )
+        {
+        if ( iNullItemFileNameTwo )
+            {
+            TMFDialogUtil::StrCopy( *iFileName, *iNullItemFileNameTwo );
+            }
+        *iNullItem = 2;
+        return ETrue;
+        }
+
+    if ( folderId == KErrNotFound )
+        {
+        // user has selected some media file
+	    GetSelectedItemFileName( currentIndex, iBuf );
+	    
+	    TBool ret = ETrue;
+	    
+	    // protection check not done when item is double checked
+	   // if ( aAttr != EAttrDoubleClicked )
+	   if (!ifilevalid)
+	        {
+	    	iFileisvalid = iProtectionHandler->IsFileValid( iBuf, 
+	                                        CMFProtectionHandler::ESelect );
+	    ifilevalid=ETrue;
+	        }
+	    
+  	   if ( !iFileisvalid)
+		   {
+		   ifilevalid=EFalse; 
+		   }
+	    if ( iFileisvalid )
+	        {
+	        TMFDialogUtil::StrCopy( *iFileName, iBuf );
+	        }
+	    
+	    return iFileisvalid;  // ret is ETrue is selected file's drm is OK
+        }
+
+    
+    if ( folderId != KErrNotFound && aAttr != EAttrSelect )
+        {
+        iBuf = KNullDesC;
+        // selected list item is folder
+         if ( !isPersistent )
+            {
+            // read non-persistent folder text from database
+            GetListItemText( currentIndex, iBuf );
+            }
+      
+        iState->SetQueryInfo( folderId, iBuf, currentIndex, EEQueryDown );
+        QueryL( folderId );
+        }
+
+    return EFalse;
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::SearchL
+//
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::SearchL()
+    {
+    TInt err = KErrNone;
+    
+    TRAP( err, DoSearchL() );
+    
+    if ( err != KErrNone )
+        {
+        ResetDialogL( err );
+        }
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::DoSearchL
+//
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::DoSearchL()
+    {
+    if ( !FindBox() )
+        {
+        return;
+        }
+    
+    if ( iPeninputActive)
+        {
+      return;
+        }
+    if ( !iMediaFileHandler->QueryReady() )
+        {
+        FLOG( _L("### CMediaFileDialog::DoSearchL: query in progress ###") );
+        return;  // query in progress
+        }
+    
+    TInt currentFolder = iState->CurrentFolder();
+    
+    if ( FindBox()->TextLength() == 0 )
+        {
+        return;
+        }
+    FindBox()->GetSearchText( iSearchText );
+    
+    _LIT(KSpecialChar, "%");
+    _LIT(KReplaceChar, "\\%" );
+    TBuf<10> buf;
+    buf.Copy( KSpecialChar );
+    TInt position = iSearchText.FindF( buf );
+    if ( position != KErrNotFound )
+        {
+        buf.Copy( KReplaceChar );
+        iSearchText.Replace( position,1,buf );
+        }
+
+    
+    if ( currentFolder == EEFolderRoot || currentFolder == EEFolderSearch )
+        {
+        TInt currentIndex = iListBox->CurrentItemIndex();
+        iState->SetQueryInfo( EEFolderSearch, KNullDesC, currentIndex, EEQueryDown );
+        
+        QueryL( EEFolderSearch );
+        }
+    else if ( currentFolder == EEFolderMusic || currentFolder == EEFolderSearchMusic )
+        {
+        TInt currentIndex = iListBox->CurrentItemIndex();
+        iState->SetQueryInfo( EEFolderSearchMusic, KNullDesC, currentIndex, EEQueryDown );
+        
+        QueryL( EEFolderSearchMusic );
+        }
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::ResetDialogL
+//
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::ResetDialogL( TInt aError)
+    {
+    iMediaFileHandler->EnableObserverCall( EFalse );
+    iMediaFileHandler->CancelQuery();
+    iMediaFileHandler->EnableObserverCall( ETrue );
+    
+    iState->Init();  
+    UpdateListBoxL();
+
+    if ( aError != KErrNone )
+        {
+        ShowErrorNoteL( aError );
+        }
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::QueryL
+//
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::QueryL( TInt aFolderId, TBool aDatabaseChanged )
+    {
+    if ( !iMediaFileHandler->QueryReady() || !iDatabaseOpen )
+        {
+        FLOG( _L("### CMediaFileDialog::QueryL: query in progress ###") );
+        return;
+        }
+
+    iMediaFileHandler->EnableObserverCall( ETrue );
+    
+    TInt folderId = aFolderId;
+    
+    iMediaFileHandler->SetQueryId( folderId );
+    
+    if ( folderId == EEFolderAllMusic )
+        {
+        iMediaFileHandler->QueryMusicL( 0 );
+        }
+        
+    else if ( folderId == EEFolderVideos )
+        {
+        iMediaFileHandler->QueryVideosL( 0 );
+        }
+
+    else if ( folderId == EEFolderArtistRoot ||
+              folderId == EEFolderAlbumRoot  ||
+              folderId == EEFolderGenreRoot  || 
+              folderId == EEFolderComposerRoot )
+        {
+        if ( iState->UnknownCount( folderId ) == KErrNotFound )
+            {
+            TInt attr = MapAttribute( folderId );
+            iMediaFileHandler->QueryMusicUnknownCountL( attr );
+            }
+        else
+            {
+            TInt attr = MapAttribute( folderId );
+            iMediaFileHandler->QueryAttributeValuesL( attr );
+            }
+        }
+    
+    else if ( folderId == EEFolderAlbum || folderId == EEFolderGenre ||
+              folderId == EEFolderComposer )
+        {
+        TInt attr = MapAttribute( folderId );
+        iState->GetText( folderId, iBuf );
+        iMediaFileHandler->QueryMusicL( attr, iBuf );
+        }
+    
+    else if ( folderId == EEFolderArtistUnknown || folderId == EEFolderAlbumUnknown ||
+              folderId == EEFolderGenreUnknown ||folderId == EEFolderComposerUnknown )
+        {
+        TInt attr = MapAttribute( folderId );
+        iMediaFileHandler->QueryMusicUnknownL( attr );
+        }
+    
+    else if ( folderId == EEFolderArtist )
+        {
+        iState->GetText( EEFolderArtist, iBuf );
+        iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtist,
+                           iBuf, KNullDesC, aDatabaseChanged );
+        }
+
+    else if ( folderId == EEFolderArtistAll )
+        {
+        iState->GetText( EEFolderArtist, iBuf );
+        iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtistAll,
+                                         iBuf, KNullDesC, aDatabaseChanged );
+        }
+
+    else if ( folderId == EEFolderArtistAlbum )
+        {
+        TBuf<KBufSize128> buf;
+        iState->GetText( EEFolderArtistAlbum, buf );
+        iState->GetText( EEFolderArtist, iBuf );
+        iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtistAlbum,
+                           iBuf, buf, aDatabaseChanged );
+        }
+
+    else if ( folderId == EEFolderArtistAlbumUnknown )
+        {
+        iState->GetText( EEFolderArtist, iBuf );
+        iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtistUnknown,
+                           iBuf, KNullDesC, aDatabaseChanged );
+        }
+
+    else if ( folderId == EEFolderTones )
+        {
+        //iMediaFileHandler->QueryTonesL( 0 );
+        iMediaFileHandler->QueryDefaultTonesL( 0 );
+        ShowWaitNoteL( EFalse );
+        }
+    
+    else if ( folderId == EEFolderRecordings )
+        {
+        iMediaFileHandler->QueryRecordingsL( 0 );
+        }
+
+    else if ( folderId == EEFolderSearch )
+        {
+        if ( iSearchText.Length() > 0 )
+            {
+            iMediaFileHandler->SearchL( iSearchText );    
+            }
+        else
+            {
+            iMediaFileHandler->QueryEmptyL();
+            }
+        }
+    else if ( folderId == EEFolderSearchMusic )
+        {
+        if ( iSearchText.Length() > 0 )
+            {
+            iMediaFileHandler->SearchAudioL( iSearchText );    
+            }
+        else
+            {
+            iMediaFileHandler->QueryEmptyL();
+            }
+        }
+    else
+        {
+        // make empty query
+        iMediaFileHandler->QueryEmptyL();
+        }
+    
+    if ( !iMediaFileHandler->QueryReady() )
+        {
+        // query is running - show wait note with delay. wait note is
+        // removed in HandleMFEventL
+        ShowWaitNoteL( aDatabaseChanged );
+        }
+    
+#ifdef _DEBUG    
+    iTest->SetTime();
+#endif    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::MapAttribute
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialog::MapAttribute( TInt aFolderId )
+    {
+    TInt attr = KErrNotFound;
+    
+    switch ( aFolderId )
+        {
+        case EEFolderArtistRoot:
+        case EEFolderArtist:
+        case EEFolderArtistUnknown:
+            {
+            attr = CMediaFileHandler::EAttrArtist;
+            break;
+            }
+        case EEFolderAlbumRoot:
+        case EEFolderAlbum:
+        case EEFolderAlbumUnknown:
+            {
+            attr = CMediaFileHandler::EAttrAlbum;
+            break;
+            }
+        case EEFolderGenreRoot:
+        case EEFolderGenre:
+        case EEFolderGenreUnknown:
+            {
+            attr = CMediaFileHandler::EAttrGenre;
+            break;
+            }
+        case EEFolderComposerRoot:
+        case EEFolderComposer:
+        case EEFolderComposerUnknown:
+            {
+            attr = CMediaFileHandler::EAttrComposer;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+        
+    return attr;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ShowDetailsPopupL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::ShowDetailsPopupL()
+    {
+    if ( !iMediaFileHandler->QueryReady() )
+        {
+        return;  // query in progress
+        }
+        
+    TInt currentIndex = CurrentItemListIndex();
+    TInt folderId = iState->CurrentFolder();
+    
+    if ( folderId != EEFolderSearch && folderId != EEFolderSearchMusic )
+        {
+        return;
+        }
+    if ( currentIndex < 0 )
+        {
+        return;
+        }
+    
+    TInt id = iMediaFileHandler->Attribute( currentIndex, 
+                                            CMediaFileHandler::EAttrMediaFileId,
+                                            iState->CurrentFolder() );
+    if ( id == KErrNotFound )
+        {
+        return;
+        }
+    
+    TInt mediaType = iMediaFileHandler->Attribute( currentIndex, 
+            CMediaFileHandler::EAttrMediaType,
+            iState->CurrentFolder() );
+    
+    TInt storageType = iMediaFileHandler->Attribute( currentIndex, 
+            CMediaFileHandler::EAttrStorageType,
+            iState->CurrentFolder() );
+    
+    CMediaFileData* data = NULL;
+
+    if ( storageType == CMediaFileHandler::ERomStorage )
+        {
+        if ( mediaType == CMediaFileHandler::EMediaTypeTone )
+            {
+            data = iMediaFileHandler->RomMediaFileDataL( id , CMediaFileHandler::EMediaTypeTone );
+            }
+        if ( mediaType == CMediaFileHandler::EMediaTypeVideo )
+            {
+            data = iMediaFileHandler->RomMediaFileDataL( id , CMediaFileHandler::EMediaTypeVideo );
+            }
+        }
+    else
+    	{
+    	data = iMediaFileHandler->ReadMediaFileDataL( id );
+    	}
+
+    CleanupStack::PushL( data );
+
+    GetPopupText( data, iPopupText );
+    
+    CleanupStack::PopAndDestroy( data );
+    
+    if ( iPopupText.Length() > 0 )
+        {
+        ShowPopupNoteL( iPopupText );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::GetPopupText
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::GetPopupText( CMediaFileData* aData, TDes& aText )
+    {
+    TBuf<KBufSize64> searchText;
+    TBuf<KBufSize64> attributeName;
+    
+    aText = KNullDesC;
+    
+    if ( FindBox()->TextLength() >= KBufSize64 )
+        {
+        return;
+        }
+    FindBox()->GetSearchText( searchText );
+   
+    aData->GetAttr( CMediaFileHandler::EAttrSongName, aText );
+    if ( MatchFound( aText, searchText ) )
+        {
+        aText = KNullDesC;
+        return;
+        }
+    
+    aData->GetAttr( CMediaFileHandler::EAttrArtist, aText );
+    if ( MatchFound( aText, searchText ) )
+        {
+        StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_ARTIST );
+        aText.Insert( 0, attributeName );
+        return;
+        }
+
+    aData->GetAttr( CMediaFileHandler::EAttrAlbum, aText );
+    if ( MatchFound( aText, searchText ) )
+        {
+        StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_ALBUM );
+        aText.Insert( 0, attributeName );
+        return;
+        }
+
+    aData->GetAttr( CMediaFileHandler::EAttrGenre, aText );
+    if ( MatchFound( aText, searchText ) )
+        {
+        StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_GENRE );
+        aText.Insert( 0, attributeName );
+        return;
+        }
+
+    aData->GetAttr( CMediaFileHandler::EAttrComposer, aText );
+    if ( MatchFound( aText, searchText ) )
+        {
+        StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_COMPOSER );
+        aText.Insert( 0, attributeName );
+        return;
+        }
+    
+    aText = KNullDesC;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::MatchFound
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::MatchFound( const TDesC& aAttribute, 
+                                    const TDesC& aText )
+    {
+    _LIT( KSpace, " " );
+    
+    if ( aText.Length() >= KBufSize64 )
+        {
+        return EFalse; // too long search text
+        }
+
+    if ( aAttribute.FindC( aText ) == 0 )
+        {
+        // match found from the beginning of the first word
+        return ETrue; 
+        }
+
+    TBuf<KBufSize64> buf;
+    buf = aText;
+    buf.Insert( 0, KSpace );
+    
+    if ( aAttribute.FindC( buf ) != KErrNotFound )
+        {
+        // match found from the beginning of the word
+        return ETrue; 
+        }
+    
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::PreviewL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::PreviewL( TInt aMediaType )
+    {
+    //FLOG( _L("CMediaFileDialog::PreviewL START") );
+    
+    if ( !iMediaFileHandler->QueryReady() )
+        {
+        FLOG( _L("### CMediaFileDialog::PreviewL: query in progress ###") );
+        return;  // query in progress
+        }
+
+    if ( !iForeGround )
+        {
+        return;  // dialog is not visible
+        }
+        
+    TInt currentIndex = CurrentItemListIndex();
+    if ( currentIndex == KErrNotFound )
+        {
+        return;  // list is empty 
+        }
+    
+    TInt folderId = iState->FolderId( currentIndex );
+    if ( folderId == EEFolderNullItemOne || folderId == EEFolderNullItemTwo )
+        {
+        PreviewNullItemL( folderId );
+        return;
+        }
+    
+    if ( folderId != KErrNotFound )
+        {
+        return; // focused list item is folder
+        }
+     
+     
+    if ( iState->CurrentFolder() == EEFolderVideos  &&
+         aMediaType != CMediaFileList::EMediaFileTypeVideo )
+        {
+        return;
+        }
+    
+    GetSelectedItemFileName( currentIndex, iBuf );
+    if ( iBuf.Length() == 0 )
+        {
+        return;
+        }
+        
+    if ( aMediaType == CMediaFileList::EMediaFileTypeVideo )
+        {
+        PreviewVideoL( iBuf );
+        return;
+        }
+    
+    if ( iState->CurrentFolder() == EEFolderSearch )
+        {
+        if ( IsVideoFile( currentIndex ) )
+            {
+            return; // search folder may contain videos - no automatic preview                
+            }
+        }
+        
+    if ( !iProtectionHandler->IsFileValid( iBuf, CMFProtectionHandler::EPlay  ) )
+        {
+        return;
+        }
+        
+    iAudioPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, iBuf );
+    iAudioPreviewHandler->PlayL();
+    
+    //FLOG( _L("CMediaFileDialog::PreviewL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::PreviewVideoL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::PreviewVideoL( const TDesC& aFileName )
+    {
+    if ( !iProtectionHandler->IsVideoValid( aFileName, CMFProtectionHandler::EPlay ) )
+         {
+         return;
+         }
+
+    // in case "Beep once" one audio beep is played before showing video
+    TInt type = iAudioPreviewHandler->Attr( CMediaFileList::EAttrRingingType );
+    if ( type == CMFPreviewHandlerBase::ERingingTypeBeepOnce )
+        {
+        iAudioPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, aFileName );
+        iAudioPreviewHandler->PlayL();
+        }
+     
+    iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, aFileName );
+    TInt err = KErrNone;
+    if ( iVideoPreviewDlg && iVideoPreviewHandler->IsPlaying() )
+        {
+        iVideoPreviewDlg->CloseDialogL();
+        iVideoPreviewDlg = NULL;
+        }
+    iVideoPreviewDlg = CVideoPreviewDialog::NewL( iVideoPreviewHandler );
+    TBool ret = iVideoPreviewDlg->ShowDialogLD( &err );
+
+    if ( err != KErrNone )
+        {
+        FLOG( _L("### CVideoPreviewDialog::ShowDialogLD (%d) ###"), err );
+        }
+     
+    ShowPreviewErrorNoteL( err, CMediaFileHandler::EMediaTypeVideo );
+    
+    if ( ret )
+        {
+        CloseDialogWithDelayL();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::PreviewLNullItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::PreviewNullItemL( TInt aFolderId )
+    {
+    HBufC* fileName = NULL;
+    TInt fileType = KErrNotFound;
+    
+    if ( aFolderId == EEFolderNullItemOne )
+        {
+        fileType = iNullItemFileTypeOne;
+        fileName = iNullItemFileNameOne; 
+        }
+    if ( aFolderId == EEFolderNullItemTwo )
+        {
+        fileType = iNullItemFileTypeTwo;
+        fileName = iNullItemFileNameTwo; 
+        }
+
+    if ( fileType != CMediaFileList::EMediaFileTypeAudio && 
+         fileType != CMediaFileList::EMediaFileTypeVideo )
+        {
+        return;
+        }
+    if ( !fileName )
+        {
+        return;
+        }
+        
+    if ( fileType == CMediaFileList::EMediaFileTypeAudio )
+        {
+        iAudioPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, *fileName );
+        iAudioPreviewHandler->PlayL();
+        }
+    if ( fileType == CMediaFileList::EMediaFileTypeVideo )
+        {
+        // null item file type cannot be video
+        }
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::CancelPreview
+//
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::CancelPreview()
+    {
+    iAudioPreviewHandler->Stop();
+    iCaller->Cancel();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::StartPreviewWithDelay
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::StartPreviewWithDelay()
+    {
+	const TInt KOneSecond = 1000;
+	
+	iAudioPreviewHandler->Stop();
+
+    // automatic preview starts after delay. see HandleActiveCallL.
+    iCaller->Start( EAttrPreview, KOneSecond );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::StartSearchWithDelay
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::StartSearchWithDelay()
+    {
+    if ( iPeninputActive )
+        {
+        // search does not start automatically in pen input mode
+        return;
+        }
+    
+    const TInt KOneSecond = 1000;
+    
+    // search starts after delay. see HandleActiveCallL.
+    iSearchCaller->Start( EAttrSearch, KOneSecond );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::StartRomScan()
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::StartRomScan()
+    {
+    delete iIdle;
+    iIdle = NULL;
+    iIdle = CIdle::NewL( CActive::EPriorityIdle );
+    
+    if ( iIdle )
+        {                    
+        iIdle->Start( TCallBack( StartRomScaning, iMediaFileHandler ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::StartRomScaning()
+// 
+// -----------------------------------------------------------------------------
+//
+
+TInt CMediaFileDialog::StartRomScaning( TAny* aInstance )
+    {
+    CMediaFileHandler* handler = static_cast<CMediaFileHandler*> ( aInstance );
+    handler->StartRomScaning( CMediaFileHandler::EQueryTone );
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::IsVideoFile
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::IsVideoFile( TInt aCurrentIndex )
+    {
+    if ( aCurrentIndex < 0 )
+        {
+        return EFalse;
+        }
+    
+    TInt current = iState->CurrentFolder();
+    
+    if ( current == EEFolderVideos )
+        {
+        return ETrue;
+        }
+    
+    if ( current != EEFolderSearch )
+        {
+        return EFalse;
+        }
+    
+    TInt mediaType = iMediaFileHandler->Attribute( aCurrentIndex,
+                                        CMediaFileHandler::EAttrMediaType,
+                                        current );
+
+    if ( mediaType == CMediaFileHandler::EMediaTypeVideo )
+        {
+        return ETrue;
+        }
+    
+    return EFalse;           
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::IsValidVideoFileL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialog::IsValidVideoFileL( TInt aCurrentIndex, TInt aIntention )
+    {
+    TBuf<KBufSize128> buf;
+    
+    if ( !IsVideoFile( aCurrentIndex ) )
+        {
+        return EFalse;
+        }
+    
+    CMFProtectionHandler::TIntention intention;
+    if ( aIntention == CMFProtectionHandler::EPlay )
+        {
+        intention = CMFProtectionHandler::EPlay;
+        }
+    else
+        {
+        intention = CMFProtectionHandler::ESelect;
+        }
+    GetSelectedItemFileName( aCurrentIndex, buf );
+    
+    if ( iProtectionHandler->IsVideoValid( buf, intention ) )
+        {
+        return ETrue;    
+        }
+    return EFalse;
+    }
+
+
+
+// ----------------------------------------------------------------------------
+// CMediaFileDialog::UpdateListBoxL
+// 
+// Update listbox contents (currently open folder items).
+// ----------------------------------------------------------------------------
+//
+void CMediaFileDialog::UpdateListBoxL( TBool aRestFindBox )
+    {
+    // prevent flickering during listbox update. ResetFindBoxL seems
+    // to draw listbox many times
+    iListBox->MakeVisible( EFalse );
+
+    TRAP_IGNORE( DoUpdateListBoxL( aRestFindBox ) );
+    
+    iListBox->MakeVisible( ETrue );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CMediaFileDialog::DoUpdateListBoxL
+// 
+// Update listbox contents (currently open folder items).
+// ----------------------------------------------------------------------------
+//
+void CMediaFileDialog::DoUpdateListBoxL( TBool aRestFindBox )
+    {
+    iState->SetUnknownFolderPosition( iMediaFileHandler->ResultCount() );
+    
+    // check current item index in case media file database has changed
+    CheckListboxIndex();
+    if ( aRestFindBox )
+    	{
+    	ResetFindBoxL();
+    	iListBox->HandleItemAdditionL();
+    	}
+    
+    TInt index = iState->CurrentItemIndex();
+    if ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        }
+    else
+        {
+        iListBox->SetCurrentItemIndex( 0 );    
+        }
+    
+    TBuf<KBufSize128> buf;
+    if ( iState->CurrentFolder() == EEFolderSearch || 
+         iState->CurrentFolder() == EEFolderSearchMusic )
+        {
+        TInt count = iListBox->Model()->NumberOfItems();
+        iState->GetSearchTitle( buf, count );
+        }
+    else
+        {
+        iState->GetTitle( iState->CurrentFolder(), buf );
+//#ifdef _DEBUG
+        TInt folder = iState->CurrentFolder();
+        if ( iState->FindBoxNeeded() && folder != EEFolderMusic && 
+             folder != EEFolderRoot )
+            {
+            TBuf<KBufSize128> buf2( buf );
+            TInt count = iListBox->Model()->NumberOfItems();
+            buf.Format( _L("%S  (%d)"), &buf2, count );
+            }
+//#endif
+        }
+    
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf );
+    iStatusPaneHandler->SetNaviPaneTitle( buf );
+   
+    UpdateCbaL( 0 );
+    
+    DrawNow();
+    
+    if ( iState->QueryDirection() != EEQueryUpdate )
+        {
+        CancelPreview();
+        }
+    
+    ShowDetailsPopupL();       // for search view info popup
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::UpdateCbaL
+// 
+// Update cba. NOTE: Commented code (menu cba) is for (possible) future use.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::UpdateCbaL( TInt /*aAttr*/ )
+    {
+    TInt itemCount = iListBox->Model()->NumberOfItems();
+    TInt currentIndex = CurrentItemListIndex();
+    TInt folderId = iState->FolderId( currentIndex );
+    TInt currentFolderId = iState->CurrentFolder();
+  	  	
+	
+	CEikButtonGroupContainer& cba = ButtonGroupContainer(); // from eikbtgpc.h
+	
+
+	// Videos folder
+    if ( currentFolderId == EEFolderVideos )
+        {
+        if ( itemCount == 0 )
+            {
+            cba.SetCommandSetL( R_AVKON_SOFTKEYS_BACK );
+            //cba.SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
+            }
+        else
+            {
+            if ( IsValidVideoFileL( currentIndex, CMFProtectionHandler::EPlay ) )
+                {
+                cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_PREVIEW_SELECT_BACK );    
+                }
+            else
+                {
+                cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK );
+                }
+            
+            //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_CONTEXT_BACK );
+            }
+        return;
+        }
+
+    
+    // Search folder
+    if ( currentFolderId == EEFolderSearch || 
+         currentFolderId == EEFolderSearchMusic )
+        {
+        if ( itemCount == 0 )
+            {
+            cba.SetCommandSetL( R_AVKON_SOFTKEYS_BACK );
+            // cba.SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
+            }
+        else
+            {
+            if ( IsValidVideoFileL( currentIndex, CMFProtectionHandler::EPlay ) )
+                {
+                cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_PREVIEW_SELECT_BACK );
+                }
+            else
+                {
+                cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK );
+                }
+                //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_SELECT_BACK );
+            }
+        return;
+        }
+    
+    
+	// Root folder
+	if ( currentFolderId == EEFolderRoot )
+	    {
+	    if ( folderId == EEFolderDownload || folderId == EEFolderNullItemOne ||
+	         folderId == EEFolderNullItemTwo )
+	        {
+	        //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_SELECT_BACK );
+	        cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK );
+	        }
+	    else
+	        {
+	        //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_OPEN_BACK );
+	        cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPEN_OPEN_BACK );
+	        }
+	    return;
+	    }
+	
+	
+	// other folders
+    if ( itemCount == 0 )
+	    {
+	    // folder is empty
+	    cba.SetCommandSetL( R_AVKON_SOFTKEYS_BACK );
+        //cba.SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
+        }
+	else if ( folderId != KErrNotFound )
+	    {
+	    // list items are folders
+        cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPEN_OPEN_BACK );
+        //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_OPEN_BACK );
+	    }
+	else
+	    {
+	    // list items are files
+        cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK );
+        //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_SELECT_BACK );
+	    }
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::Panic
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::Panic( TInt aReason ) 
+    {
+	_LIT( KPanicCategory, "CMediaFileDialog" );
+	
+	User::Panic( KPanicCategory, aReason ); 
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ShowErrorNoteL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::ShowErrorNoteL( TInt aError )
+	{
+    TInt err = aError;
+    
+    if ( err == KErrNone )
+        {
+        return;
+        }
+
+    iBuf = KNullDesC;
+    CTextResolver* tr = CTextResolver::NewLC();
+	iBuf = tr->ResolveErrorString( err, CTextResolver::ECtxNoCtxNoSeparator );
+  	CleanupStack::PopAndDestroy( tr );
+	
+	if ( iBuf.Length() > 0 )
+	    {
+  	    TMFDialogUtil::ShowErrorNoteL( iBuf );
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ShowPreviewErrorNoteL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::ShowPreviewErrorNoteL( TInt aError, TInt aMediaType )
+    {
+    TInt err = KErrNone;
+    
+    if ( aError == KErrNoMemory || aError == KErrDiskFull )
+        {
+        CTextResolver* tr = CTextResolver::NewLC();
+        iBuf = tr->ResolveErrorString( aError, CTextResolver::ECtxNoCtxNoSeparator );
+        CleanupStack::PopAndDestroy( tr );
+        err = aError;
+        }
+    else if ( aError == KErrNotSupported || aError == KErrCorrupt ||aError == KErrMMPartialPlayback)
+        {
+        if ( aMediaType == CMediaFileHandler::EMediaTypeVideo )
+            {
+            StringLoader::Load( iBuf, R_QTN_INFO_CLIP_FORMAT_ERROR );
+            }
+        else
+            {
+            StringLoader::Load( iBuf, R_QTN_INFO_FILE_FORMAT_ERROR );
+            }
+        err = aError;
+        }
+    
+    if ( err == KErrNone )
+        {
+        return;
+        }
+    
+#ifdef _DEBUG
+    TMFDialogUtil::ShowErrorNoteL( iBuf, aError );
+#else
+    TMFDialogUtil::ShowErrorNoteL( iBuf );
+#endif
+    
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::ShowWaitNoteL
+//
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::ShowWaitNoteL( TBool aDatabaseChanged )
+    {
+    TBuf<KBufSize128> buf;
+    
+    if ( aDatabaseChanged )
+        {
+        StringLoader::Load( buf, R_QTN_WAIT_NOTE_UPDATE );
+        //buf = _L("Refreshing");
+        }
+    else if ( iState->QueryFolder() == EEFolderSearch ||
+              iState->QueryFolder() == EEFolderSearchMusic )
+        {
+        StringLoader::Load( buf, R_QTN_WAIT_NOTE_SEARCH );
+        }
+    else
+        {
+        StringLoader::Load( buf, R_QTN_WAIT_NOTE_OPEN );
+        }
+    
+    iWaitNote->LaunchL( buf );     
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::DeleteMenuItem
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::DeleteMenuItem( CEikMenuPane* aMenuPane, TInt aCommandId )
+	{
+	TInt pos = KErrNotFound;
+    if ( aMenuPane->MenuItemExists( aCommandId, pos ) )
+		{
+		aMenuPane->DeleteMenuItem( aCommandId );
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ShowPopupNote
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::ShowPopupNoteL( const TDesC& aText ) 
+    {
+    const TInt KPopupDisplayTime = 3*1000;
+    const TInt KPopupDelayTime = 500;
+    
+    iPopupNote->SetTextL( aText );
+    iPopupNote->SetTimeDelayBeforeShow( KPopupDelayTime );
+    iPopupNote->SetTimePopupInView( KPopupDisplayTime );    
+    iPopupNote->ShowInfoPopupNote();    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::CurrentItemListIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialog::CurrentItemListIndex()
+    {
+    TInt itemCount = iListBox->Model()->NumberOfItems();
+    TInt currentIndex = iListBox->CurrentItemIndex();
+     
+    if ( itemCount == 0 || currentIndex < 0 )
+        {
+        return KErrNotFound; // list or find box is empty
+        }
+     
+    // convert from findbox index into original list index
+    if ( FindBox() && FindBox()->IsVisible() )
+        {
+        TInt tempIndex = currentIndex;
+        CAknFilteredTextListBoxModel* model =
+        STATIC_CAST(CAknFilteredTextListBoxModel*, iListBox->Model());
+        
+        if ( model->Filter() )
+            {
+            currentIndex = model->Filter()->FilteredItemIndex( tempIndex );
+            }
+        }
+     
+    return currentIndex;
+    }
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog::GetSelectedItemFileName
+//
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog::GetSelectedItemFileName( TInt aListboxIndex, TDes& aFileName )
+    {
+    aFileName = KNullDesC;
+    
+    __ASSERT_DEBUG( iState->QueryNeeded(), Panic( KErrGeneral ) );
+            
+    TInt id = iState->CurrentFolder();
+        
+    // read selected list item text from metadata    
+    TInt extraIndexes = iState->LeadingPersistentFolderCount();
+    TInt queryIndex = aListboxIndex - extraIndexes;
+
+    iMediaFileHandler->GetAttribute( queryIndex, CMediaFileHandler::EAttrFullName, 
+                                     aFileName, id );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ConstructListboxItem
+// 
+// -----------------------------------------------------------------------------
+//
+TPtrC CMediaFileDialog::ConstructListboxItem( TInt aListboxIndex )
+    {
+    _LIT( KFormat2, "%d\t%S\t%d" );
+  
+    TBool isPersistent = EFalse;
+    TInt mediaTypeIcon = EEIconEmpty;
+    TInt storageTypeIcon = EEIconEmpty;
+    TInt folderId = KErrNotFound;
+    iState->GetFolderInfo( aListboxIndex, folderId, iListboxItemText1,
+                                          isPersistent, mediaTypeIcon );
+    if ( folderId != KErrNotFound )
+        {
+        if ( !isPersistent )
+            {
+            GetListItemText( aListboxIndex, iListboxItemText1 );
+            }
+        }
+    else
+        {
+        GetListItemText( aListboxIndex, iListboxItemText1 );
+        mediaTypeIcon = MediaTypeIcon( aListboxIndex );
+        storageTypeIcon = StorageTypeIcon( aListboxIndex );
+        }
+
+    iListboxItemText2.Format( KFormat2, mediaTypeIcon, &iListboxItemText1, storageTypeIcon );
+    return iListboxItemText2;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::MediaTypeIcon
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialog::MediaTypeIcon( TInt aListboxIndex )
+    {
+    if ( aListboxIndex < 0 )
+        {
+        return EEIconEmpty;
+        }
+
+    TInt mediaType = iMediaFileHandler->Attribute( aListboxIndex,
+                                        CMediaFileHandler::EAttrMediaType,
+                                        iState->CurrentFolder() );
+    
+    TInt iconId = EEIconMusic;
+    if ( mediaType == CMediaFileHandler::EMediaTypeTone )
+        {
+        iconId = EEIconTone;
+        }
+    else if ( mediaType == CMediaFileHandler::EMediaTypeVideo )
+        {
+        iconId = EEIconVideo;
+        }
+    else if ( mediaType == CMediaFileHandler::EMediaTypeRecording )
+        {
+        iconId = EEIconRecording;
+        }
+    
+    return iconId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::StorageTypeIcon
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialog::StorageTypeIcon( TInt aListboxIndex )
+    {
+    if ( aListboxIndex < 0 )
+        {
+        return EEIconEmpty;
+        }
+
+    TInt storageType = iMediaFileHandler->Attribute( aListboxIndex,
+                                        CMediaFileHandler::EAttrStorageType,
+                                        iState->CurrentFolder() );
+    TInt iconId = EEIconEmpty;
+    if ( storageType == CMediaFileHandler::EMassStorage )
+        {
+        iconId = EEIconMassStorage;
+        }
+    
+    if ( storageType == CMediaFileHandler::EMemoryCard )
+        {
+        iconId = EEIconMemoryCard;
+        }
+
+    return iconId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::GetListItemText
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::GetListItemText( TInt aListboxIndex, TDes& aText )
+    {
+    __ASSERT_DEBUG( iState->QueryNeeded(), Panic( KErrGeneral ) );
+
+    TInt id = iState->CurrentFolder();
+    
+    // read selected list item text from metadata    
+    TInt extraIndexes = iState->LeadingPersistentFolderCount();
+    TInt queryIndex = aListboxIndex - extraIndexes;
+    
+    iMediaFileHandler->GetAttribute( queryIndex, 
+                       CMediaFileHandler::EAttrSongName, aText, id );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::ListboxItemCount (from CMFListHandlerObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialog::ListboxItemCount()
+    {
+    TInt count1 = iState->PersistentFolderCount();
+    TInt count2 = 0;
+    
+    if ( iState->QueryNeeded() )
+        {
+        count2 = iMediaFileHandler->ResultCount();
+        }
+    return count1 + count2;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleMFEventL (from MMediaFileHandlerObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleMFEventL( TInt aEvent, TInt aError )
+    {
+    //
+    // handle cancel button
+    //
+    if ( aEvent == MMediaFileHandlerObserver::EQueryCanceled )
+        {
+        iWaitNote->CancelProgressDialogL();
+        iSearchText = KNullDesC;
+        UpdateListBoxL();
+        return;
+        }
+    
+    //
+    // handle error
+    //
+    if ( aError != KErrNone )
+        {
+        iWaitNote->CancelProgressDialogL();
+        ResetDialogL( aError );
+
+        FLOG( _L("### CMediaFileDialog::HandleMFEventL (%d) ###"), aError );
+        return;
+        }
+
+    
+    if ( aEvent != MMediaFileHandlerObserver::EUnknownQueryComplete )
+        {
+        // unknown query is always followed by another query
+        iWaitNote->CancelProgressDialogL();    
+        }
+    
+    
+    if ( aEvent == MMediaFileHandlerObserver::EUnknownQueryComplete )
+        {
+        TInt count = iMediaFileHandler->ResultCount();
+        TInt folderId = iState->QueryFolder();
+        iState->SetUnknownCount( folderId, count );
+        
+        TInt err = KErrNone;
+        TRAP( err, QueryL( folderId ) );
+        if ( err != KErrNone )
+            {
+            iWaitNote->CancelProgressDialogL();
+            User::Leave( err );
+            }
+        }
+
+    if ( aEvent == MMediaFileHandlerObserver::EQueryComplete )
+        {
+        // query was successful - update dialog state
+        iState->SetStateAfterQuery();
+       
+        TInt count = iMediaFileHandler->ResultCount();
+        
+        if ( iState->CurrentFolder() == EEFolderArtist )
+            {
+            TInt count = iMediaFileHandler->UnknownArtistCount();
+            iState->SetUnknownCount( EEFolderArtist, count );
+            }
+        iState->HideUnknownFolders();
+        UpdateListBoxL();
+        
+#ifdef _DEBUG
+        iTest->PrintTimeL( _L("query took") );  // test code
+#endif        
+        }
+
+    if ( aEvent == MMediaFileHandlerObserver::EMediaFileChanged )
+        {
+        HandleMediaFileChanged();
+        }
+    
+    if (  aEvent == MMediaFileHandlerObserver::EScanRomComplete )
+        {
+        iWaitNote->CancelProgressDialogL(); 
+        }
+    
+    if ( aEvent == MMediaFileHandlerObserver::EInitComplete )
+        {
+        iDatabaseOpen = ETrue;
+    	
+    	StartRomScan();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleMediaFileChanged
+// 
+// Handle situation where file system changes and media files are added /
+// removed. This function makes a query to update current folder and
+// stores name or id of the currently selected item. Current item info
+// is needed to restore current item after query. 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleMediaFileChanged()
+    {
+    // query is ongoing - ignore this file change event
+    if ( !iMediaFileHandler->QueryReady() )
+         {
+         FLOG( _L("### CMediaFileDialog::HandleMediaFileChanged: query in progress ###") );
+         return;
+         }
+    
+    iState->ResetUnknownCount();
+    TMFCurrentItemInfo& info = iState->CurrentItemInfo();
+    info.Reset();
+    info.iIndexCheckNeeded = ETrue; //  set to false when dialog is opened
+        
+    TInt currentFolder = iState->CurrentFolder();
+    TInt currentIndex = CurrentItemListIndex();
+         
+    TBool isPersistent = EFalse;
+    TInt iconId = EEIconEmpty;
+    TInt id = KErrNotFound;
+    TBuf<KBufSize64> buf;
+    iState->GetFolderInfo( currentIndex, id, buf,
+                                         isPersistent, iconId );
+    if ( id == KErrNotFound )
+        {
+        // get media file id
+        info.iMediaFileId = iMediaFileHandler->Attribute( currentIndex, 
+                 CMediaFileHandler::EAttrMediaFileId, currentFolder );
+        }
+    else if ( !isPersistent )
+        {
+        // get non-persistent folder name (eg some album name)
+        GetListItemText( currentIndex, info.iFolderText );
+        }
+    else
+        {
+        // get persistent folder id (eg "Unknown" folder)
+        info.iFolderId = id;
+        }
+
+    info.iItemIndex = currentIndex;
+       
+    iState->SetQueryInfo( 0, KNullDesC, 0, EEQueryUpdate );
+        
+    TBool databaseChanged = ETrue;
+    QueryL( currentFolder, databaseChanged );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::CheckListboxIndex
+// 
+// Check that current item selection is correct. Function is used in case
+// file system has changed (media files added / removed.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::CheckListboxIndex()
+    {
+    TMFCurrentItemInfo& info = iState->CurrentItemInfo();
+    if ( !info.iIndexCheckNeeded )
+        {
+        return;
+        }
+    
+    TInt direction = iState->QueryDirection();
+    TInt newListIndex = KErrNotFound;
+    
+    if ( direction == EEQueryUp )
+        {
+        FLOG( _L("query up") );
+        TInt prevId = iState->PreviousFolderId();
+        TInt listIndex = iState->ListIndex( prevId );
+        if ( !iState->IsPersistent( prevId ) )
+            {
+            iState->GetText( prevId, info.iFolderText );
+            TInt num = iState->LeadingPersistentFolderCount();
+            newListIndex = iMediaFileHandler->ItemIndex(
+                           info.iFolderText, listIndex );
+            iState->SetCurrentItemIndex( newListIndex + num );
+            }
+        else
+            {
+            iState->SetCurrentItemIndex( listIndex );
+            }
+        }
+
+    if ( direction == EEQueryUpdate )
+        {
+        if ( info.iMediaFileId != KErrNotFound )
+            {
+            newListIndex = iMediaFileHandler->ItemIndex(
+                           info.iMediaFileId, info.iItemIndex );
+            }
+        else if ( info.iFolderText.Length() > 0 )
+            {
+            newListIndex = iMediaFileHandler->ItemIndex(
+                    info.iFolderText, info.iItemIndex );
+            TInt num = iState->LeadingPersistentFolderCount();
+            newListIndex = newListIndex + num;
+            }
+        else if ( info.iFolderId != KErrNotFound )
+            {
+            newListIndex = iState->ListIndex( info.iFolderId );
+            }
+        
+        iState->SetCurrentItemIndex( newListIndex );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandlePreviewEventL (from MPreviewHandlerObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandlePreviewEventL( TInt aEvent, TInt aError )
+    {
+    if ( aEvent == MPreviewHandlerObserver::EAudioPreviewComplete )
+        {
+        ShowPreviewErrorNoteL( aError, CMediaFileHandler::EMediaTypeMusic );
+        }
+
+    if ( aEvent == MPreviewHandlerObserver::EVideoPreviewComplete )
+        {
+        ShowPreviewErrorNoteL( aError, CMediaFileHandler::EMediaTypeVideo );        
+        }
+
+    if ( aEvent == MPreviewHandlerObserver::EPreviewError )
+        {
+        FLOG( _L("### CMediaFileDialog::HandlePreviewEventL (%d) ###"), aError );
+        
+        ShowPreviewErrorNoteL( aError, CMediaFileHandler::EMediaTypeMusic );        
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleLosingForeground (from MCoeForegroundObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleLosingForeground()
+    {
+    iForeGround = EFalse;
+    //Record the current item info
+    if ( iState && iListBox)
+    	{
+    	iState->SetCurrentItemIndex( CurrentItemListIndex() );
+    	}
+    
+    CancelPreview();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleGainingForeground (from MCoeForegroundObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleGainingForeground()
+    {
+    iForeGround = ETrue;
+    if ( iListBox )
+    	{
+    	UpdateListBoxL( EFalse );
+   	 	}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleControlEventL (from MCoeControlObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleControlEventL( CCoeControl* aControl,
+                                                      TCoeEvent aEventType )
+     {
+     TInt currentFolderId = iState->CurrentFolder();
+     
+     if ( aEventType == EEventStateChanged )
+         {
+         CancelPreview();
+         if ( aControl == iListBox )
+             {
+             if ( currentFolderId == EEFolderRoot   ||
+                  currentFolderId == EEFolderSearch || 
+                  currentFolderId == EEFolderVideos )
+                {
+                UpdateCbaL( 0 );  // only these folders need dynamic cba update
+                }
+             StartPreviewWithDelay();
+             ShowDetailsPopupL();   // show search details in Search view
+   
+             // forward listbox state change events to this control's
+             // observers
+             ReportEventL( MCoeControlObserver::EEventStateChanged );
+             }
+           
+         if ( FindBox() && aControl == FindBox() )
+             {
+             User::InfoPrint(_L("find box  event arrived"));
+              
+             // this event is received when user enters or deletes
+             // chars in find box. Backspace key in empty find box does not
+             // generate this event.
+
+             if ( currentFolderId == EEFolderSearch ||
+                  currentFolderId == EEFolderRoot ||
+                  currentFolderId == EEFolderMusic ||
+                  currentFolderId == EEFolderSearchMusic )
+                 {
+                 StartSearchWithDelay();
+                 return;
+                 }
+            
+             // StartPreviewWithDelay();
+             
+             UpdateCbaL( 0 );
+             
+//#ifdef _DEBUG
+             TBuf<KBufSize128> buf;
+             iState->GetTitle( iState->CurrentFolder(), buf );
+             TBuf<KBufSize128> buf2( buf );
+             TInt count = iListBox->Model()->NumberOfItems();
+             buf.Format( _L("%S  (%d)"), &buf2, count );
+             iStatusPaneHandler->SetNaviPaneTitle( buf );
+//#endif
+            
+             // Forward listbox state change events to this control's
+             // observers
+             ReportEventL( MCoeControlObserver::EEventStateChanged );
+             }
+         }
+     }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleWaitNoteL (from MMediaFileWaitNoteObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleWaitNoteL( TInt /*aButtonId*/ )
+    {
+    iMediaFileHandler->CancelQuery();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::AdaptiveSearchTextChanged (from MAdaptiveSearchTextObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::AdaptiveSearchTextChanged( CAknSearchField* /*aSearchField*/ )
+    {
+    // not used
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::OnPeninputUiDeactivated
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::OnPeninputUiDeactivated()
+    {
+    iPeninputActive = EFalse;
+    
+    if ( FindBox()->TextLength() == 0 && 
+          ( iState->CurrentFolder() == EEFolderSearch ||
+            iState->CurrentFolder() == EEFolderSearchMusic ) )
+        {
+        HandleBackL();
+        }
+    else
+        {
+        // search starts immediately after user closes pen input
+        TRAP_IGNORE( StartSearchWithDelay() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::OnPeninputUiActivated
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::OnPeninputUiActivated()
+    {
+    iPeninputActive = ETrue;
+    CancelPreview();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleListBoxEventL (from MEikListBoxObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleListBoxEventL( CEikListBox* /*aListBox*/,
+                                             TListBoxEvent aEventType )
+    {
+    TInt current = iState->CurrentFolder();
+    if ( aEventType == EEventPenDownOnItem)
+         {
+         iListBox->View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState );
+         return;
+         }
+    
+    if ( aEventType == EEventItemClicked )
+        {
+        	  iIsDoubleClicked = EFalse;
+        if ( current != KErrNotFound )
+            {
+            HandleOKL( EAttrOpen );  // open folder item
+            }
+        return;
+        }
+
+    if ( aEventType == EEventItemDoubleClicked || aEventType == EEventEnterKeyPressed )
+        {
+        TBool closeDialog = HandleOKL( EAttrDoubleClicked );
+        
+        if ( closeDialog )
+            {
+            // close after short delay (dialog cannot be closed from this function)
+            CloseDialogWithDelayL();
+            }
+        iIsDoubleClicked = ETrue;
+        }
+    if ( aEventType == EEventItemDraggingActioned )
+    	{
+    	UpdateCbaL( KErrNone );
+    	DrawNow();
+    	}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::CloseDialogWithDelayL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::CloseDialogWithDelayL()
+    {    
+    delete iIdle;
+    iIdle = NULL;
+    iIdle = CIdle::NewL( CActive::EPriorityIdle );
+    
+    if ( iIdle )
+        {                    
+        iIdle->Start( TCallBack( CloseDialog, this ) );
+        }
+    delete iInputBlock;
+    iInputBlock = NULL;
+    iInputBlock = CAknInputBlock::NewLC();
+    CleanupStack::Pop( iInputBlock );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::CloseDialog
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialog::CloseDialog( TAny *aObj )
+    {    
+    CMediaFileDialog *dlg = (CMediaFileDialog*) aObj;
+    delete dlg->iInputBlock;
+    dlg->iInputBlock = NULL;
+    
+    TRAP_IGNORE( dlg->TryExitL( EAknSoftkeyOk ) );
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::HandleActiveCallL (from MMFActiveCallerObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog::HandleActiveCallL( TInt aCallId )
+    {
+    if ( aCallId == EAttrPreview )
+        {
+        //double click the item of the listbox to select the tones, do not preview it.
+        if ( iIsDoubleClicked )
+        	{
+        	iIsDoubleClicked = EFalse;
+        	}
+        else
+        	{
+            // start preview after delay
+            PreviewL( CMediaFileList::EMediaFileTypeAudio ); 
+        	}
+        }
+
+    if ( aCallId == EAttrSearch )
+        {
+        // start search after delay
+        SearchL();    
+        }
+    }
+
+
+
+
+/******************************************************************************
+ *  class CMFListHandler
+ ******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// CMFListHandler::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CMFListHandler* CMFListHandler::NewL()
+    {
+	CMFListHandler* self = new (ELeave) CMFListHandler();
+    CleanupStack::PushL(self);
+	self->ConstructL();
+    CleanupStack::Pop(self);
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFListHandler::~CMFListHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CMFListHandler::~CMFListHandler()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFListHandler::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMFListHandler::ConstructL( void )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFListHandler::CMFListHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CMFListHandler::CMFListHandler()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFListHandler::SetObserver
+// 
+// -----------------------------------------------------------------------------
+//
+void CMFListHandler::SetObserver( CMFListHandlerObserver* aObserver )
+    {
+    iObserver = aObserver;
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// CMFListHandler::MdcaCount (from MDesCArray)
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMFListHandler::MdcaCount() const
+    {
+    return iObserver->ListboxItemCount();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFListHandler::MdcaPoint (from MDesCArray)
+//
+// CEikListBox calls this function just before it draws list box item.
+// -----------------------------------------------------------------------------
+//
+TPtrC16 CMFListHandler::MdcaPoint( TInt aIndex ) const
+    {
+    return iObserver->ConstructListboxItem( aIndex );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFListHandler::Panic
+//
+// -----------------------------------------------------------------------------
+//
+void CMFListHandler::Panic( TInt aReason ) 
+    {
+	_LIT( KPanicCategory, "CMFListHandler" );
+	
+	User::Panic( KPanicCategory, aReason ); 
+    }
+
+
+
+
+
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafiledialogstate.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1501 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class used to deal with the items of the Main view
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "mediafiledialogstate.h"
+#include "mediafiledialogutils.h"
+
+#include <mediafilelist.rsg>  // for .rss resource enums
+#include <StringLoader.h>
+
+
+
+/******************************************************************************
+ * class TMFListItem
+ ******************************************************************************/
+
+
+// -------------------------------------------------------------------------------
+// TMFListItem::TMFListItem
+//
+// -------------------------------------------------------------------------------
+//
+TMFListItem::TMFListItem()
+ : iListIndex(KErrNotFound), iFolderId(KErrNotFound), iParentFolderId(KErrNotFound),
+   iChildFolderId(KErrNotFound), iPersistent(ETrue),
+   iHidden(EFalse), iIconId(EEIconEmpty), iChildIconId(EEIconEmpty),
+   iUnknownCount(KErrNotFound)
+	 {
+	 }
+
+
+
+/******************************************************************************
+ * class TMFCurrentItemInfo
+ ******************************************************************************/
+
+
+// -------------------------------------------------------------------------------
+// TMFCurrentItemInfo::TMFCurrentItemInfo
+//
+// -------------------------------------------------------------------------------
+//
+void TMFCurrentItemInfo::Reset()
+    {
+    iIndexCheckNeeded = EFalse;
+    iItemIndex = KErrNotFound;
+    iMediaFileId = KErrNotFound;
+    iFolderId = KErrNotFound;
+    iFolderText = KNullDesC;
+    }
+
+
+/******************************************************************************
+ * class CMediaFileDialogState
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::NewL
+//
+// -----------------------------------------------------------------------------
+CMediaFileDialogState* CMediaFileDialogState::NewL()
+    {
+    CMediaFileDialogState* self = new ( ELeave ) CMediaFileDialogState();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::CMediaFileDialogState
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileDialogState::CMediaFileDialogState()
+	{
+	iCurrentFolderId = EEFolderRoot;
+	iCurrentFolderIndex = 0;
+	iListPosition = KErrNotFound;
+	
+    iQueryFolderId = EEFolderRoot;
+    iQueryDirection = EEQueryDown;
+    iQueryText = KNullDesC;
+    iPreviousFolderId = KErrNotFound;
+    iCurrentItemInfo.Reset();
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::ConstructL()
+    {
+    AddPermanentItemsL();
+    } 
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMediaFileDialogState::~CMediaFileDialogState()
+    {
+    iList.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::Init
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::Init()
+    {
+    // initialize non-persistent folders
+    TInt count = iList.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMFListItem& item = iList[i];
+        if ( !item.iPersistent )
+            {
+            item.iListIndex = KErrNotFound;
+            item.iText = KNullDesC;
+            item.iTitle = KNullDesC;
+            }
+        }
+
+	iCurrentFolderId = EEFolderRoot;
+	iCurrentFolderIndex = 0;
+	iListPosition = KErrNotFound;
+  	
+    iQueryFolderId = EEFolderRoot;
+    iQueryDirection = EEQueryDown;
+    iQueryText = KNullDesC;
+    iPreviousFolderId = KErrNotFound;
+    iCurrentItemInfo.Reset();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::HideRootFolder
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::HideRootFolder( TInt aFolderId, TBool aHidden,
+                                            const TDesC& aText, TInt aIconId )
+    {
+    TInt index = IndexFromId( aFolderId );
+    TMFListItem& item = iList[index];
+    if ( item.iParentFolderId != EEFolderRoot )
+        {
+        return; // only root folders can be variated
+        }
+
+    item.iHidden = aHidden;
+    if ( aText != KNullDesC )
+        {
+        TMFDialogUtil::StrCopy( item.iText, aText );
+        }
+    if ( aIconId != KErrNotFound )
+        {
+        item.iIconId = aIconId;
+        }
+    
+    // update root folder indexes. Note that root folders must be
+    // created in the same order they appear in UI (see AddPermanentItemsL).
+    TInt listIndex = 0;
+    TInt count = iList.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMFListItem& temp = iList[i];
+        if ( temp.iParentFolderId == EEFolderRoot )
+            {
+            if ( !temp.iHidden )
+                {
+                temp.iListIndex = listIndex;
+                listIndex++;
+                }
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::ResetUnknownCount
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::ResetUnknownCount()
+    {
+    SetUnknownCount( EEFolderArtistRoot, KErrNotFound );
+    SetUnknownCount( EEFolderAlbumRoot, KErrNotFound );
+    SetUnknownCount( EEFolderGenreRoot, KErrNotFound );
+    SetUnknownCount( EEFolderComposerRoot, KErrNotFound );
+    SetUnknownCount( EEFolderArtist, KErrNotFound );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetUnknownCount
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetUnknownCount( TInt aFolderId, TInt aCount )
+    {
+    TInt index = IndexFromId( aFolderId );
+    TMFListItem& item = iList[index];
+    item.iUnknownCount = aCount;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::UnknownCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::UnknownCount( TInt aFolderId )
+    {
+    TInt index = IndexFromId( aFolderId );
+    TMFListItem& item = iList[index];
+    return item.iUnknownCount;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::HideUnknownFolder
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::HideUnknownFolder( TInt aFolderId, TInt aUnknownCount )
+    {
+    TInt index = IndexFromId( aFolderId );
+    TMFListItem& item = iList[index];
+    
+    item.iHidden = EFalse;
+    if ( aUnknownCount < 1 )
+        {
+        item.iHidden = ETrue;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::HideUnknownFolders
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::HideUnknownFolders()
+    {
+    TInt count = UnknownCount( EEFolderArtistRoot );
+    HideUnknownFolder( EEFolderArtistUnknown, count );
+    
+    count = UnknownCount( EEFolderAlbumRoot );
+    HideUnknownFolder( EEFolderAlbumUnknown, count );
+
+    count = UnknownCount( EEFolderGenreRoot );
+    HideUnknownFolder( EEFolderGenreUnknown, count );
+
+    count = UnknownCount( EEFolderComposerRoot );
+    HideUnknownFolder( EEFolderComposerUnknown, count );
+    
+    count = UnknownCount( EEFolderArtist );
+    HideUnknownFolder( EEFolderArtistAlbumUnknown, count );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetUnknownFolderPosition
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetUnknownFolderPosition( TInt aQueryCount )
+    {
+    //
+    // Unknown folder is the last list item (after query result items)
+    //
+    if ( iCurrentFolderId == EEFolderArtistRoot|| 
+         iCurrentFolderId == EEFolderAlbumRoot ||
+         iCurrentFolderId == EEFolderGenreRoot ||
+         iCurrentFolderId == EEFolderComposerRoot ||
+         iCurrentFolderId == EEFolderArtist )
+        {
+        SetListIndex( EEFolderArtistUnknown, aQueryCount );
+        SetListIndex( EEFolderAlbumUnknown, aQueryCount );
+        SetListIndex( EEFolderGenreUnknown, aQueryCount );
+        SetListIndex( EEFolderComposerUnknown, aQueryCount );
+    
+        // folder EEFolderArtist has persistent "All" folder as a first item
+        SetListIndex( EEFolderArtistAlbumUnknown, aQueryCount + 1 );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::IndexFromId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::IndexFromId( TInt aFolderId )
+    {
+    TInt index = KErrNotFound;
+    
+    TInt count = iList.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        TMFListItem& item = iList[i];
+        if ( item.iFolderId == aFolderId )
+            {
+            index = i;
+            break;
+            }
+        }
+        
+    __ASSERT_ALWAYS( index != KErrNotFound, Panic( KErrGeneral ) );
+    
+    return index;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::PersistentFolderCount
+//
+// Get count of persistent subfolders in folder aFolderId.
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::PersistentFolderCount( TInt aFolderId )
+    {
+    TInt folderCount = 0;
+    
+    TInt count = iList.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMFListItem& item = iList[i];
+        if ( item.iParentFolderId == aFolderId )
+            {
+            if ( item.iHidden )
+                {
+                continue;
+                }
+            if ( item.iPersistent )
+                {
+                folderCount++;
+                }
+            }
+        }
+
+    return folderCount;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::PersistentFolderCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::PersistentFolderCount()
+    {
+    return PersistentFolderCount( iCurrentFolderId );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::LeadingPersistentFolderCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::LeadingPersistentFolderCount()
+    {
+    // how many persisten folders in the beginning of list
+    if ( iCurrentFolderId == EEFolderArtist )
+        {
+        return 1;
+        }
+        
+    return 0;    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::CurrentItemIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::CurrentItemIndex()
+    {
+    return iListPosition;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetCurrentItemIndex
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetCurrentItemIndex( TInt aIndex )
+    {
+    iListPosition = aIndex;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::PreviousFolderId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::PreviousFolderId()
+    {
+    return iPreviousFolderId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::GetCurrentItemInfo
+//
+// -----------------------------------------------------------------------------
+//
+TMFCurrentItemInfo& CMediaFileDialogState::CurrentItemInfo()
+    {
+    return iCurrentItemInfo;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::QueryDirection
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::QueryDirection()
+    {
+    return iQueryDirection;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::IsPersistent
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::IsPersistent( TInt aFolderId )
+    {
+    TInt index = IndexFromId( aFolderId );
+
+    TMFListItem& item = iList[index];
+    return item.iPersistent;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetListIndex
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetListIndex( TInt aFolderId, TInt aListIndex )
+    {
+    TInt count = iList.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMFListItem& item = iList[i];
+        if ( item.iFolderId == aFolderId )
+            {
+            if ( item.iParentFolderId == EEFolderRoot || 
+                 item.iParentFolderId == EEFolderMusic )
+                {
+                // root and music folder indexes cannot change after initialization
+                break;
+                }
+            item.iListIndex = aListIndex;
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::ListIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::ListIndex( TInt aFolderId )
+    {
+    TInt count = iList.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMFListItem& item = iList[i];
+        if ( item.iFolderId == aFolderId )
+            {
+            return item.iListIndex;
+            }
+        }
+    
+    return KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::FindBoxNeeded
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogState::FindBoxNeeded()
+    {
+    //return ETrue;  // find box used in every folder
+    
+    
+    if ( iCurrentFolderId == EEFolderSearch ||
+         iCurrentFolderId == EEFolderRoot )
+        {
+        return ETrue; // these folders have find box
+        }
+    
+    TMFListItem& currentFolder = iList[iCurrentFolderIndex];
+    if ( currentFolder.iChildFolderId == EEFolderNone )
+        {
+        return ETrue; // folder contains audio or fideo files
+        }
+        
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::QueryNeeded
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogState::QueryNeeded()
+    {
+    return QueryNeeded( iCurrentFolderId );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::QueryNeeded
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogState::QueryNeeded( TInt aFolderId )
+    {
+    if ( aFolderId == EEFolderRoot || aFolderId == EEFolderMusic )
+        {
+        return EFalse;
+        }
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetText
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetText( TInt aFolderId, const TDesC& aText )
+    {
+    TInt index = IndexFromId( aFolderId );
+
+    TMFListItem& item = iList[index];
+    
+    // persistent folder data cannot change after initialization
+    if ( !item.iPersistent )
+        {
+        TMFDialogUtil::StrCopy( item.iText, aText);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::GetText
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::GetText( TInt aFolderId, TDes& aText )
+    {
+    aText = KNullDesC;
+    
+    TInt index = IndexFromId( aFolderId );
+
+    TMFListItem& item = iList[index];
+    TMFDialogUtil::StrCopy( aText, item.iText );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::GetSearchTitleL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::GetSearchTitleL( TDes& aText, TInt aCount )
+    {
+    aText = KNullDesC;
+    
+    HBufC* hBuf = StringLoader::LoadLC( R_QTN_VIEW_SEARCH, aCount );
+    TMFDialogUtil::StrCopy( aText, *hBuf );
+    CleanupStack::PopAndDestroy( hBuf );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::GetSearchTitle
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::GetSearchTitle( TDes& aText, TInt aCount )
+    {
+    TRAP_IGNORE( GetSearchTitleL( aText, aCount ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::GetTitle
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::GetTitle( TInt aFolderId, TDes& aText )
+    {
+    aText = KNullDesC;
+     
+    TInt index = IndexFromId( aFolderId );
+
+    TMFListItem& item = iList[index];
+    TMFDialogUtil::StrCopy( aText, item.iTitle );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetTitle
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetTitle( TInt aFolderId, const TDesC& aText )
+    {
+    TInt index = IndexFromId( aFolderId );
+
+    TMFListItem& item = iList[index];
+    
+    // persistent folder data cannot change after initialization
+    if ( !item.iPersistent )
+        {
+        TMFDialogUtil::StrCopy( item.iTitle, aText);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::CurrentFolder
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::CurrentFolder()
+    {
+    return iCurrentFolderId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetCurrentFolder
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetCurrentFolder( TInt aFolderId )
+    {
+    iCurrentFolderIndex = IndexFromId( aFolderId );
+    iCurrentFolderId = aFolderId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetStateAfterQuery
+//
+// Set media file list state. This should be called after successful
+// database query.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetStateAfterQuery()
+    {
+    if ( iQueryDirection == EEQueryUpdate )
+        {
+        return;  // state does not change when updating
+        }
+    
+    if ( iQueryDirection == EEQueryDown )
+        {
+        iListPosition = 0;
+        }
+    if ( iQueryDirection == EEQueryUp )
+        {
+        // set list position to folder that was closed
+        TInt index = IndexFromId( iCurrentFolderId );
+        TMFListItem& item = iList[index];
+        iListPosition = item.iListIndex;
+        }
+    
+    iPreviousFolderId = iCurrentFolderId;
+    SetCurrentFolder( iQueryFolderId );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::SetQueryInfo
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::SetQueryInfo( TInt aQueryFolderId, const TDesC& aQueryText,
+                                          TInt aQueryListPosition, TInt aQueryDirection )
+    {
+    if ( aQueryDirection == EEQueryUpdate )
+        {
+        iQueryDirection = aQueryDirection;
+        return;
+        }
+    
+    if ( aQueryDirection == EEQueryDown )
+        {
+        // folder/title updated even is query is not successful
+        SetText( aQueryFolderId, aQueryText );
+        SetTitle( aQueryFolderId, aQueryText );
+        
+        // set folder list position so that it can be restored
+        // when folder is closed
+        SetListIndex( aQueryFolderId, aQueryListPosition );
+        }
+       
+    
+    iQueryDirection = aQueryDirection;
+    
+    // new list position set after successful query
+    iListPosition = aQueryListPosition;
+    
+    // iCurrentFolderId set after successful query
+    iQueryFolderId = aQueryFolderId;
+    }
+
+/*
+void CMediaFileDialogState::SetStateAfterQuery()
+    {
+    TInt previousCurrentFolderId = iCurrentFolderId;
+    
+    SetCurrentFolder( iQueryFolderId );
+    
+    if ( iQueryDirection == EEQueryDown )
+        {
+        SetListIndex( iQueryFolderId, iQueryListPosition );
+        iListPosition = 0;
+        }
+    if ( iQueryDirection == EEQueryUp )
+        {
+        // set list position to folder that was closed
+        TInt index = IndexFromId( previousCurrentFolderId );
+        TMFListItem& item = iList[index];
+        iListPosition = item.iListIndex;
+        }
+    }
+*/
+
+
+
+/*
+void CMediaFileDialogState::SetQueryInfo( TInt aQueryFolderId, const TDesC& aQueryText,
+                                          TInt aQueryListPosition, TInt aQueryDirection )
+    {
+    iQueryFolderId = aQueryFolderId;
+    if ( aQueryDirection == EEQueryDown )
+        {
+        // folder/title updated even is query is not successful
+        SetText( aQueryFolderId, aQueryText );
+        SetTitle( aQueryFolderId, aQueryText );
+        }
+       
+    iQueryListPosition = aQueryListPosition;
+    iQueryDirection = aQueryDirection;
+    
+    iListPosition = aQueryListPosition; // updated after successful query
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::NextFolderDown
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::NextFolderDown( TInt aListIndex )
+    {
+    TInt folderId = FolderId( aListIndex );
+    
+    // folderId is KErrNotFound if list item is not a folder
+    return folderId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::NextFolderUp
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::NextFolderUp()
+    {
+    TMFListItem& item = iList[iCurrentFolderIndex];
+    
+    if ( item.iParentFolderId != KErrNotFound )
+        {
+        return item.iParentFolderId;
+        }
+        
+    return KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::QueryFolder
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::QueryFolder()
+    {
+    return iQueryFolderId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::FolderId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::FolderId( TInt aListIndex )
+    {
+    TBool persistent = EFalse;
+    TInt icon = EEIconEmpty;
+    TInt id = KErrNotFound;
+    TBuf<KBufSize64> buf;
+    GetFolderInfo( aListIndex, id, buf, persistent, icon );
+    
+    return id;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::FolderIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileDialogState::FolderIndex( TInt aListIndex )
+    {
+    if ( aListIndex < 0 )
+        {
+        return KErrNotFound;
+        }
+
+    TInt folderIndex = KErrNotFound;
+    
+    TInt count = iList.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMFListItem& item = iList[i];
+        if ( item.iParentFolderId == iCurrentFolderId )
+            {
+            if ( item.iHidden )
+                {
+                continue;
+                }
+            if ( item.iListIndex == aListIndex && item.iPersistent )
+                {
+                folderIndex = i;
+                break;
+                }
+            }
+        }
+    
+    return folderIndex;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::GetFolderInfo
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::GetFolderInfo( TInt aListIndex, TInt& aId, TDes& aText,
+                                           TBool& aPersistent, TInt& aIconId )
+    {
+    aId = KErrNotFound;
+    aText = KNullDesC;
+    aPersistent = EFalse;
+    aIconId = EEIconEmpty;
+    
+    TMFListItem& currentFolder = iList[iCurrentFolderIndex];
+    if ( currentFolder.iChildFolderId == EEFolderNone )
+        {
+        // this is optimization and is based on the the fact that a folder
+        // cannot contain both folder items and audio/video items.
+        
+        return; // not folder (item is audio or video file)
+        }
+    
+    TInt index = FolderIndex( aListIndex );
+    if ( index != KErrNotFound )
+        {
+        // get persistent folder info
+        TMFListItem& item = iList[index];
+        TMFDialogUtil::StrCopy( aText, item.iText );
+        aId = item.iFolderId;
+        aPersistent = ETrue;
+        aIconId = item.iIconId;
+        }
+    else
+        {
+        // get non-persistent folder info.
+        // folder text (eg album name) is in database
+        aId = currentFolder.iChildFolderId;
+        aIconId = currentFolder.iChildIconId;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::EnableNullItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::EnableNullItemL( TInt aFolderId, const TDesC& aText,
+                                              TInt aIconId  )
+    {
+    HideRootFolder( aFolderId, EFalse, aText, aIconId );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::AddPermanentItemsL
+//
+//
+// Root
+//   Downloads
+//   Tones
+//     <tone1>
+//   Music
+//     All
+//     Artist
+//       <artist1>
+//       <artist2>
+//         All
+//         <album1>
+//         <album2>
+//         Unknown
+//       Unknown
+//     Album
+//       <album1>
+//         <song1>
+//       <album2>
+//       Unknown
+//         <song1>
+//         <song2>
+//     Genre
+//       Unknown
+//     Composer
+//       Unknown
+//   Videos
+//     <video1>
+//     <video2>
+//   Recordings
+//      <recording1>
+//      <recording2>
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::AddPermanentItemsL()
+    {
+    TMFListItem item;
+    
+    // Root
+    item.iListIndex = 0;
+    item.iFolderId = EEFolderRoot;
+    item.iParentFolderId = KErrNotFound;
+    item.iChildFolderId = KErrNotFound;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = KErrNotFound;
+    item.iChildIconId = KErrNotFound;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_MEDIA_FILE_DIALOG_TITLE );
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Downloads
+    item.iListIndex = 0;
+    item.iFolderId = EEFolderDownload;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolderDownload;
+    item.iChildIconId = EEIconEmpty;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_DOWNLOAD );
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Tones
+    item.iListIndex = 1;
+    item.iFolderId = EEFolderTones;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconTone;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_TONES );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_TONES );
+    User::LeaveIfError( iList.Append( item ) );
+    
+    // Music
+    item.iListIndex = 2;
+    item.iFolderId = EEFolderMusic;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = KErrNotFound;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = KErrNotFound;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_MUSIC );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_MUSIC );
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Videos
+    item.iListIndex = 3;
+    item.iFolderId = EEFolderVideos;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconVideo;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_VIDEOS );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_VIDEOS );
+    User::LeaveIfError( iList.Append( item ) );
+    
+    // Recordings
+    item.iListIndex = 4;
+    item.iFolderId = EEFolderRecordings;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = EEFolderNone;    
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconFolder;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_RECORDINGS );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_RECORDINGS );
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Null item one
+    item.iListIndex = 5;
+    item.iFolderId = EEFolderNullItemOne;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = ETrue;  // by default not visible
+    item.iIconId = EEIconEmpty;
+    item.iChildIconId = KErrNotFound;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+    
+    // Null item two
+    item.iListIndex = 6;
+    item.iFolderId = EEFolderNullItemTwo;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = KErrNotFound;
+    item.iPersistent = ETrue;
+    item.iHidden = ETrue;  // by default not visible
+    item.iIconId = EEIconEmpty;
+    item.iChildIconId = KErrNotFound;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Search
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderSearch;
+    item.iParentFolderId = EEFolderRoot;
+    item.iChildFolderId = EEFolderNone;    
+    item.iPersistent = ETrue;
+    item.iHidden = ETrue;  // visible only when search is used in root level
+    item.iIconId = EEIconEmpty;
+    item.iChildIconId = KErrNotFound;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+
+    //StringLoader::Load( item.iText, R_QTN_VIEW_SEARCH );
+    //StringLoader::Load( item.iTitle, R_QTN_VIEW_SEARCH );
+    User::LeaveIfError( iList.Append( item ) );
+
+
+    // Music Search
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderSearchMusic;
+    item.iParentFolderId = EEFolderMusic;
+    item.iChildFolderId = EEFolderNone;    
+    item.iPersistent = ETrue;
+    item.iHidden = ETrue;  // visible only when search is used in root level
+    item.iIconId = EEIconEmpty;
+    item.iChildIconId = KErrNotFound;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // All music
+    item.iListIndex = 0;
+    item.iFolderId = EEFolderAllMusic;
+    item.iParentFolderId = EEFolderMusic;
+    item.iChildFolderId = EEFolderNone;    
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_ALL_MUSIC );
+    StringLoader::Load( item.iTitle, R_QTN_FOLDER_ALL_MUSIC );
+    User::LeaveIfError( iList.Append( item ) );
+    
+
+    // Artist Root
+    item.iListIndex = 1;
+    item.iFolderId = EEFolderArtistRoot;
+    item.iParentFolderId = EEFolderMusic;
+    item.iChildFolderId = EEFolderArtist;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconArtist;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_ARTIST );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_ARTIST );
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Album Root
+    item.iListIndex = 2;
+    item.iFolderId = EEFolderAlbumRoot;
+    item.iParentFolderId = EEFolderMusic;
+    item.iChildFolderId = EEFolderAlbum;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconAlbum;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_ALBUM );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_ALBUM );
+    User::LeaveIfError( iList.Append( item ) );
+    
+    // Genre Root
+    item.iListIndex = 3;
+    item.iFolderId = EEFolderGenreRoot;
+    item.iParentFolderId = EEFolderMusic;
+    item.iChildFolderId = EEFolderGenre;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconGenre;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_GENRE );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_GENRE );
+    User::LeaveIfError( iList.Append( item ) );
+    
+    // Composer Root
+    item.iListIndex = 4;
+    item.iFolderId = EEFolderComposerRoot;
+    item.iParentFolderId = EEFolderMusic;
+    item.iChildFolderId = EEFolderComposer;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconComposer;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_COMPOSER );
+    StringLoader::Load( item.iTitle, R_QTN_VIEW_COMPOSER );
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Album ( represents some album under EEFolderAlbumRoot )
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderAlbum;
+    item.iParentFolderId = EEFolderAlbumRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = EFalse;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconAlbum;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Album Unknown ( all music files without album attribute )
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderAlbumUnknown;
+    item.iParentFolderId = EEFolderAlbumRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconUnknown;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_UNKNOWN_ALBUM );
+    StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_ALBUM );
+    User::LeaveIfError( iList.Append( item ) );
+    
+    // Genre ( represents some genre under EEFolderGenreRoot )
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderGenre;
+    item.iParentFolderId = EEFolderGenreRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = EFalse;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconGenre;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Genre Unknown ( all music files without genre attribute )
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderGenreUnknown;
+    item.iParentFolderId = EEFolderGenreRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconUnknown;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_UNKNOWN_GENRE );
+    StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_GENRE );
+    User::LeaveIfError( iList.Append( item ) );
+    
+    // Composer ( represents some composer under EEFolderComposerRoot )
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderComposer;
+    item.iParentFolderId = EEFolderComposerRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = EFalse;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconComposer;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Composer Unknown ( all music files without composer attribute )
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderComposerUnknown;
+    item.iParentFolderId = EEFolderComposerRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconUnknown;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_UNKNOWN_COMPOSER );
+    StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_COMPOSER );
+    User::LeaveIfError( iList.Append( item ) );
+
+
+
+    //
+    // folders under Artist root
+    //
+    
+    // Artist (artist folder, folder name is artist name)
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderArtist;
+    item.iParentFolderId = EEFolderArtistRoot;
+    item.iChildFolderId = EEFolderArtistAlbum;
+    item.iPersistent = EFalse;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconArtist;
+    item.iChildIconId = EEIconAlbum;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Artist all (all music files for one artist)
+    item.iListIndex = 0;
+    item.iFolderId = EEFolderArtistAll;
+    item.iParentFolderId = EEFolderArtist;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconFolder;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_FOLDER_ARTIST_ALL );
+    StringLoader::Load( item.iTitle, R_QTN_FOLDER_ARTIST_ALL );
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Artist album (one album, folder name is album name)
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderArtistAlbum;
+    item.iParentFolderId = EEFolderArtist;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = EFalse;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconAlbum;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    item.iText = KNullDesC;
+    item.iTitle = KNullDesC;
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Artist album unknown (music files for one artist without album attribute)
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderArtistAlbumUnknown;
+    item.iParentFolderId = EEFolderArtist;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconUnknown;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_UNKNOWN_ALBUM );
+    StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_ALBUM );
+    User::LeaveIfError( iList.Append( item ) );
+
+    // Artist unknown (all music files without artist attribute)
+    item.iListIndex = KErrNotFound;
+    item.iFolderId = EEFolderArtistUnknown;
+    item.iParentFolderId = EEFolderArtistRoot;
+    item.iChildFolderId = EEFolderNone;
+    item.iPersistent = ETrue;
+    item.iHidden = EFalse;
+    item.iIconId = EEIconUnknown;
+    item.iChildIconId = EEIconMusic;
+    item.iUnknownCount = KErrNotFound;
+    StringLoader::Load( item.iText, R_QTN_UNKNOWN_ARTIST );
+    StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_ARTIST );
+    User::LeaveIfError( iList.Append( item ) );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::Panic
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::Panic( TInt aReason ) 
+    {
+	_LIT( KPanicCategory, "CMediaFileDialogState" );
+	
+	User::Panic( KPanicCategory, aReason ); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::PrintCurrentFolder (test code)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::PrintCurrentFolder()
+    {
+	TBuf<KBufSize128> buf;
+	
+	GetFolderTypeText( buf, iCurrentFolderId );
+	User::InfoPrint( buf );
+    }
+		
+		
+// -----------------------------------------------------------------------------
+// CMediaFileDialogState::GetFolderTypeText (test code)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogState::GetFolderTypeText(TDes& aText, TInt aType)
+    {
+	switch (aType)
+		{
+		case EEFolderRoot:
+			aText = _L("EFolderRoot");
+			break;
+		case EEFolderTones:
+			aText = _L("EFolderTones");
+			break;
+		case EEFolderMusic:
+			aText = _L("EFolderMusic");
+			break;
+		case EEFolderVideos:
+			aText = _L("EFolderVideos");
+			break;
+		case EEFolderRecordings:
+			aText = _L("EFolderRecordings");
+			break;
+        case EEFolderSearch:
+            aText = _L("EEFolderSearch");
+            break;
+
+		case EEFolderRecent:
+			aText = _L("EFolderRecent");
+			break;
+		
+
+		case EEFolderArtistRoot:
+			aText = _L("EFolderArtistRoot");
+			break;
+		case EEFolderArtist:
+			aText = _L("EFolderArtist");
+			break;
+		case EEFolderArtistUnknown:
+			aText = _L("EFolderArtistUnknown");
+			break;
+		case EEFolderArtistAll:
+			aText = _L("EEFolderArtistAll");
+	        break;
+    	case EEFolderArtistAlbum:
+			aText = _L("EEFolderArtistAlbum");
+			break;
+		case EEFolderArtistAlbumUnknown:
+			aText = _L("EEFolderArtistAlbumUnknown");
+			break;
+
+
+		case EEFolderAllMusic:
+			aText = _L("EFolderAllMusic");
+			break;
+
+		case EEFolderAlbumRoot:
+			aText = _L("EFolderAlbumRoot");
+			break;
+		case EEFolderAlbum:
+			aText = _L("EFolderAlbum");
+			break;
+		case EEFolderAlbumUnknown:
+			aText = _L("EFolderAlbumUnknown");
+			break;
+			
+		case EEFolderGenreRoot:
+			aText = _L("EFolderGenreRoot");
+			break;
+		case EEFolderGenre:
+			aText = _L("EFolderGenre");
+			break;
+		case EEFolderGenreUnknown:
+			aText = _L("EFolderGenreUnknown");
+			break;
+			
+		case EEFolderComposerRoot:
+			aText = _L("EFolderComposerRoot");
+			break;
+		case EEFolderComposer:
+			aText = _L("EFolderComposer");
+			break;
+		case EEFolderComposerUnknown:
+			aText = _L("EFolderComposerUnknown");
+			break;
+			
+		case EEFolderUnknown:
+			aText = _L("EFolderUnknown");
+			break;
+
+		case EEFolderNone:
+			aText = _L("EFolderNone");
+			break;
+
+		default:
+			aText = _L("### unknown ###");
+			break;
+		}
+    }
+
+
+
+
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafiledialogutils.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1132 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Basic functionality of MediaFileList.
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "mediafiledialogutils.h"
+
+
+#include <bautils.h>  // bafl.lib
+#include <StringLoader.h>
+#include <driveinfo.h>
+#include <pathinfo.h>
+
+#include <aknnavide.h>          // CAknNavigationDecorator
+#include <aknnavilabel.h>       // CAknNaviLabel
+#include <akntitle.h>           // CAknTitlePane
+#include <AknQueryDialog.h>
+#include <aknnotewrappers.h>
+#include <AknsUtils.h>          // AknsUtils
+
+// for CWebBrowserLauncher
+#include <BrowserLauncher.h>
+#include <DocumentHandler.h>
+#include <AiwCommon.h>
+
+
+#include <mediafilelist.rsg>
+#include <data_caging_path_literals.hrh> // KDC_APP_RESOURCE_DIR
+
+
+
+
+/******************************************************************************
+ * class TMFDialogUtil
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// TMFDialogUtil::StrCopy
+//
+// -----------------------------------------------------------------------------
+//
+void TMFDialogUtil::StrCopy( TDes& aTarget, const TDesC& aSource )
+    {
+	TInt len = aTarget.MaxLength();
+    if( len < aSource.Length() ) 
+	    {
+		aTarget.Copy( aSource.Left(len) );
+		return;
+	    }
+	aTarget.Copy( aSource );
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMFDialogUtil::Panic
+//
+// -----------------------------------------------------------------------------
+//
+void TMFDialogUtil::Panic( TInt aReason ) 
+    {
+	_LIT( KPanicCategory, "TMFDialogUtil" );
+	
+	User::Panic( KPanicCategory, aReason ); 
+    }
+
+
+//------------------------------------------------------------------------------
+// TMFDialogUtil::ShowInformationNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TMFDialogUtil::ShowInformationNoteL( TInt aResource )
+    {
+    HBufC* hBuf = StringLoader::LoadLC( aResource );
+    ShowInformationNoteL( hBuf->Des() );
+    CleanupStack::PopAndDestroy( hBuf );
+    }
+
+
+//------------------------------------------------------------------------------
+// TMFDialogUtil::ShowInformationNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TMFDialogUtil::ShowInformationNoteL( const TDesC& aText )
+    {
+    CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote( ETrue );
+    queryDialog->ExecuteLD( aText );
+    }
+
+
+//------------------------------------------------------------------------------
+// TMFDialogUtil::ShowInformationQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TMFDialogUtil::ShowInformationQueryL( const TDesC& aText )
+    {
+    CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
+    queryDialog->ExecuteLD( R_INFORMATION_QUERY, aText );
+    }
+
+
+//------------------------------------------------------------------------------
+// TMFDialogUtil::ShowInformationQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TMFDialogUtil::ShowInformationQueryL( TInt aResource )
+    {
+    HBufC* hBuf = StringLoader::LoadLC( aResource );
+    ShowInformationQueryL( hBuf->Des() );
+    CleanupStack::PopAndDestroy( hBuf );
+    }
+
+//------------------------------------------------------------------------------
+// TMFDialogUtil::ShowErrorNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TMFDialogUtil::ShowErrorNoteL( TInt aResource )
+    {
+    HBufC* hBuf = StringLoader::LoadLC( aResource );
+    ShowErrorNoteL( hBuf->Des() );
+    CleanupStack::PopAndDestroy( hBuf );
+    }
+
+
+//------------------------------------------------------------------------------
+// TMFDialogUtil::ShowErrorNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TMFDialogUtil::ShowErrorNoteL( const TDesC& aText )
+    {
+    CAknErrorNote* errorNote = new (ELeave) CAknErrorNote(ETrue);
+    errorNote->ExecuteLD( aText );
+    }
+
+
+//------------------------------------------------------------------------------
+// TMFDialogUtil::ShowErrorNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TMFDialogUtil::ShowErrorNoteL( const TDesC& aText, TInt aError )
+    {
+    _LIT( KFormat, "%S (%d)" );
+    
+    TInt len = aText.Length();
+    HBufC* hBuf = HBufC::NewLC( len + KBufSize64 );
+    
+    TPtr ptr = hBuf->Des();
+    ptr.Format( KFormat, &aText, aError);
+    
+    ShowErrorNoteL( ptr );
+    
+    CleanupStack::PopAndDestroy( hBuf );
+    }
+
+//------------------------------------------------------------------------------
+// ShowNumberQueryL
+//
+//------------------------------------------------------------------------------
+//
+TBool TMFDialogUtil::ShowNumberQueryL( TInt& aNumber, const TDesC& aTitle )
+    {
+    CAknNumberQueryDialog* queryDialog = CAknNumberQueryDialog::NewL(aNumber);
+
+    if ( aTitle.Length() > 1 )
+        {
+        CleanupStack::PushL( queryDialog );
+        queryDialog->SetPromptL( aTitle );
+        CleanupStack::Pop( queryDialog );
+        }
+
+    return queryDialog->ExecuteLD( R_NUMBER_QUERY );
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMFDialogUtil::ShowListQueryL
+// 
+// -----------------------------------------------------------------------------
+TBool TMFDialogUtil::ShowListQueryL( const TDesC& aTitle, CDesCArray* aList,
+                                     TInt* aSelectedIndex )
+    {
+    CAknListQueryDialog* query = new (ELeave) CAknListQueryDialog( aSelectedIndex );
+    CleanupStack::PushL( query );
+
+    query->PrepareLC( R_LIST_QUERY );
+    query->SetItemTextArray( aList );
+    query->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    CAknPopupHeadingPane* headingPane = query->QueryHeading();
+    headingPane->SetTextL( aTitle );
+    
+    CleanupStack::Pop( query );
+
+    return query->RunLD();
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMFDialogUtil::AddResFileL
+//
+// -----------------------------------------------------------------------------
+//
+TInt TMFDialogUtil::AddResFileL()
+    {
+    _LIT( KDriveZ, "z:" );
+    _LIT( KResFileName, "mediafilelist.rsc" );
+
+    TFileName fileName;
+    fileName.Append( KDriveZ );
+    fileName.Append( KDC_RESOURCE_FILES_DIR );
+    fileName.Append( KResFileName );
+
+    CEikonEnv* env = CEikonEnv::Static();
+    BaflUtils::NearestLanguageFile( env->FsSession(), fileName );
+
+    return env->AddResourceFileL( fileName );
+    }
+
+
+// ----------------------------------------------------------------------------
+// TMFDialogUtil::SetIconFileNameL
+//
+// ----------------------------------------------------------------------------
+//
+void TMFDialogUtil::SetIconFileNameL( const TDesC& aName, TDes& aFullName )
+    {
+    _LIT( KDriveZ, "z:" );
+    
+    aFullName = KNullDesC;
+    
+    aFullName.Append( KDriveZ );
+    aFullName.Append( KDC_APP_RESOURCE_DIR );
+    aFullName.Append( aName );
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMFDialogUtil::CreateImageL
+//
+// -----------------------------------------------------------------------------
+//
+CEikImage* TMFDialogUtil::CreateImageLC( TAknsItemID aId, const TDesC& aFileName,
+                                         TInt aFileBitmapId, TInt aFileMaskId )
+    {
+    CFbsBitmap* bitmap1 = NULL;
+    CFbsBitmap* bitmap2 = NULL;
+    
+    CEikImage* image = new (ELeave) CEikImage;
+    CleanupStack::PushL( image );
+
+    AknsUtils::CreateIconLC( AknsUtils::SkinInstance(), aId, bitmap1, bitmap2,
+                             aFileName, aFileBitmapId, aFileMaskId );
+    image->SetPicture( bitmap1, bitmap2 );
+    CleanupStack::Pop(2); // bitmap1 bitmap2
+
+    return image;
+    }
+
+// -------------------------------------------------------------------------------
+// TMFDialogUtil::IsEmpty
+//
+// Function returns ETrue if string only contains white space or has
+// no characters.
+// -------------------------------------------------------------------------------
+//
+TBool TMFDialogUtil::IsEmpty( const TDesC& aText )
+    {
+    TInt len = aText.Length();
+    
+    for ( TInt i=0; i<len; i++ )
+        {
+        TChar c = aText[i];
+        if ( !c.IsSpace() )
+            {
+            return EFalse;
+            }
+        }
+    return ETrue;
+    }
+
+
+
+
+/******************************************************************************
+ * class CMFActiveCaller
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CMFActiveCaller* CMFActiveCaller::NewL( MMFActiveCallerObserver* aObserver )
+    {
+    CMFActiveCaller* self = new (ELeave) CMFActiveCaller( aObserver );
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+
+ 	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CMFActiveCaller::~CMFActiveCaller()
+    {
+ 	Cancel();
+	iTimer.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::CMFActiveCaller
+// 
+// -----------------------------------------------------------------------------
+//
+CMFActiveCaller::CMFActiveCaller(MMFActiveCallerObserver* aObserver) : CActive(CActive::EPriorityStandard)
+    {
+	iObserver = aObserver;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMFActiveCaller::ConstructL()
+    {
+	User::LeaveIfError( iTimer.CreateLocal() );
+	CActiveScheduler::Add( this );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::DoCancel
+//
+// -----------------------------------------------------------------------------
+//
+void CMFActiveCaller::DoCancel()
+    {
+ 	iTimer.Cancel();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::RunL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFActiveCaller::RunL()
+    {
+    TRAP_IGNORE( iObserver->HandleActiveCallL( iCallId ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::Request
+//
+// This function calls this class RunL.
+// -----------------------------------------------------------------------------
+//
+void CMFActiveCaller::Request()
+    {
+	Cancel();
+	SetActive();
+	TRequestStatus* status = &iStatus;
+	User::RequestComplete( status, KErrNone );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::Start
+//
+// -----------------------------------------------------------------------------
+//
+void CMFActiveCaller::Start( TInt aCallId, TInt aMilliseconds )
+    {
+    const TInt KThousand = 1000;
+    Cancel();
+	
+	iCallId = aCallId;
+
+	if ( aMilliseconds <= 0 )
+		{
+		Request();  // no delay - complete asap
+		}
+	else
+		{
+	    iTimer.After( iStatus, aMilliseconds*KThousand );
+	    SetActive();
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFActiveCaller::Stop
+//
+// -----------------------------------------------------------------------------
+//
+void CMFActiveCaller::Stop()
+    {
+    Cancel();
+    }
+
+
+
+
+/*******************************************************************************
+ * class CNaviPaneHandler
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CNaviPaneHandler::~CNaviPaneHandler()
+    {
+    if ( iNaviDecorator )
+        {
+        if ( iNaviPane && iNavidecoratorPushed )
+            {
+            iNaviPane->Pop( iNaviDecorator );
+            }
+    
+        delete iNaviDecorator;
+        }
+        
+    if ( iNaviPane && iNavipanePushed )
+        {
+        iNaviPane->Pop(); // restore previous navi pane
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNaviPaneHandler::CNaviPaneHandler
+//
+// -----------------------------------------------------------------------------
+//
+CNaviPaneHandler::CNaviPaneHandler( CEikStatusPane* aStatusPane ) : iStatusPane( aStatusPane )
+    {
+    iNavidecoratorPushed = EFalse;
+    iNavipanePushed = EFalse;
+    
+    if ( iStatusPane )
+        {
+        TRAP_IGNORE( iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi)) );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CNaviPaneHandler::SetNaviPaneTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CNaviPaneHandler::SetNaviPaneTitleL(const TDesC& aTitle)
+    {
+    if ( !iStatusPane || !iNaviPane )
+        {
+        return;
+        }
+
+    if ( iNaviDecorator )
+        {
+        CAknNaviLabel* naviLabel = static_cast<CAknNaviLabel*>(iNaviDecorator->DecoratedControl());
+        if ( naviLabel )
+            {
+            naviLabel->SetTextL( aTitle );
+            iNaviDecorator->DrawDeferred();
+            }
+        }
+     else
+        {
+        iNaviDecorator = iNaviPane->CreateNavigationLabelL( aTitle ) ;
+        iNaviPane->PushL( *iNaviDecorator ); // activate navi label in navi pane
+        iNavidecoratorPushed = ETrue;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CNaviPaneHandler::StoreNavipaneL
+// 
+// ----------------------------------------------------------------------------
+//
+void CNaviPaneHandler::StoreNavipaneL()
+    {
+    if ( !iNaviPane || !iStatusPane || iNavipanePushed )
+        {
+        return;
+        }
+
+    if ( iStatusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent() )
+        {
+        iNaviPane->PushDefaultL();
+        iNavipanePushed = ETrue;
+        }
+    }
+
+
+
+
+/*******************************************************************************
+ * class CStatusPaneHandler
+ *******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// CStatusPaneHandler::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CStatusPaneHandler* CStatusPaneHandler::NewL( CAknAppUi* aAppUi )
+    {
+    CStatusPaneHandler* self = new (ELeave) CStatusPaneHandler( aAppUi );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CStatusPaneHandler::~CStatusPaneHandler()
+    {
+    TRAP_IGNORE( RestoreOriginalTitleL() );
+    
+    delete iNaviPaneHandler;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CStatusPaneHandler::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::ConstructL()
+    {
+    iNaviPaneHandler = new (ELeave) CNaviPaneHandler( iAppUi->StatusPane() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CStatusPaneHandler::CStatusPaneHandler
+//
+// -----------------------------------------------------------------------------
+//
+CStatusPaneHandler::CStatusPaneHandler( CAknAppUi* aAppUi ) : iAppUi(aAppUi )
+    {
+    __ASSERT_ALWAYS( iAppUi, TMFDialogUtil::Panic( KErrGeneral ) );
+
+    iOriginalTitleStored = EFalse;
+    iOriginalTitle = KNullDesC;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::GetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+TBool CStatusPaneHandler::GetTitleL( CAknAppUi* aAppUi, TDes& aTitle )
+    {
+    aTitle = KNullDesC;
+
+    CEikStatusPane* statusPane = aAppUi->StatusPane();
+    if (statusPane && statusPane->PaneCapabilities( TUid::Uid( EEikStatusPaneUidTitle ) ).IsPresent() )
+        {
+        CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
+            ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+        if ( titlePane->Text() ) 
+            {
+            TMFDialogUtil::StrCopy( aTitle, *titlePane->Text() );
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+TBool CStatusPaneHandler::SetTitleL( CAknAppUi* aAppUi, const TDesC& aTitle )
+    {
+    CEikStatusPane* statusPane = aAppUi->StatusPane();
+    if ( statusPane && statusPane->PaneCapabilities( TUid::Uid( EEikStatusPaneUidTitle ) ).IsPresent() )
+        {
+        CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
+            ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+        if ( titlePane->Text() ) 
+            {
+            titlePane->SetTextL( aTitle );
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetNaviPaneTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetNaviPaneTitleL( const TDesC& aTitle )
+    {
+    iNaviPaneHandler->SetNaviPaneTitleL( aTitle );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetNaviPaneTitle
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetNaviPaneTitle( const TDesC& aTitle )
+    {
+    TRAP_IGNORE( iNaviPaneHandler->SetNaviPaneTitleL( aTitle ) );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetNaviPaneTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetNaviPaneTitleL( TInt aResource )
+    {
+    HBufC* hBuf = StringLoader::LoadLC( aResource) ;
+    SetNaviPaneTitleL( hBuf->Des() );
+    CleanupStack::PopAndDestroy( hBuf );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::StoreNavipaneL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::StoreNavipaneL()
+    {
+    iNaviPaneHandler->StoreNavipaneL();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::StoreOriginalTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::StoreOriginalTitleL()
+    {
+    TBool ret = GetTitleL( iAppUi, iOriginalTitle );
+    
+    if ( ret )
+        {
+        iOriginalTitleStored = ETrue;
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::RestoreOriginalTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::RestoreOriginalTitleL()
+    {
+    if ( iOriginalTitleStored )
+        {
+        SetTitleL( iAppUi, iOriginalTitle );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetTitleL( const TDesC& aText )
+    {
+    if ( iOriginalTitleStored )
+        {
+        SetTitleL( iAppUi, aText );
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetTitleL( TInt aResourceId )
+    {
+    HBufC* hBuf = StringLoader::LoadLC( aResourceId );
+    SetTitleL( hBuf->Des() );
+    CleanupStack::PopAndDestroy( hBuf );
+    }
+
+
+
+/******************************************************************************
+ * class CDriveUtil
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CDriveUtil* CDriveUtil::NewL()
+    {
+    CDriveUtil* self = new (ELeave) CDriveUtil();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CDriveUtil::~CDriveUtil()
+    {
+    iFsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::CDriveUtil
+// 
+// -----------------------------------------------------------------------------
+//
+CDriveUtil::CDriveUtil()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CDriveUtil::ConstructL()
+    {
+    User::LeaveIfError( iFsSession.Connect() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::IsRom
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CDriveUtil::IsRom( const TDesC& aFullPath )
+    {
+    const TUint KMassStorageBits = DriveInfo::EDriveRom;
+
+    TDriveUnit drive( aFullPath );
+    TUint driveStatus( 0 );
+    
+    TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus );
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    if ( (driveStatus & KMassStorageBits) == KMassStorageBits )
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::IsMassStorage
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CDriveUtil::IsMassStorage( const TDesC& aFullPath )
+    {
+    const TUint KMassStorageBits = DriveInfo::EDriveInternal |
+                                   DriveInfo::EDriveExternallyMountable;
+
+    TDriveUnit drive( aFullPath );
+    TUint driveStatus( 0 );
+    
+    TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus );
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    if ( (driveStatus & KMassStorageBits) == KMassStorageBits )
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CDriveUtil::IsMemoryCard
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CDriveUtil::IsMemoryCard( const TDesC& aFullPath )
+    {
+    const TUint KMemoryCardBits = DriveInfo::EDriveRemovable |
+                                  DriveInfo::EDriveExternallyMountable;
+
+    TDriveUnit drive( aFullPath );
+    TUint driveStatus( 0 );
+    
+    TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus );
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    if ( (driveStatus & KMemoryCardBits) == KMemoryCardBits )
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+
+
+/******************************************************************************
+ * class CMimeTypeList
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CMimeTypeList* CMimeTypeList::NewL()
+    {
+    CMimeTypeList* object = new (ELeave) CMimeTypeList;
+    return object;
+    }
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::CMimeTypeList
+// 
+// -----------------------------------------------------------------------------
+//
+CMimeTypeList::CMimeTypeList()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::~CMimeTypeList
+// 
+// -----------------------------------------------------------------------------
+//
+CMimeTypeList::~CMimeTypeList()
+    {
+    iList.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMimeTypeList::ConstructL()
+    {
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::ResetL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMimeTypeList::ResetL()
+    {
+    iList.Reset();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::Count
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMimeTypeList::Count()
+    {
+    return iList.Count();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::Compare
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMimeTypeList::Compare(const TFileName& aFirst, const TFileName& aSecond)
+    {
+    return aFirst.Compare( aSecond );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::AddMimeTypeL
+//
+// -----------------------------------------------------------------------------
+//
+void CMimeTypeList::AddMimeTypeL( const TDesC& aText )
+    {
+    if ( aText.Length() > KMaxFileName || aText.Length() == 0 )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    TLinearOrder<TFileName> sortFunction( Compare );
+
+    TInt err = iList.InsertInOrder( aText, sortFunction );
+    
+    if ( err != KErrNone && err != KErrAlreadyExists )
+        {
+        User::Leave( err );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::FindMimeTypeL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMimeTypeList::FindMimeTypeL( const TDesC& aText )
+    {
+    TInt count = Count();
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        TPtrC ptr = MimeType( i );
+        if ( ptr.Compare( aText ) == 0 )
+            {
+            return ETrue;
+            }
+        }
+    
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMimeTypeList::MimeType
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CMimeTypeList::MimeType( TInt aIndex )
+    {
+    TInt count = iList.Count();
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, TMFDialogUtil::Panic( KErrGeneral ) );
+    
+    return iList[aIndex];
+    }
+
+
+
+
+/******************************************************************************
+ * class CWebBrowserLauncher
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CWebBrowserLauncher::CWebBrowserLauncher
+//
+// -----------------------------------------------------------------------------
+//
+CWebBrowserLauncher::CWebBrowserLauncher()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWebBrowserLauncher::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CWebBrowserLauncher::ConstructL()
+    {
+    iBrowserLauncher = CBrowserLauncher::NewL();
+    iDocumentHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );
+    }
+
+// -----------------------------------------------------------------------------
+// CWebBrowserLauncher::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CWebBrowserLauncher* CWebBrowserLauncher::NewLC()
+    {
+    CWebBrowserLauncher* self = new( ELeave ) CWebBrowserLauncher();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWebBrowserLauncher::~CWebBrowserLauncher
+//
+// -----------------------------------------------------------------------------
+//
+CWebBrowserLauncher::~CWebBrowserLauncher()
+    {
+    delete iDocumentHandler;
+    delete iBrowserLauncher;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWebBrowserLauncher::HandleContentL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CWebBrowserLauncher::HandleContentL( const TDesC& aFileName,
+                                           const CAiwGenericParamList& aParamList,
+                                           TBool& aContinue )
+    {
+    TBool isSaved = EFalse;
+
+    if ( aParamList.Count() > 0 )
+        {
+        TInt index = 0;
+        aParamList.FindFirst( index, EGenericParamFileSaved );
+
+        if( index != KErrNotFound )
+            {
+            isSaved = ( aParamList[ index ].Value().AsTInt32() );
+            }
+        }
+
+    // Tone is NOT yet saved by a browser, save it by using DocHandler
+    if( !isSaved )
+        {
+        //Let documenthandler to find out the datatype
+        TDataType nullType;
+        iDocumentHandler->CopyL( aFileName, KNullDesC, nullType, NULL );
+        }
+    
+    aContinue = ETrue;
+    
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWebBrowserLauncher::HandleContentL
+//
+// -----------------------------------------------------------------------------
+//
+TAny* CWebBrowserLauncher::DownloadedContentHandlerReserved1( TAny* /*aAnyParam*/ )
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CWebBrowserLauncher::LaunchBrowserL
+//
+// -----------------------------------------------------------------------------
+//
+void CWebBrowserLauncher::LaunchBrowserL()
+    {
+    iBrowserLauncher->LaunchBrowserSyncEmbeddedL( KFavouritesAudioContextId );
+    }
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafilehandler.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3717 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Used to interact with the MDE.
+*
+*/
+
+
+
+
+#include "mediafilehandler.h"
+#include "mediafilelistdebug.h"
+#include "mediafiledialogstate.h"
+#include "mediafilelist.h"
+
+#include <pathinfo.h>
+#include <bautils.h>
+
+
+
+
+/******************************************************************************
+ * class CMediaFileData
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileData::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileData* CMediaFileData::NewL()
+    {
+    CMediaFileData* self = new (ELeave) CMediaFileData();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileData::~CMediaFileData()
+    {
+    delete iFullName;
+    delete iName;
+    delete iArtist;
+    delete iAlbum;
+    delete iGenre;
+    delete iComposer;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileData::CMediaFileData
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileData::CMediaFileData()
+    {
+    iMediaFileType = KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileData::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileData::ConstructL()
+    {
+    iFullName  = HBufC::NewL( 0 );
+    iName      = HBufC::NewL( 0 );
+    iArtist    = HBufC::NewL( 0 );
+    iAlbum     = HBufC::NewL( 0 );
+    iGenre     = HBufC::NewL( 0 );
+    iComposer  = HBufC::NewL( 0 );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileData::Attr
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CMediaFileData::Attr( TInt aAttr )
+    {
+    if ( aAttr == CMediaFileHandler::EAttrFullName )
+        {
+        return *iFullName;
+        }
+    if ( aAttr == CMediaFileHandler::EAttrSongName )
+        {
+        return *iName;
+        }
+    if ( aAttr == CMediaFileHandler::EAttrArtist )
+        {
+        return *iArtist;
+        }
+    if ( aAttr == CMediaFileHandler::EAttrAlbum )
+        {
+        return *iAlbum;
+        }
+    if ( aAttr == CMediaFileHandler::EAttrGenre )
+        {
+        return *iGenre;
+        }
+    if ( aAttr == CMediaFileHandler::EAttrComposer )
+        {
+        return *iComposer;
+        }
+
+    return KNullDesC;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileData::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileData::SetAttrL( TInt aAttr, const TDesC& aValue )
+    {
+    if ( aAttr == CMediaFileHandler::EAttrFullName )
+        {
+        delete iFullName;
+        iFullName = NULL;
+        iFullName = aValue.AllocL();
+        }
+    if ( aAttr == CMediaFileHandler::EAttrSongName )
+        {
+        delete iName;
+        iName = NULL;
+        iName = aValue.AllocL();
+ 
+        }
+    if ( aAttr == CMediaFileHandler::EAttrArtist )
+        {
+        delete iArtist;
+        iArtist = NULL;
+        iArtist = aValue.AllocL();
+        }
+    if ( aAttr == CMediaFileHandler::EAttrAlbum )
+        {
+        delete iAlbum;
+        iAlbum = NULL;
+        iAlbum = aValue.AllocL();
+        }
+    if ( aAttr == CMediaFileHandler::EAttrGenre )
+        {
+        delete iGenre;
+        iGenre = NULL;
+        iGenre = aValue.AllocL();
+        }
+    if ( aAttr == CMediaFileHandler::EAttrComposer )
+        {
+        delete iComposer;
+        iComposer = NULL;
+        iComposer = aValue.AllocL();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileData::GetAttr
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileData::GetAttr( TInt aAttr, TDes& aValue )
+    {
+    if ( aAttr == CMediaFileHandler::EAttrFullName )
+        {
+        TMFDialogUtil::StrCopy( aValue, iFullName->Des() );
+        }
+    else if ( aAttr == CMediaFileHandler::EAttrSongName )
+        {
+        TMFDialogUtil::StrCopy( aValue, iName->Des() );
+        }
+    else if ( aAttr == CMediaFileHandler::EAttrArtist )
+        {
+        TMFDialogUtil::StrCopy( aValue, iArtist->Des() );
+        }
+    else if ( aAttr == CMediaFileHandler::EAttrAlbum )
+        {
+        TMFDialogUtil::StrCopy( aValue, iAlbum->Des() );
+        }
+    else if ( aAttr == CMediaFileHandler::EAttrGenre )
+        {
+        TMFDialogUtil::StrCopy( aValue, iGenre->Des() );
+        }
+    else if ( aAttr == CMediaFileHandler::EAttrComposer )
+        {
+        TMFDialogUtil::StrCopy( aValue, iComposer->Des() );
+        }
+    else
+        {
+        aValue = KNullDesC;
+        }
+    }
+    
+
+/******************************************************************************
+ * class CMediaFileHandler
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileHandler* CMediaFileHandler::NewL()
+    {
+    CMediaFileHandler* self = new (ELeave) CMediaFileHandler();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileHandler::~CMediaFileHandler()
+    {
+    delete iSearchList;
+    
+    delete iQueryCaller;
+    delete iObjectNotificationCaller;
+    
+    delete iDriveUtil;
+    delete iExcludedMimeTypes;
+    delete iIdle;
+    
+    delete iQuery;
+    delete iArtistQuery;
+    delete iSession;
+    
+    delete iRomFileList;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::CMediaFileHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileHandler::CMediaFileHandler()
+    {
+    iSessionOpen = EFalse;
+    iObserverCallEnabled = ETrue;
+    
+    iMaxFileSize = KErrNotFound;
+    iQueryId = KErrNotFound;
+    iQueryType = KErrNotFound;
+    iQueryError = KErrNone;
+    iQueryEvent = KErrNotFound;
+    iVideoSearchDisabled = EFalse;
+    
+    iMediaFileCounter = 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::ConstructL()
+    {
+    iSession = CMdESession::NewL( *this );
+    iSearchList = CSearchList::NewL();
+    
+    iQueryCaller = CMFActiveCaller::NewL( this );
+    iObjectNotificationCaller = CMFActiveCaller::NewL( this );
+    
+    iDriveUtil = CDriveUtil::NewL();
+    iArtistQuery = CArtistQuery::NewL();
+    iExcludedMimeTypes = CMimeTypeList::NewL();
+    
+    iRomFileList = CRomFileList::NewL();
+    iQueryinProgress = EFalse;
+    iRomScanState = MMediaFileHandlerObserver::ENoneRomScan;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SetAttr
+// 
+// -----------------------------------------------------------------------------
+void CMediaFileHandler::SetAttrL( TInt aAttr, TInt aValue )
+    {
+    switch ( aAttr )
+        {
+        case CMediaFileList::EAttrFileSize:
+            {
+            iMaxFileSize = aValue;
+            break;
+            }
+        case CMediaFileList::EAttrExcludeFolder:
+            {
+            if ( aValue == CMediaFileList::EFolderVideos )
+                {
+                iVideoSearchDisabled = ETrue;
+                }
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+void CMediaFileHandler::SetAttrL( TInt aAttr, const TDesC& aValue )
+    {
+    if ( aAttr == CMediaFileList::EAttrExcludeMimeType )
+        {
+        iExcludedMimeTypes->AddMimeTypeL( aValue );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SetAttr
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SetAttrL( TInt /*aAttr*/, TAny* /*aValue*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleSessionOpened (from MMdESessionObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleSessionOpened( CMdESession& /*aSession*/, TInt aError )
+    {
+    if ( aError != KErrNone )
+        {
+        delete iSession;
+        iSession = NULL;
+        iSessionOpen = EFalse;
+        }
+    else
+        {
+        iSessionOpen = ETrue;
+
+        TRAP_IGNORE( AddObjectObserverL() );
+        }
+
+    CallObserver( MMediaFileHandlerObserver::EInitComplete, aError );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::AddObjectObserverL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::AddObjectObserverL()
+    {
+    if ( iSessionOpen )
+        {
+        TUint32 notificationType = ENotifyAdd | ENotifyModify | ENotifyRemove;
+        CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+        iSession->AddObjectObserverL( *this, NULL, notificationType, &defNS );
+        
+        iSession->AddObjectPresentObserverL( *this );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleSessionError (from MMdESessionObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
+    {
+    if ( aError == KErrNone )
+        {
+        return;
+        }
+        
+    delete iSession;
+    iSession = NULL;
+    iSessionOpen = EFalse;
+
+    CallObserver( MMediaFileHandlerObserver::EError, aError );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleQueryNewResults (from MMdEQueryObserver)
+// 
+// This observer function is called during query. Calling frequency is defined
+// in second parameter of CMdEQuery::FindL.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleQueryNewResults( CMdEQuery& /*aQuery*/, 
+                                               TInt /*aFirstNewItemIndex*/,
+                                               TInt /*aNewItemCount*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleObjectNotification (MMdEObjectObserver)
+// 
+// Called when metadata database changes.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleObjectNotification( CMdESession& /*aSession*/, 
+			                 			TObserverNotificationType aType,
+						                const RArray<TItemId>& aObjectIdArray )
+    {
+    const TInt KObserverCallStep = 100;
+    
+    if ( aType == ENotifyAdd || aType == ENotifyModify || aType == ENotifyRemove )
+        {
+        if ( iObserver )
+            {
+            TInt count = aObjectIdArray.Count();
+            FLOG( _L("CMediaFileHandler::HandleObjectNotification: count is %d"), count );
+            
+            iMediaFileCounter = iMediaFileCounter + count;
+            if ( iMediaFileCounter >= KObserverCallStep )
+                {
+                iMediaFileCounter = 0;
+                TRAP_IGNORE( iObserver->HandleMFEventL(
+                             MMediaFileHandlerObserver::EMediaFileChanged, KErrNone ) );
+                }
+            else 
+                {
+                // delayed call to avoid many consecutive observer calls
+                CallObserverWithDelay();
+                }
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleObjectPresentNotification (MMdEObjectPresentObserver)
+// 
+// Called when previously used memory card is inserted and hidden
+// metadata files are made present again.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleObjectPresentNotification( CMdESession& /*aSession*/, 
+			             TBool /*aPresent*/, const RArray<TItemId>& aObjectIdArray )
+    {
+    if ( iObserver )
+        {
+        TInt count = aObjectIdArray.Count();
+        FLOG( _L("CMediaFileHandler::HandleObjectPresentNotification: count is %d"), count );
+
+        // delayed call to avoid many consecutive observer calls
+        CallObserverWithDelay();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleQueryCompleted (MMdEQueryObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
+    {
+   
+    TInt err = KErrNone;
+    TRAP( err, HandleQueryCompletedL( aQuery, aError ) );
+    
+    if ( err == KErrCancel )
+        {
+        CallObserver( MMediaFileHandlerObserver::EQueryCanceled, KErrNone );
+        }
+    else if ( err != KErrNone )
+        {
+        iSearchList->Reset();
+        TRAP_IGNORE( iArtistQuery->ResetL() );
+
+        CallObserver( MMediaFileHandlerObserver::EError, err );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleQueryCompletedL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleQueryCompletedL( CMdEQuery& /*aQuery*/, TInt aError )
+    {
+    TInt err = aError;
+    
+    if ( !iQuery && ( iRomScanState != MMediaFileHandlerObserver::ERomScanComplete 
+    		&& (iQueryType == EQueryTone || iQueryType == ESearchTones )) )
+        {
+        err = KErrGeneral;
+        }
+    if ( err == KErrCancel )
+        {
+        if ( iQueryType == ESearchAudio || iQueryType == ESearchMusic || 
+             iQueryType == ESearchTones || iQueryType == ESearchVideo )
+            {
+            iSearchList->Reset();
+            }
+        User::Leave( err );
+        }
+    if ( err != KErrNone )
+        {
+        User::Leave( err );
+        }
+    
+    
+    iSearchList->SetSession( iSession );
+    
+    TQueryResultMode resultMode = EQueryResultModeItem;
+    if ( iQuery )
+    	{
+        resultMode = iQuery->ResultMode();
+    	}
+
+    
+    if ( resultMode == EQueryResultModeDistinctValues )
+        {
+        iSearchList->Reset();
+        iSearchList->TakeDistinctResultL( iQuery, KErrNotFound );
+        iSearchList->SetSearchId( iQueryId );
+        iSearchList->Sort();
+
+        CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone );
+        }
+    else if ( resultMode == EQueryResultModeCount )
+        {
+        // EQueryResultModeCount currently not used
+        CallObserver( MMediaFileHandlerObserver::EUnknownQueryComplete, KErrNone );
+        }
+    else if ( resultMode == EQueryResultModeItem )
+        {
+        if ( iQueryType == ESearchAudio )
+            {
+            // ESearchAudio currently not used
+            iSearchList->Reset();
+            iSearchList->TakeResultL( iQuery, EMediaTypeMusic );
+            iSearchList->Sort();
+            iSearchList->SetSearchId( iQueryId );
+            
+            CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone );
+
+            /*
+            // ESearchAudio currently not used
+            iSearchList->Reset();
+            iSearchList->TakeResultL( iQuery, EMediaTypeMusic );
+            
+            delete iIdle;
+            iIdle = NULL;
+            iIdle = CIdle::NewL( CActive::EPriorityIdle );                
+            if ( iIdle )
+                {
+                iIdle->Start( TCallBack( SearchVideo, this ) );
+                }
+            */
+            }
+        else if ( iQueryType == ESearchMusic )
+            {
+            // search is done in 3 steps (music, tones and videos)
+            iSearchList->Reset();
+            iSearchList->TakeResultL( iQuery, EMediaTypeMusic );
+            
+            // call SearchTonesL after short delay (iQuery cannot
+            // be deleted in this function)
+            delete iIdle;
+            iIdle = NULL;
+            iIdle = CIdle::NewL( CActive::EPriorityIdle );                
+            if ( iIdle )
+                {
+                iIdle->Start( TCallBack( SearchTones, this ) );
+                }
+            else
+                {
+            	  User::Leave( KErrNoMemory );
+                }
+            }
+        else if ( iQueryType == ESearchTones )
+            {
+            iSearchList->SearchInToneL( iRomFileList, iSearchText );
+            iQueryinProgress = EFalse;
+            // call SearchVideosL after short delay (iQuery cannot
+            // be deleted in this function)
+            delete iIdle;
+            iIdle = NULL;
+            iIdle = CIdle::NewL( CActive::EPriorityIdle );                
+            if ( iIdle )
+                {
+                iIdle->Start( TCallBack( SearchVideo, this ) );
+                }
+            else
+                {
+            	  User::Leave( KErrNoMemory );
+                }
+            }
+        else if ( iQueryType == ESearchVideo )
+            {
+            iSearchList->TakeResultL( iQuery, EMediaTypeVideo );
+            iSearchList->VideoSearchInRomL( iRomFileList, iSearchText ); 
+            iSearchList->Sort();
+            iSearchList->SetSearchId( iQueryId );
+            
+            CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone );
+            }
+        
+        else if ( iQueryType == EQueryArtist )
+            {
+            // store CMdEObjectQuery to avoid multiple queries for one artist
+            iArtistQuery->SetQuery( iQuery );
+            iQuery = NULL;
+           
+            iSearchList->Reset();
+            iSearchList->TakeArtistResultL( iArtistQuery );
+            iSearchList->Sort();
+            iSearchList->SetSearchId( iQueryId );
+            
+            CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone );
+            }
+        else if ( iQueryType == EQueryArtistEmpty )
+            {
+            // use previously stored CMdEObjectQuery for artist query
+            iSearchList->Reset();
+            iSearchList->TakeArtistResultL( iArtistQuery );
+            iSearchList->Sort();
+            iSearchList->SetSearchId( iQueryId );
+            
+            CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone );
+            }
+        else if ( iQueryType == EQueryEmpty )
+            {
+            iSearchList->Reset();
+            iSearchList->SetSearchId( iQueryId );
+                
+            CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone );
+            }
+        else if ( iQueryType == EQueryUnknown )
+            {
+            iSearchList->Reset();
+            iSearchList->TakeResultL( iQuery, EMediaTypeMusic );
+            iSearchList->SetSearchId( iQueryId );     
+            
+            CallObserver( MMediaFileHandlerObserver::EUnknownQueryComplete, KErrNone );
+            }
+        else
+            {
+            TInt mediaType = MediaType( iQueryType );
+            iSearchList->Reset();
+            if ( mediaType == EMediaTypeTone )
+            	{
+            	iSearchList->AddRomItemL( iRomFileList, mediaType );
+            	}
+            else
+            	{
+            	iSearchList->TakeResultL( iQuery, mediaType );
+            	if ( mediaType == EMediaTypeVideo )
+            	    {
+            	    iSearchList->AddRomItemL( iRomFileList, mediaType );
+            	    }
+            	}
+            iQueryinProgress = EFalse;
+            iSearchList->SetSearchId( iQueryId );
+            iSearchList->Sort();
+        
+            CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone );
+            }
+        }
+    else
+        {
+        CallObserver( MMediaFileHandlerObserver::EError, KErrNotSupported );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryArtistL
+// 
+// Finds all music files for one artist. Query results are placed in
+// CArtistQuery.
+// CArtistQuery can then be used for artist subqueries (all albums, one album, 
+// all songs, unknown songs). 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryArtistL( TInt aAttr, const TDesC& aArtist, 
+                                      const TDesC& aAlbum, TBool aRefresh )
+    {
+    LeaveIfSessionClosedL();
+
+    if ( aAttr != EQueryArtist && aAttr != EQueryArtistAlbum && 
+         aAttr != EQueryArtistAll && aAttr != EQueryArtistUnknown )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    TBool updateFromDatabase = aRefresh;
+    if ( iArtistQuery->Artist().Compare( aArtist ) != 0 )
+        {
+        updateFromDatabase = ETrue;
+        }
+    
+    if ( updateFromDatabase )
+        {
+        CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+        CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+    
+        delete iQuery;
+        iQuery = NULL;
+        iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+        // set attributes that are included in query result  
+        CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+        iQuery->AddPropertyFilterL( &namePropertyDef );
+        CMdEPropertyDef& albumPropertyDef = PropertyDefL( EAttrAlbum );
+        iQuery->AddPropertyFilterL( &albumPropertyDef );
+
+        CMdELogicCondition& conditions = iQuery->Conditions();
+        CMdEPropertyDef& propertyDef = PropertyDefL( EAttrArtist );
+        conditions.AddPropertyConditionL( propertyDef, 
+                            ETextPropertyConditionCompareEquals, aArtist );
+
+        iQuery->SetResultMode( EQueryResultModeItem );
+    
+        iArtistQuery->SetArtistL( aArtist );
+        iArtistQuery->SetAlbumL( aAlbum );
+        iQuery->FindL();
+        iQueryType = EQueryArtist;
+        }
+    else
+        {
+        iArtistQuery->SetAlbumL( aAlbum );
+        QueryArtistEmptyL();
+        iQueryType = EQueryArtistEmpty;
+        }
+   
+    iArtistQuery->SetQueryType( aAttr );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryArtistEmptyL
+// 
+// Makes empty query. Query results were previously placed into CArtistQuery.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryArtistEmptyL()
+    {
+    LeaveIfSessionClosedL();
+
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef = 
+    defNS.GetObjectDefL( MdeConstants::Object::KBaseObject );
+    
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+ 
+    iQuery->FindL( 1 );
+    
+    iQueryType = EQueryArtistEmpty;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryMusicL
+// 
+// Finds music files.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryMusicL( TInt /*aAttr*/ )
+    {
+    LeaveIfSessionClosedL();
+       
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& musicObjectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+  
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this );
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
+    iQuery->AddPropertyFilterL( &fileTypePropertyDef );
+    
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    
+    // include properties that identify music
+    IncludeMusicPropertiesL( conditions );
+        
+    //
+    // example of defining sort order
+    //
+    // iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) );
+   
+    iQuery->SetResultMode( EQueryResultModeItem );
+   
+    iQuery->FindL();
+    
+    iQueryType = EQueryMusic;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryMusicL
+// 
+// Finds music files with attibute that matches aFindText. Supported attributes
+// are EAttrArtist, EAttrAlbum, EAttrGenre and EAttrComposer.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryMusicL( TInt aAttr, const TDesC& aFindText )
+    {
+    LeaveIfSessionClosedL();
+    CheckAttrL( aAttr );
+    
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+    
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    CMdEPropertyDef& propertyDef = PropertyDefL( aAttr );
+    conditions.AddPropertyConditionL( propertyDef, 
+                            ETextPropertyConditionCompareEquals, aFindText );
+    IncludeMusicPropertiesL( conditions );
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    iQuery->FindL();
+    
+    iQueryType = EQueryMusic;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryVideosL
+// 
+// Finds all video files.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryVideosL( TInt /*aAttr*/ )
+    {
+    LeaveIfSessionClosedL();
+
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& videoObjectDef =
+    defNS.GetObjectDefL( MdeConstants::Video::KVideoObject );
+   
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, videoObjectDef, this );
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    iQuery->FindL();
+    
+    iQueryType = EQueryVideo;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryAttributeValuesL
+// 
+// Finds all different values for aAttr (all artists, albums, genres,
+// or composers).
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryAttributeValuesL( TInt aAttr )
+    {
+    LeaveIfSessionClosedL();
+    CheckAttrL( aAttr );
+    
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+ 
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    iQuery->SetResultMode( EQueryResultModeDistinctValues );
+    
+    CMdEPropertyDef& propertyDef = PropertyDefL( aAttr );
+    
+    // distinct query requires exactly one property filter
+    // (eg. attribute that is included in query result)
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    conditions.AddPropertyConditionL( propertyDef );
+    iQuery->AddPropertyFilterL( &propertyDef );
+    IncludeMusicPropertiesL( conditions );
+    iQuery->FindL();
+    
+    iQueryType = EQueryMusic;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryMusicUnknownL
+// 
+// Find music files that do not have attribute aAttr (eg find all files without 
+// album attribute).
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryMusicUnknownL( TInt aAttr )
+    {
+    LeaveIfSessionClosedL();
+    CheckAttrL( aAttr );
+ 
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    CMdEPropertyDef& propertyDef = PropertyDefL( aAttr );
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    
+    // include properties that identify music
+    IncludeMusicPropertiesL( conditions );
+    
+    // add condition: get music that do not have aAttr attribute
+    CMdELogicCondition& condition = 
+        conditions.AddLogicConditionL( ELogicConditionOperatorAnd );
+    condition.AddPropertyConditionL( propertyDef );
+    condition.SetNegate( ETrue );
+    
+    // set attributes that are included in query result  
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    
+    iQuery->FindL();
+    
+    iQueryType = EQueryMusic;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryMusicUnknownCountL
+// 
+// Find whether there are music files that do not have attribute aAttr
+// (eg files without album attribute)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryMusicUnknownCountL( TInt aAttr )
+    {
+    LeaveIfSessionClosedL();
+    CheckAttrL( aAttr );
+ 
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    CMdEPropertyDef& propertyDef = PropertyDefL( aAttr );
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+
+    // include properties that identify music
+    IncludeMusicPropertiesL( conditions );
+
+    // add condition: get music that do not have aAttr attribute
+    CMdELogicCondition& condition = 
+        conditions.AddLogicConditionL( ELogicConditionOperatorAnd );
+    condition.AddPropertyConditionL( propertyDef );
+    condition.SetNegate( ETrue );
+      
+    
+    // count 0 or 1 is enough for UI
+    iQuery->FindL( 1 );     
+    iQueryType = EQueryUnknown;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryEmptyL
+// 
+// Makes empty query.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryEmptyL()
+    {
+    LeaveIfSessionClosedL();
+    iQueryType = EQueryEmpty;
+    if ( iQuery )
+    	{
+    	iQuery->SetResultMode( EQueryResultModeItem );
+    	HandleQueryCompleted( *iQuery , KErrNone);
+    	}
+    else
+    	{
+        CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+        CMdEObjectDef& objectDef =
+        defNS.GetObjectDefL( MdeConstants::Object::KBaseObject );
+        
+        delete iQuery;
+        iQuery = NULL;
+        iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+
+        iQuery->SetResultMode( EQueryResultModeItem );
+        iQuery->FindL( 0 );
+        
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryRomEmptyL( TInt aQueryType )
+// 
+// Makes empty query.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryRomEmptyL( TInt aQueryType )
+    {
+    LeaveIfSessionClosedL();
+    if ( iQuery )
+    	{
+    	iQueryType = aQueryType;
+    	HandleQueryCompleted( *iQuery , KErrNone);
+    	}
+    else
+    	{
+        CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+        CMdEObjectDef& objectDef =
+        defNS.GetObjectDefL( MdeConstants::Object::KBaseObject );
+        
+        delete iQuery;
+        iQuery = NULL;
+        iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+
+        iQuery->SetResultMode( EQueryResultModeItem );
+        iQuery->FindL( 0 );
+        
+        iQueryType = aQueryType;
+    	}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryRecordingsL
+// 
+// Finds all recordings.
+//
+// Note: File is considered a recording if file extension is "amr" or "wav" and
+//       file is not in rom.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryRecordingsL( TInt /*aAttr*/ )
+    {
+    LeaveIfSessionClosedL();
+        
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& musicObjectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+  
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this );    
+    
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    CMdEPropertyDef& fileTypeDef = PropertyDefL( EAttrMediaType );
+    
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    CMdEObjectCondition& cond = conditions.AddObjectConditionL(
+                                EObjectConditionCompareUriBeginsWith, KDriveZ );
+    cond.SetNegate( ETrue );
+    
+    
+    CMdELogicCondition& condition = 
+        conditions.AddLogicConditionL( ELogicConditionOperatorOr );
+    condition.AddPropertyConditionL( fileTypeDef, 
+            ETextPropertyConditionCompareContains, KMimeTypeAMR );
+    condition.AddPropertyConditionL( fileTypeDef, 
+            ETextPropertyConditionCompareContains, KMimeTypeWAV );
+    
+    iQuery->FindL();
+    
+    iQueryType = EQueryRecording;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryTonesL
+// 
+// Finds all tones.
+// Note: Audio file is considered a tone if it is not music or video.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryTonesL( TInt /*aAttr*/ )
+    {
+    LeaveIfSessionClosedL();
+        
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& musicObjectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+  
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this );    
+    
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    ExcludeMusicPropertiesL( conditions );
+
+    iQuery->FindL();
+    
+    iQueryType = EQueryTone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryDefaultTonesL
+// 
+// Finds all sound files from rom (nokia default tones).
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryDefaultTonesL( TInt /*aAttr*/ )
+    {
+    
+    if ( iRomScanState == MMediaFileHandlerObserver::ERomScanComplete )
+    	{
+    	QueryRomEmptyL( EQueryTone );
+    	}
+    else if ( iRomScanState == MMediaFileHandlerObserver::ERomScanInProgress )
+    	{
+    	iQueryinProgress = ETrue;
+    	}
+    else
+    	{
+    	//Rom scan not start or failed for some reason
+    	iQueryinProgress = ETrue;
+    	StartRomScaning( EQueryTone );
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryDefaultTTonessL
+// 
+// Finds all sound files from rom (nokia default tones).
+// -----------------------------------------------------------------------------
+//
+//void CMediaFileHandler::QueryDefaultTonesL( TInt /*aAttr*/ )
+//    {
+//    LeaveIfSessionClosedL();
+//        
+//    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+//    CMdEObjectDef& musicObjectDef =
+//    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+//  
+//    delete iQuery;
+//    iQuery = NULL;
+//    iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this );    
+//    
+//    
+//    // set attributes that are included in query result  
+//    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+//    iQuery->AddPropertyFilterL( &namePropertyDef );
+//    
+//    iQuery->SetResultMode( EQueryResultModeItem );
+//    
+//    CMdELogicCondition& conditions = iQuery->Conditions();
+//    CMdEObjectCondition& cond = conditions.AddObjectConditionL(
+//                                EObjectConditionCompareUriBeginsWith, KDriveZ );
+//
+//    iQuery->FindL();
+//    
+//    iQueryType = EQueryTone;
+//    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SearchL
+// 
+// Finds all music, tone and video files with any attibute that
+// matches aFindText.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SearchL( const TDesC& aSearchText )
+    {
+    //
+    // search is done in 3 steps, SearchTonesL and SearchVideoL are
+    // called after SearchMusicL is done. Search results are collected
+    // in iSearchList.
+    //
+    
+    if ( aSearchText.Length() == 0 )
+        {
+        iSearchText = KNullDesC;
+        QueryEmptyL();
+        }
+    else
+        {
+        StrCopy( iSearchText, aSearchText );
+        SearchMusicL( iSearchText );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SearchAudioL
+// 
+// Finds all audio files with attibute that matches aFindText.
+// Searched attributes are name, artist, album, genre, composer.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SearchAudioL( const TDesC& aSearchText )
+    {
+    SearchMusicL( aSearchText );
+    iQueryType = ESearchAudio;
+    
+    /*
+    LeaveIfSessionClosedL();
+
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& song = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &song );
+    
+    CMdEPropertyDef& artist = PropertyDefL( EAttrArtist );
+    iQuery->AddPropertyFilterL( &artist );
+    CMdEPropertyDef& album = PropertyDefL( EAttrAlbum );
+    iQuery->AddPropertyFilterL( &album );
+    CMdEPropertyDef& genre = PropertyDefL( EAttrGenre );
+    iQuery->AddPropertyFilterL( &genre );
+    CMdEPropertyDef& composer = PropertyDefL( EAttrComposer );
+    iQuery->AddPropertyFilterL( &composer );
+  
+    CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
+    iQuery->AddPropertyFilterL( &fileTypePropertyDef );
+
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    conditions.SetOperator( ELogicConditionOperatorAnd );
+    
+    IncludeMusicSearchConditionL( conditions, aSearchText );
+    
+    
+
+    // iQuery->AppendOrderRuleL( TMdEOrderRule( song, ESortAscending ) );                            
+    iQuery->SetResultMode( EQueryResultModeItem );
+    iQuery->FindL();
+    
+    iQueryType = ESearchAudio;
+    */
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SearchMusicL
+// 
+// Finds all music with attibute that matches aFindText.
+// Searched attributes are name, artist, album, genre, composer.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SearchMusicL( const TDesC& aSearchText )
+    {
+    LeaveIfSessionClosedL();
+
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& songName = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &songName );
+    CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
+    iQuery->AddPropertyFilterL( &fileTypePropertyDef );
+
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    conditions.SetOperator( ELogicConditionOperatorAnd );
+    
+    //IncludeMusicPropertiesL( conditions );
+    IncludeMusicSearchConditionL( conditions, aSearchText );
+
+    iQuery->SetResultMode( EQueryResultModeItem );
+    iQuery->FindL();
+    
+    iQueryType = ESearchMusic;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SearchTonesL
+// 
+// Finds all tones with attibute that matches aFindText.
+// Searched attribute is file name.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SearchTonesL( const TDesC& /*aSearchText */)
+    {
+    if ( iRomScanState == MMediaFileHandlerObserver::ERomScanComplete )
+    	{
+    	QueryRomEmptyL( ESearchTones );
+    	}
+    else if ( iRomScanState == MMediaFileHandlerObserver::ERomScanInProgress )
+    	{
+    	iQueryinProgress = ETrue;
+    	}
+    else
+    	{
+    	//Rom scan not start or failed for some reason
+    	iQueryinProgress = ETrue;
+    	StartRomScaning( ESearchTones );
+    	}
+    }
+
+//
+//// -----------------------------------------------------------------------------
+//// CMediaFileHandler::SearchTonesL
+//// 
+//// Finds all tones with attibute that matches aFindText.
+//// Searched attribute is file name.
+//// -----------------------------------------------------------------------------
+////
+//void CMediaFileHandler::SearchTonesL( const TDesC& aSearchText )
+//    {
+//    LeaveIfSessionClosedL();
+//
+//    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+//    CMdEObjectDef& objectDef =
+//    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+//
+//    delete iQuery;
+//    iQuery = NULL;
+//    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+//    
+//    // set attributes that are included in query result  
+//    CMdEPropertyDef& songName = PropertyDefL( EAttrSongName );
+//    iQuery->AddPropertyFilterL( &songName );
+//    CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
+//    iQuery->AddPropertyFilterL( &fileTypePropertyDef );
+//
+//    
+//    CMdELogicCondition& conditions = iQuery->Conditions();
+//    conditions.SetOperator( ELogicConditionOperatorAnd );
+//    
+//    //ExcludeMusicPropertiesL( conditions );
+//    CMdEObjectCondition& cond = conditions.AddObjectConditionL(
+//                                EObjectConditionCompareUriBeginsWith, KDriveZ );
+//    
+//    IncludeToneSearchConditionL( conditions, aSearchText );
+//
+//    iQuery->SetResultMode( EQueryResultModeItem );
+//    iQuery->FindL();
+//    
+//    iQueryType = ESearchTones;
+//    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SearchVideoL
+//
+// Finds all videos with attibute that matches aFindText.
+// Searched attributes are name, artist, genre.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SearchVideoL( const TDesC& aSearchText )
+    {
+    LeaveIfSessionClosedL();
+    if ( iRomScanState != MMediaFileHandlerObserver::ERomScanComplete )
+        {
+        
+        StartRomScaning( ESearchVideo );
+        }
+    
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Video::KVideoObject );
+
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& songName = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &songName );
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    IncludeVideoSearchConditionL( conditions, aSearchText );
+   
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    if ( iVideoSearchDisabled )
+        {
+        iQuery->FindL( 0 );
+        }
+    else
+        {
+        iQuery->FindL();    
+        }
+    
+    iQueryType = ESearchVideo;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::SearchVideo
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::SearchVideo( TAny *aObj )
+    {    
+    CMediaFileHandler* handler = (CMediaFileHandler*) aObj;
+    
+    TInt err = KErrNone;
+    TRAP( err, handler->SearchVideoL( handler->iSearchText ) );
+    
+    if ( err != KErrNone )
+        {
+        handler->CallObserver( MMediaFileHandlerObserver::EError, err );
+        }
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog::SearchTones
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::SearchTones( TAny *aObj )
+    {    
+    CMediaFileHandler* handler = (CMediaFileHandler*) aObj;
+    
+    TInt err = KErrNone;
+    TRAP( err, handler->SearchTonesL( handler->iSearchText ) );
+    
+    if ( err != KErrNone )
+        {
+        handler->CallObserver( MMediaFileHandlerObserver::EError, err );
+        }
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ResultCount
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::ResultCount()
+    {
+    if ( !iSessionOpen )
+        {
+        return 0;
+        }
+    
+    return iSearchList->Count();
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::UnknownArtistCount
+// 
+// Returns 1 if artist has at least one music file without album attribute,
+// 0 otherwise.
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::UnknownArtistCount()
+    {
+    TInt ret = 0;
+    
+    TInt err = KErrNone;
+    TRAP( err, ret = UnknownArtistCountL() );
+    if ( err != KErrNone )
+        {
+        ret = 0;
+        }
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::UnknownArtistCountL
+// 
+// Returns 1 if artist has at least one music file without album attribute,
+// 0 otherwise.
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::UnknownArtistCountL()
+    {
+    CMdEObjectQuery* artistQuery = iArtistQuery->Query();
+    if ( !artistQuery )
+        {
+        return 0;
+        }
+
+    TInt count = artistQuery->Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        CMdEObject& object = artistQuery->Result( i );
+        
+        CMdEPropertyDef& propDef = 
+        CMediaFileHandler::PropertyDefL( iSession, CMediaFileHandler::EAttrAlbum );
+        
+        CMdEProperty* property = NULL;
+        TInt ret = object.Property( propDef, property, 0 );
+        if ( ret == KErrNotFound )
+            {
+            return 1;
+            }
+        }    
+    
+    return 0;
+    }
+// -----------------------------------------------------------------------------
+// void CMediaFileHandler::StartRomScaning()
+// 
+// Start rom scanning
+// -----------------------------------------------------------------------------
+//
+
+void CMediaFileHandler::StartRomScaning( TInt aQueryType )
+    {
+    
+    if ( iRomScanState != MMediaFileHandlerObserver::ERomScanComplete )
+        {
+        iRomScanState = MMediaFileHandlerObserver::ERomScanInProgress;
+        iRomFileList->Reset();
+        TRAPD( err , iRomFileList->ReadRomFilesL() );
+        if ( err != KErrNone )
+            {
+            iRomScanState = MMediaFileHandlerObserver::ERomScanError;
+            }
+        else
+            {
+            iRomScanState = MMediaFileHandlerObserver::ERomScanComplete;
+            }
+        }
+    
+    iSearchList->SetRomFileList( iRomFileList );
+    
+    if ( iQueryinProgress )
+        {
+        QueryRomEmptyL( aQueryType );
+    	}
+    
+    CallObserver( MMediaFileHandlerObserver::EScanRomComplete, KErrNone );
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::CancelQuery
+// 
+// Cancels ongoing query.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::CancelQuery()
+    {
+    if ( !iSessionOpen || !iQuery )
+        {
+        return;
+        }
+    
+    if ( !iQuery->IsComplete() )
+        {
+        iQuery->Cancel(); // this calls HandleQueryCompleted synchronously
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::LeaveIfSessionClosedL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::LeaveIfSessionClosedL()
+    {
+    if ( !iSession || !iSessionOpen )
+        {
+        User::Leave( KErrDisconnected );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SetObserver
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SetObserver( MMediaFileHandlerObserver* aObserver )
+    {
+    iObserver = aObserver;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::CheckAttrL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::CheckAttrL( TInt aAttr )
+    {
+    if ( aAttr != EAttrArtist && aAttr != EAttrAlbum &&
+         aAttr != EAttrGenre && aAttr != EAttrComposer )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::GetAttributeL
+// 
+// NOTE: GetAttributeL only gets full name or file name
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::GetAttributeL( TInt aIndex, TInt aAttr, 
+                                       TDes& aValue, TInt aQueryId )
+    {
+    aValue = KNullDesC;
+    
+    if ( !iSessionOpen )
+         {
+         return;
+         }
+    
+    TInt id = iSearchList->SearchId();
+    if ( id != aQueryId )
+        {
+        return; // search list and UI do not match
+        }
+    
+    iSearchList->SetSession( iSession );
+    iSearchList->GetAttributeL( aIndex, aAttr, aValue );
+    }
+
+
+    
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::GetAttribute
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::GetAttribute( TInt aIndex, TInt aAttr,
+                                      TDes& aValue, TInt aQueryId  )
+    {
+    TRAP_IGNORE( GetAttributeL( aIndex, aAttr, aValue, aQueryId ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::Attribute
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::Attribute( TInt aIndex, TInt aAttr, TInt aQueryId )
+    {
+    if ( !iSessionOpen )
+         {
+         return KErrNotFound;
+         }
+     
+    TInt id = iSearchList->SearchId();
+    if ( id != aQueryId )
+        {
+        return KErrNotFound;
+        }
+    
+    return iSearchList->Attribute( aIndex, aAttr );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ItemIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::ItemIndex( TInt aItemId, TInt aIndex )
+    {
+    return iSearchList->ItemIndex( aItemId, aIndex );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ItemIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::ItemIndex( const TDesC& aItemText, TInt aIndex )
+    {
+    return iSearchList->ItemIndex( aItemText, aIndex );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ReadMediaFileDataL
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileData* CMediaFileHandler::ReadMediaFileDataL( TInt aId )
+    {
+    if ( !iSessionOpen )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    CMdEObject* object = iSession->GetFullObjectL( aId );
+    CleanupStack::PushL( object );
+    
+    CMediaFileData* data = CMediaFileData::NewL();
+    CleanupStack::PushL( data );
+    
+    data->SetAttrL( EAttrFullName, object->Uri() );
+    
+    CMdEProperty* property = NULL;
+    TInt ret = object->Property( PropertyDefL( EAttrSongName ), property, 0 );
+    if ( ret != KErrNotFound )
+        {
+        data->SetAttrL( EAttrSongName, property->TextValueL() );
+        }
+    
+    ret = object->Property( PropertyDefL( EAttrArtist ), property, 0 );
+    if ( ret != KErrNotFound )
+        {
+        data->SetAttrL( EAttrArtist, property->TextValueL() );
+        }
+    
+    ret = object->Property( PropertyDefL( EAttrAlbum ), property, 0 );
+    if ( ret != KErrNotFound )
+        {
+        data->SetAttrL( EAttrAlbum, property->TextValueL() );
+        }
+    
+    ret = object->Property( PropertyDefL( EAttrGenre ), property, 0 );
+    if ( ret != KErrNotFound )
+        {
+        data->SetAttrL( EAttrGenre, property->TextValueL() );
+        }
+    
+    ret = object->Property( PropertyDefL( EAttrComposer ), property, 0 );
+    if ( ret != KErrNotFound )
+        {
+        data->SetAttrL( EAttrComposer, property->TextValueL() );
+        }
+
+    CleanupStack::Pop( data );
+    CleanupStack::PopAndDestroy( object );
+    
+    return data;
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ReadMediaFileDataL
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileData* CMediaFileHandler::RomMediaFileDataL( TInt aId ,TInt aMediaType )
+    {
+    if (!iRomFileList)
+        {
+        User::Leave(KErrNotFound);
+        }
+
+    TBuf<KBufSize128> buf;
+    CMediaFileData* data = CMediaFileData::NewL();
+    CleanupStack::PushL(data);
+
+    if (aMediaType == EMediaTypeTone)
+        {
+        data->SetAttrL(EAttrFullName, iRomFileList->Item(aId, 0));
+        iRomFileList->GetRomFileName(aId, 0, buf);
+        data->SetAttrL(EAttrSongName, buf);
+        }
+
+    if (aMediaType == EMediaTypeVideo)
+        {
+        data->SetAttrL(EAttrFullName, iRomFileList->Item(aId, 1));
+        iRomFileList->GetRomFileName(aId, 1, buf);
+        data->SetAttrL(EAttrSongName, buf);
+        }
+
+    CleanupStack::Pop(data);
+
+    return data;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::PropertyDefL
+// 
+// -----------------------------------------------------------------------------
+//
+CMdEPropertyDef& CMediaFileHandler::PropertyDefL( TInt aAttr )
+    {
+    return PropertyDefL( iSession, aAttr );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::PropertyDefL
+// 
+// -----------------------------------------------------------------------------
+//
+CMdEPropertyDef& CMediaFileHandler::PropertyDefL( CMdESession* aSession, TInt aAttr )
+    {
+    CMdENamespaceDef& defNS = aSession->GetDefaultNamespaceDefL();
+    
+    CMdEObjectDef& objectDef =
+    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+   
+    if ( aAttr == EAttrFileSize )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
+        }
+    else if ( aAttr == EAttrMediaType )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
+        }
+    else if ( aAttr == EAttrSongName || aAttr == EAttrFileName )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
+        }
+    else if ( aAttr == EAttrArtist )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty );
+        }
+    else if ( aAttr == EAttrAlbum )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty );
+        }
+    else if ( aAttr == EAttrGenre )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
+        }
+    else if ( aAttr == EAttrComposer )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty );
+        }
+    else
+        {
+        User::Leave( KErrNotSupported );
+        }
+    
+    return objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryReady
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileHandler::QueryReady() 
+    {
+    if ( iIdle )
+        {
+        TBool isSearching = iIdle->IsActive();
+        if ( isSearching )
+            {
+            return EFalse; // we are between audio, tone and and video search
+            }
+        }
+    
+    TBool isWaitingObserverCall = iQueryCaller->IsActive();
+    if ( isWaitingObserverCall )
+        {
+        return EFalse; // query is ready but observer not called yet
+        }
+    
+    if ( iQuery )
+        {
+        return iQuery->IsComplete();    
+        }
+     
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ExcludeMimeTypesL
+// 
+// Exclude mime types from query. 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::ExcludeMimeTypesL( CMdELogicCondition& aCondition, 
+                                           TInt /*aAttr*/ )
+    {
+    TInt count = iExcludedMimeTypes->Count();
+    
+    if ( count == 0 )
+        {
+        return;
+        }
+
+    CMdEPropertyDef& fileTypeDef = PropertyDefL( EAttrMediaType );
+    CMdELogicCondition& condition = 
+                        aCondition.AddLogicConditionL( ELogicConditionOperatorAnd );
+
+    for ( TInt i=0; i<count; i++ )
+        {
+        TPtrC ptr = iExcludedMimeTypes->MimeType( i );
+        condition.AddPropertyConditionL( fileTypeDef, 
+                             ETextPropertyConditionCompareEquals, ptr );
+        }
+    condition.SetNegate( ETrue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::IncludeMusicPropertiesL
+// 
+// Adds properties that are used to find out whether media file is music.
+// File is considered music if:
+// 1. it has metadata artist or album or genre or composer
+// 2. its mime type is 'music' mime type (eg mp3)
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::IncludeMusicPropertiesL( CMdELogicCondition& aCondition )
+    {
+    ExcludeRomFilesL( aCondition );
+//    CMdEObjectCondition& cond = aCondition.AddObjectConditionL(
+//                                EObjectConditionCompareUriBeginsWith, KDriveZ );
+//    cond.SetNegate( ETrue );
+    
+//    CMdELogicCondition& condition = 
+//                        aCondition.AddLogicConditionL( ELogicConditionOperatorAnd );
+    ExcludeRecordingsL( aCondition );
+//    CMdEPropertyDef& fileTypeDef = PropertyDefL( EAttrMediaType );
+//    condition.AddPropertyConditionL( fileTypeDef, 
+//            ETextPropertyConditionCompareContains, KMimeTypeAMR );
+//    condition.AddPropertyConditionL( fileTypeDef, 
+//            ETextPropertyConditionCompareContains, KMimeTypeWAV );
+//    condition.SetNegate( ETrue );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::IncludeMusicPropertiesL
+// 
+// Adds properties that are used to find out whether media file is music.
+// File is considered music if:
+// 1. it has metadata artist or album or genre or composer
+// 2. its mime type is 'music' mime type (eg mp3)
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::IncludeMusicPropertiesL( CMdELogicCondition& aCondition )
+    {
+    //aLogicCondition.SetOperator( ELogicConditionOperatorAnd );
+    
+    CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType );
+    CMdEPropertyDef& artistTypeDef = PropertyDefL( EAttrArtist );
+    CMdEPropertyDef& albumTypeDef = PropertyDefL( EAttrAlbum );
+    CMdEPropertyDef& genreTypeDef = PropertyDefL( EAttrGenre );
+    CMdEPropertyDef& composerTypeDef = PropertyDefL( EAttrComposer );
+    
+    CMdELogicCondition& condition = 
+                        aCondition.AddLogicConditionL( ELogicConditionOperatorOr );
+
+    condition.AddPropertyConditionL( mimeTypeDef, 
+            ETextPropertyConditionCompareContains, KMimeMp3 );
+    condition.AddPropertyConditionL( artistTypeDef );
+    condition.AddPropertyConditionL( albumTypeDef );
+    condition.AddPropertyConditionL( genreTypeDef );
+    condition.AddPropertyConditionL( composerTypeDef );
+    }
+*/
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ExcludeMusicPropertiesL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::ExcludeMusicPropertiesL( CMdELogicCondition& aCondition )
+    {
+    CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType );
+    CMdEPropertyDef& artistTypeDef = PropertyDefL( EAttrArtist );
+    CMdEPropertyDef& albumTypeDef = PropertyDefL( EAttrAlbum );
+    CMdEPropertyDef& genreTypeDef = PropertyDefL( EAttrGenre );
+    CMdEPropertyDef& composerTypeDef = PropertyDefL( EAttrComposer );
+    
+    CMdELogicCondition& condition = 
+                        aCondition.AddLogicConditionL( ELogicConditionOperatorAnd );
+
+    condition.AddPropertyConditionL( mimeTypeDef, 
+            ETextPropertyConditionCompareContains, KMimeMp3 );
+    condition.AddPropertyConditionL( artistTypeDef );
+    condition.AddPropertyConditionL( albumTypeDef );
+    condition.AddPropertyConditionL( genreTypeDef );
+    condition.AddPropertyConditionL( composerTypeDef );
+    
+    condition.SetNegate( ETrue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::IncludeMusicSearchConditionL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::IncludeMusicSearchConditionL( CMdELogicCondition& aCondition,
+                                                      const TDesC& aSearchText )
+                                    
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    CMdELogicCondition& condition = 
+    aCondition.AddLogicConditionL( ELogicConditionOperatorOr );
+        
+    CMdEPropertyDef& songName = PropertyDefL( EAttrSongName );
+    CMdEPropertyDef& artist = PropertyDefL( EAttrArtist );
+    CMdEPropertyDef& album = PropertyDefL( EAttrAlbum );    
+    CMdEPropertyDef& genre = PropertyDefL( EAttrGenre );
+    CMdEPropertyDef& composer = PropertyDefL( EAttrComposer );
+    
+    // first find from the start of the property
+    condition.AddPropertyConditionL( songName,
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+
+    condition.AddPropertyConditionL( artist, 
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+ 
+
+    condition.AddPropertyConditionL( album, 
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+
+    
+    condition.AddPropertyConditionL( genre, 
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+
+    
+    condition.AddPropertyConditionL( composer, 
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+    
+    
+    // then find from the start of property words
+    TBuf<KBufSize128> buf;
+    if ( aSearchText.Length() < KBufSize128-1 )
+        {
+        buf.Format( KFormat, &KSpace, &aSearchText );
+    
+        condition.AddPropertyConditionL( songName, 
+             ETextPropertyConditionCompareContains, buf );
+        condition.AddPropertyConditionL( artist, 
+             ETextPropertyConditionCompareContains, buf );
+        condition.AddPropertyConditionL( album, 
+             ETextPropertyConditionCompareContains, buf );
+        condition.AddPropertyConditionL( genre, 
+             ETextPropertyConditionCompareContains, buf );
+        condition.AddPropertyConditionL( composer, 
+             ETextPropertyConditionCompareContains, buf );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::IncludeVideoConditionL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::IncludeVideoSearchConditionL(
+                  CMdELogicCondition& aCondition, const TDesC& aSearchText )
+                                    
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    CMdELogicCondition& condition = 
+    aCondition.AddLogicConditionL( ELogicConditionOperatorOr );
+        
+    CMdEPropertyDef& songName = PropertyDefL( EAttrSongName );
+    CMdEPropertyDef& artist = PropertyDefL( EAttrArtist );
+    CMdEPropertyDef& genre = PropertyDefL( EAttrGenre );
+    
+    // first find from the start of the property
+    condition.AddPropertyConditionL( songName,
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+    condition.AddPropertyConditionL( artist, 
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+    condition.AddPropertyConditionL( genre, 
+            ETextPropertyConditionCompareBeginsWith, aSearchText );
+    
+    // then find from the start of property words
+    TBuf<KBufSize128> buf;
+    if ( aSearchText.Length() < KBufSize128-1 )
+        {
+        buf.Format( KFormat, &KSpace, &aSearchText );
+    
+        condition.AddPropertyConditionL( songName, 
+             ETextPropertyConditionCompareContains, buf );
+        condition.AddPropertyConditionL( artist, 
+             ETextPropertyConditionCompareContains, buf );
+        condition.AddPropertyConditionL( genre, 
+             ETextPropertyConditionCompareContains, buf );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::IncludeToneSearchConditionL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::IncludeToneSearchConditionL( CMdELogicCondition& aCondition,
+                                                     const TDesC& aSearchText )
+                                    
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    CMdELogicCondition& condition = 
+    aCondition.AddLogicConditionL( ELogicConditionOperatorOr );
+        
+    CMdEPropertyDef& songName = PropertyDefL( EAttrSongName );
+    
+    // first find from the start of the property
+    condition.AddPropertyConditionL( songName,
+              ETextPropertyConditionCompareBeginsWith, aSearchText );
+    
+    // then find from the start of property words
+    TBuf<KBufSize128> buf;
+    if ( aSearchText.Length() < KBufSize128-1 )
+        {
+        buf.Format( KFormat, &KSpace, &aSearchText );
+    
+        condition.AddPropertyConditionL( songName, 
+             ETextPropertyConditionCompareContains, buf );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ExcludeRecordingsL
+// 
+// Exclude recording mime types from query (.amr and .wav).
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::ExcludeRecordingsL( CMdELogicCondition& aCondition )
+    {
+    CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType );
+    CMdELogicCondition& condition = 
+                        aCondition.AddLogicConditionL( ELogicConditionOperatorAnd );
+    condition.AddPropertyConditionL( mimeTypeDef, 
+                             ETextPropertyConditionCompareEquals, KMimeTypeAMR );
+    condition.AddPropertyConditionL( mimeTypeDef, 
+                              ETextPropertyConditionCompareEquals, KMimeTypeWAV );
+    condition.SetNegate( ETrue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ExcludeRomFilesL
+// 
+// Exclude music files that are in rom (default tones).
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::ExcludeRomFilesL( CMdELogicCondition& aCondition )
+    {
+    _LIT( KDriveZ, "z:\\" );
+   
+    CMdEObjectCondition& cond = aCondition.AddObjectConditionL(
+                                EObjectConditionCompareUriBeginsWith, KDriveZ );
+    cond.SetNegate( ETrue );
+    }
+
+
+// -------------------------------------------------------------------------------
+// CMediaFileHandler::StrCopy
+//
+// String copy with lenght check.
+// -------------------------------------------------------------------------------
+//
+void CMediaFileHandler::StrCopy( TDes& aTarget, const TDesC& aSource )
+    {
+	TInt len = aTarget.MaxLength();
+    if( len < aSource.Length() ) 
+	    {
+		aTarget.Copy( aSource.Left( len ) );
+		return;
+	    }
+	aTarget.Copy( aSource );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::EnableObserverCall
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::EnableObserverCall( TBool aEnable )
+    {
+    iObserverCallEnabled = aEnable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::CallObserver
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::CallObserver( TInt aEvent, TInt aError )
+    {
+    const TInt KDelay = 100;  // milliseconds
+    
+    if ( !iObserverCallEnabled )
+        {
+        return;    
+        }
+
+    iQueryError = aError;
+    iQueryEvent = aEvent;
+    
+    iQueryCaller->Start( 0, KDelay );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::CallObserverWithDelay
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::CallObserverWithDelay()
+    {
+    const TInt KOneSecond = 1000;
+    
+    if ( !iObserverCallEnabled )
+        {
+        return;    
+        }
+
+    iObjectNotificationCaller->Start( 1, 2*KOneSecond );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleActiveCallL (from MMFActiveCallerObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::HandleActiveCallL( TInt aCallId )
+    {
+    if ( !iObserver )
+        {
+        return;
+        }
+    
+    // inform observer that query is ready
+    if ( aCallId ==  0 )
+        {
+        TRAP_IGNORE( iObserver->HandleMFEventL( iQueryEvent, iQueryError ) );
+        }
+
+    // inform observer that database has changed
+    if ( aCallId == 1 )
+        {
+        if ( QueryReady() )
+            {
+            TRAP_IGNORE( iObserver->HandleMFEventL( MMediaFileHandlerObserver::EMediaFileChanged, KErrNone ) );
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SetQueryId
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SetQueryId( TInt aId ) 
+    {
+    // this id is passed to CSearchList after successful database search
+    iQueryId = aId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::Panic
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::Panic( TInt aReason ) 
+    {
+    _LIT( KPanicCategory, "CMediaFileHandler" );
+    
+    User::Panic( KPanicCategory, aReason ); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::MediaType
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::MediaType( TInt aQueryType )
+    {
+    TInt mediaType = EMediaTypeMusic;
+    if ( aQueryType == EQueryVideo )
+        {
+        mediaType = EMediaTypeVideo;
+        }
+    if ( aQueryType == EQueryRecording )
+        {
+        mediaType = EMediaTypeRecording;
+        }
+    if ( aQueryType == EQueryTone )
+        {
+        mediaType = EMediaTypeTone;
+        }
+
+    return mediaType;
+    }
+
+
+
+/******************************************************************************
+ * class CSearchListItem
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CSearchListItem::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CSearchListItem* CSearchListItem::NewLC()
+    {
+    CSearchListItem* self = new (ELeave) CSearchListItem();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchListItem::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CSearchListItem* CSearchListItem::NewL()
+    {
+    CSearchListItem* self = new (ELeave) CSearchListItem();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CSearchListItem::~CSearchListItem()
+    {
+    delete iTitle;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchListItem::CSearchListItem
+// 
+// -----------------------------------------------------------------------------
+//
+CSearchListItem::CSearchListItem()
+    {
+    iId = KErrNotFound;
+    iMediaType = KErrNotFound;
+    iStorageType = KErrNotFound;
+    iTitle = NULL;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchListItem::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchListItem::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSearchListItem::SetTitleL
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CSearchListItem::SetTitleL( const TDesC& aText, TBool aFullName )
+    {
+    delete iTitle;
+    iTitle = NULL;
+    
+    if ( aFullName )
+        {
+        TParsePtrC parse( aText );
+        iTitle = parse.Name().AllocL();
+        }
+    else
+        {
+        iTitle = aText.AllocL();    
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchListItem::Title
+// 
+// -----------------------------------------------------------------------------
+//
+
+const TDesC& CSearchListItem::Title() const
+    {
+    return *iTitle;
+    }
+
+
+
+
+/******************************************************************************
+ * class CRomFileList
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// Static constructor function CRomFileList::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CRomFileList* CRomFileList::NewL()
+    {
+    CRomFileList* self = new (ELeave) CRomFileList();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CRomFileList::~CRomFileList()
+    {
+    iRomToneList.ResetAndDestroy();
+    iRomVideoList.ResetAndDestroy();
+    iList.Reset();
+    iList.Close();
+    iVedioList.Reset();
+    iVedioList.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRomFileList::CRomFileList
+// 
+// -----------------------------------------------------------------------------
+//
+CRomFileList::CRomFileList()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRomFileList::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CRomFileList::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CRomFileList::RomFileItem( TInt aIndex )
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CRomFileList::RomFileItem( CSearchListItem* aItem, TInt aIndex)
+    {
+    if( aIndex >= 0 && aIndex < iRomToneList.Count() )
+    	{
+    	aItem->iId = iRomToneList[aIndex]->iId;
+    	aItem->iMediaType = iRomToneList[aIndex]->iMediaType;
+    	aItem->iStorageType = iRomToneList[aIndex]->iStorageType;
+    	TPtrC title = iRomToneList[aIndex]->Title();
+    	aItem->SetTitleL( title, EFalse );
+    	return KErrNone;
+    	}
+    return KErrGeneral;
+     }
+
+// -----------------------------------------------------------------------------
+// CRomFileList::RomVedioItem( TInt aIndex )
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CRomFileList::RomVedioItem( CSearchListItem* aItem, TInt aIndex)
+    {
+    if( aIndex >= 0 && aIndex < iRomVideoList.Count() )
+        {
+        aItem->iId = iRomVideoList[aIndex]->iId;
+        aItem->iMediaType = iRomVideoList[aIndex]->iMediaType;
+        aItem->iStorageType = iRomVideoList[aIndex]->iStorageType;
+        TPtrC title = iRomVideoList[aIndex]->Title();
+        aItem->SetTitleL( title, EFalse );
+        return KErrNone;
+        }
+    return KErrGeneral;
+     }
+// -----------------------------------------------------------------------------
+// CRomFileList::Count()
+// 
+// -----------------------------------------------------------------------------
+//
+
+TInt CRomFileList::Count(TInt aType )
+    {
+    if ( aType == 0 )
+        {
+        //Tone item count
+        return iRomToneList.Count();
+        }
+    else if ( aType == 1 )
+        {
+        // Video item count()
+        return iRomVideoList.Count();
+        }
+    return KErrNotSupported;
+    }
+
+// -----------------------------------------------------------------------------
+// CRomFileList::Reset()
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CRomFileList::Reset()
+    {
+    iRomToneList.Reset();
+    iRomVideoList.Reset();
+    iList.Reset();
+    iVedioList.Reset();
+    }
+// -----------------------------------------------------------------------------
+// CRomFileList::ReadRomFilesL()
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CRomFileList::ReadRomFilesL()
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    iRomToneList.ResetAndDestroy();
+    iList.Reset();
+    
+    iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SoundsPath() );
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iRomToneList ) );    
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iList ) );
+    
+    iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::DigitalSoundsPath() );
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iRomToneList ) );    
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iList ) );
+
+    iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SimpleSoundsPath() );
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iRomToneList ) );    
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iList ) );
+
+    TRAP_IGNORE( ReadRomVediosL() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRomFileList::ReadRomFilesL()
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CRomFileList::ReadRomVediosL()
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    iRomVideoList.Reset();
+    iVedioList.Reset();
+    
+    iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::VideosPath() );
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iRomVideoList ) );    
+    TRAP_IGNORE( ReadDirectoryL( iFileName, iVedioList ) );
+    
+    if ( iRomVideoList.Count() > 0 )
+        {
+        for( TInt i(0); i < iRomVideoList.Count(); i++)
+            {
+            iRomVideoList[i]->iMediaType = CMediaFileHandler::EMediaTypeVideo;
+            }
+        }
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// TDesC& CRomFileList::Item( TInt aIndex )
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CRomFileList::Item(TInt aIndex, TInt aType)
+    {
+    TInt count = 0;
+    if ( aType == 0 )
+        {
+        count = iList.Count();
+        if (aIndex >= 0 && aIndex < count)
+            {
+            return iList[aIndex];
+            }
+        }
+    else if ( aType == 1 )
+        {
+        count = iVedioList.Count();
+        if (aIndex >= 0 && aIndex < count)
+            {
+            return iVedioList[aIndex];
+            }
+        }
+    return KNullDesC;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRomFileList::ReadDirectoryL( const TDesC& aDirectory, 
+//                                      RPointerArray<CSearchListItem>& aList )
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CRomFileList::ReadDirectoryL( const TDesC& aDirectory, 
+                                   RPointerArray<CSearchListItem>& aList )
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    CDir* dir = NULL;
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() ); 
+    CleanupClosePushL( fsSession );
+    
+    if ( !BaflUtils::FolderExists( fsSession, aDirectory ) )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    TInt err = fsSession.GetDir( aDirectory, KEntryAttNormal, ESortByName, dir );
+    User::LeaveIfError( err );
+    CleanupStack::PushL( dir );
+    TInt index;
+    TInt count = dir->Count();
+    TFileName filename;
+    for ( TInt i=0; i<count; i++ )
+        {
+        const TEntry item = (*dir)[i];
+        filename.Format( KFormat, &aDirectory, &item.iName );
+        index = aList.Count();
+        CSearchListItem* item2 = SearchListItemFromRomL( filename, index );
+        aList.Append( item2 );
+        }
+
+    CleanupStack::PopAndDestroy( dir );
+
+    CleanupStack::PopAndDestroy(); // fsSession
+    }
+
+// -----------------------------------------------------------------------------
+// CRomFileList::ReadDirectoryL( const TDesC& aDirectory, 
+//                                      RPointerArray<CSearchListItem>& aList )
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CRomFileList::ReadDirectoryL( const TDesC& aDirectory, 
+											RArray<TFileName>& aList )
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    CDir* dir = NULL;
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() ); 
+    CleanupClosePushL( fsSession );
+    
+    if ( !BaflUtils::FolderExists( fsSession, aDirectory ) )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    TInt err = fsSession.GetDir( aDirectory, KEntryAttNormal, ESortByName, dir );
+    User::LeaveIfError( err );
+    CleanupStack::PushL( dir );
+
+    TInt count = dir->Count();
+    TFileName filename;
+    for ( TInt i=0; i<count; i++ )
+        {
+        const TEntry item = (*dir)[i];
+        filename.Format( KFormat, &aDirectory, &item.iName );
+        aList.Append( filename );
+        }
+
+    CleanupStack::PopAndDestroy( dir );
+
+    CleanupStack::PopAndDestroy(); // fsSession
+    }
+// -----------------------------------------------------------------------------
+// CRomFileList::SearchListItemFromRomL( const TDesC& aFileName )
+// 
+// -----------------------------------------------------------------------------
+//
+
+CSearchListItem* CRomFileList::SearchListItemFromRomL( const TDesC& aFileName ,TInt aIndex )
+    {
+    TParsePtrC parsedName( aFileName );
+    
+    CSearchListItem* item  = CSearchListItem::NewLC();
+    
+    item->iId = aIndex;
+    item->SetTitleL( aFileName , ETrue);
+    item->iStorageType = CMediaFileHandler::ERomStorage;
+    item->iMediaType = CMediaFileHandler::EMediaTypeTone;
+
+    CleanupStack::Pop();  // item
+
+    return item;
+    }
+
+// -----------------------------------------------------------------------------
+// CRomFileList::GetRomFileName
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CRomFileList::GetRomFileName(TInt aIndex, TInt aType, TDes& aValue)
+	{
+	//return title of rom item;
+    if (aType == 0)
+        {
+        if (aIndex >= 0 && aIndex < Count(0))
+            {
+            aValue.Copy( iRomToneList[aIndex]->Title() );
+            return KErrNone;
+            }
+        return KErrGeneral;
+        }
+    else if (aType == 1)
+        {
+        if (aIndex >= 0 && aIndex < Count(1))
+            {
+            aValue.Copy(iRomVideoList[aIndex]->Title());
+            return KErrNone;
+            }
+        return KErrGeneral;
+        }
+    return KErrNotFound;
+    }
+
+
+/******************************************************************************
+ * class CSearchList
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CSearchList* CSearchList::NewL()
+    {
+    CSearchList* self = new (ELeave) CSearchList();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CSearchList::~CSearchList()
+    {
+    iList.ResetAndDestroy();
+    delete iDriveUtil;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::CSearchList
+// 
+// -----------------------------------------------------------------------------
+//
+CSearchList::CSearchList()
+    {
+    iSearchId = KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::ConstructL()
+    {
+    iDriveUtil = CDriveUtil::NewL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::SetSession
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::SetSession( CMdESession* aSession )
+    {
+    iSession = aSession;
+    }
+
+// -----------------------------------------------------------------------------
+// CSearchList::SetRomFileList
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::SetRomFileList( CRomFileList* aRomFileList )
+	{
+	iRomFileList = aRomFileList;
+	}
+
+// -----------------------------------------------------------------------------
+// CSearchList::SetSearchId
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::SetSearchId( TInt aSearchId )
+    {
+    iSearchId = aSearchId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::SearchId
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::SearchId()
+    {
+    return iSearchId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::TakeResultL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::TakeResultL( CMdEObjectQuery* aQuery, TInt aMediaType )
+    {
+    if ( !aQuery )
+        {
+        return;
+        }
+    CMdEObjectQuery* query = static_cast<CMdEObjectQuery*> (aQuery);
+    TInt count = query->Count();
+
+    for (TInt i = 0; i < count; i++)
+        {
+        CMdEObject* object = (CMdEObject*) query->TakeOwnershipOfResult(i);
+        CleanupStack::PushL(object);
+        AddItemL(*object, aMediaType);
+        CleanupStack::PopAndDestroy(object);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSearchList::SearchInToneL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::SearchInToneL( CRomFileList* aQuery,  const TDesC& aSearchText )
+    {
+    if ( !aQuery )
+        {
+        return;
+        }
+    TInt error = KErrNone;
+    TInt count = aQuery->Count( 0 );    
+    for( int i = 0; i< count; i++ )
+    	{
+        CSearchListItem* item = CSearchListItem::NewL();
+        error = aQuery->RomFileItem( item, i );
+        if ( error == KErrNone )
+        	{
+            TPtrC title = item->Title();
+            TInt rt = title.FindF( aSearchText );
+            if ( rt != KErrNotFound )
+            	{
+            	iList.Append( item );
+            	}
+        	}
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CSearchList::VideoSearchInRomL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::VideoSearchInRomL( CRomFileList* aQuery,  const TDesC& aSearchText )
+    {
+    if ( !aQuery )
+        {
+        return;
+        }
+    TInt error = KErrNone;
+    TInt count = aQuery->Count( 1 );    
+    for( int i = 0; i< count; i++ )
+        {
+        CSearchListItem* item = CSearchListItem::NewL();
+        error = aQuery->RomVedioItem( item, i );
+        if ( error == KErrNone )
+            {
+            TPtrC title = item->Title();
+            TInt rt = title.FindF( aSearchText );
+            if ( rt != KErrNotFound )
+                {
+                iList.Append( item );
+                }
+            }
+        }
+    }
+// -----------------------------------------------------------------------------
+// CSearchList::TakeArtistResultL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::TakeArtistResultL( CArtistQuery* aArtistQuery )
+    {
+    if ( !aArtistQuery )
+        {
+        return;
+        }
+    
+    CMdEObjectQuery* query = aArtistQuery->Query();
+    if ( !query )
+        {
+        return;
+        }
+    TInt queryType = aArtistQuery->QueryType();
+
+    
+    TInt count = query->Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        CMdEObject& object = query->Result( i );
+        AddArtistItemL( object, queryType, aArtistQuery->Album() );
+        }    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::TakeDistinctResultL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::TakeDistinctResultL( CMdEObjectQuery* aQuery, 
+                                       TInt /*aMediaType*/ )
+    {
+    if ( !aQuery )
+        {
+        return;
+        }
+
+    TInt count = aQuery->Count();
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        TPtrC ptr = aQuery->ResultDistinctValue( i );
+        
+        CSearchListItem* item = CSearchListItem::NewLC();
+         
+        item->SetTitleL( ptr, EFalse );
+        item->iMediaType = KErrNotFound;
+        item->iStorageType = KErrNotFound;
+
+        iList.AppendL( item );
+        
+        CleanupStack::Pop( item );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::AddItemL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::AddItemL( CMdEObject& aObject, TInt aMediaType )
+    {
+    CSearchListItem* item = CSearchListItem::NewLC();
+    
+    TPtrC songName = TextL( aObject, CMediaFileHandler::EAttrSongName );
+    
+    if ( songName.Length() > 0 )
+        {
+        item->SetTitleL( songName, EFalse );
+        }
+    else
+        {
+        item->SetTitleL( aObject.Uri(), ETrue );    
+        }
+    
+
+    item->iId = aObject.Id();
+    item->iMediaType = aMediaType;
+   
+    TInt storageType = CMediaFileHandler::EPhoneMemory;
+    if ( iDriveUtil->IsMemoryCard( aObject.Uri() ) )
+        {
+        storageType = CMediaFileHandler::EMemoryCard;
+        }
+    else if ( iDriveUtil->IsMassStorage( aObject.Uri() ) )
+        {
+        storageType = CMediaFileHandler::EMassStorage;
+        }
+    item->iStorageType = storageType;
+    
+    iList.AppendL( item );
+    
+    CleanupStack::Pop( item );
+    }
+
+// -----------------------------------------------------------------------------
+// CSearchList::AddRomItemL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::AddRomItemL( CRomFileList* aRomList, TInt aMediaType )
+    {
+    if ( !aRomList )
+        {
+        return;
+        }
+    
+    TInt count =0;
+    TInt error = KErrNone;
+    if ( aMediaType == CMediaFileHandler::EMediaTypeTone )
+        {
+        count = aRomList->Count( 0 );
+        for ( TInt i=0; i< count; i++ )
+            {
+            CSearchListItem* item = CSearchListItem::NewL();
+            error = aRomList->RomFileItem( item, i );
+            if ( error == KErrNone )
+                {
+                iList.AppendL( item );
+                }
+            }
+        }
+    else if ( aMediaType == CMediaFileHandler::EMediaTypeVideo )
+        {
+        count = aRomList->Count( 1 );
+        for (TInt i = 0; i < count; i++)
+            {
+            CSearchListItem* item = CSearchListItem::NewL();
+            error = aRomList->RomVedioItem(item, i);
+            if (error == KErrNone)
+                {
+                iList.AppendL(item);
+                }
+            }
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSearchList::AddAlbumItemL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::AddAlbumItemL( const TDesC& aAlbum )
+    {
+    TLinearOrder<CSearchListItem> sortFunction( CSearchList::Compare );
+       
+    CSearchListItem* item = CSearchListItem::NewLC();
+   
+    item->SetTitleL( aAlbum, EFalse );
+    
+    CleanupStack::Pop( item );
+    
+    item->iMediaType = KErrNotFound;
+    item->iStorageType = KErrNotFound;
+    item->iId = KErrNotFound;
+
+    TInt err = iList.InsertInOrder( item, sortFunction );
+    if ( err != KErrNone )
+        {
+        delete item;
+        }
+    if ( err != KErrNone && err != KErrAlreadyExists )
+        {
+        User::Leave( err );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::AddArtistItemL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::AddArtistItemL( CMdEObject& aObject, 
+                                  TInt aQueryType, const TDesC& aAlbum )
+    {
+    // all songs for one artist
+    if ( aQueryType == CMediaFileHandler::EQueryArtistAll )
+        {
+        AddItemL( aObject, CMediaFileHandler::EMediaTypeMusic );
+        return;
+        }
+
+    TPtrC album = TextL( aObject, CMediaFileHandler::EAttrAlbum );
+
+    // unknown songs (no album metadata) for one artist 
+    if ( aQueryType == CMediaFileHandler::EQueryArtistUnknown )
+        {
+        if ( album.Length() == 0 )
+            {
+            AddItemL( aObject, CMediaFileHandler::EMediaTypeMusic );
+            }
+        }
+
+    // all albums for one artist
+    if ( aQueryType == CMediaFileHandler::EQueryArtist )
+        {
+        if ( album.Length() > 0 )
+            {
+            AddAlbumItemL( album );
+            }
+        }
+
+    // songs in one album
+    if ( aQueryType == CMediaFileHandler::EQueryArtistAlbum )
+        {
+        if ( album.Length() > 0 )
+            {
+            if ( album.Compare( aAlbum ) == 0 )
+                {
+                AddItemL( aObject, CMediaFileHandler::EMediaTypeMusic );
+                }
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::Sort
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::Sort()
+    {
+    iList.Sort( TLinearOrder<CSearchListItem>(CSearchList::Compare) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::Reset
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::Reset()
+    {
+    iSearchId = KErrNotFound;
+    iList.ResetAndDestroy();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::Count
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::Count()
+    {
+    return iList.Count();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::GetAttributeL
+// 
+// -----------------------------------------------------------------------------
+//
+void CSearchList::GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue )
+    {
+    aValue = KNullDesC;
+    
+    if ( !iSession )
+        {
+        return;
+        }
+
+    if ( aIndex == KErrNotFound )
+        {
+        return;
+        }
+
+    TInt count = iList.Count();
+    if ( aIndex < 0 || aIndex >= count )
+        {
+        return;
+        }
+   
+    if ( aAttr == CMediaFileHandler::EAttrFullName )
+        {
+        CSearchListItem* item = iList[aIndex];
+        if ( item->iStorageType == CMediaFileHandler::ERomStorage )
+            {
+            if ( item->iMediaType == CMediaFileHandler::EMediaTypeTone )
+                {
+                TPtrC name = iRomFileList->Item( item->iId , 0 );
+                TMFDialogUtil::StrCopy( aValue, name );
+                }
+            
+            if ( item->iMediaType == CMediaFileHandler::EMediaTypeVideo )
+                {
+                TPtrC name = iRomFileList->Item( item->iId , 1 );
+                TMFDialogUtil::StrCopy( aValue, name );
+                }            
+            }
+        else
+        	{
+            CMdEObject* object = iSession->GetFullObjectL( item->iId );
+            CleanupStack::PushL( object );
+            TMFDialogUtil::StrCopy( aValue, object->Uri() );
+            CleanupStack::PopAndDestroy( object );
+        	}
+        }
+    
+    else if ( aAttr == CMediaFileHandler::EAttrSongName ||
+              aAttr == CMediaFileHandler::EAttrFileName )
+        {
+        CSearchListItem* item = iList[aIndex];
+        TMFDialogUtil::StrCopy( aValue, item->Title() );
+        if ( aValue.Length() == 0 )
+            {
+            if ( item->iStorageType == CMediaFileHandler::ERomStorage )
+                {
+                if ( item->iMediaType == CMediaFileHandler::EMediaTypeTone )
+                    {
+                    TPtrC name = iRomFileList->Item( aIndex,0 );
+                    TMFDialogUtil::StrCopy( aValue, name );
+                    }
+                
+                if ( item->iMediaType == CMediaFileHandler::EMediaTypeVideo )
+                    {
+                    TPtrC name = iRomFileList->Item( aIndex,1 );
+                    TMFDialogUtil::StrCopy( aValue, name );
+                    }
+                }
+            else
+            	{
+                CMdEObject* object = iSession->GetFullObjectL( item->iId );
+                CleanupStack::PushL( object );
+                TParsePtrC parse( object->Uri() );
+                TMFDialogUtil::StrCopy( aValue, parse.Name() );
+                CleanupStack::PopAndDestroy( object );
+            	}
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::Attribute
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::Attribute( TInt aIndex, TInt aAttr )
+    {
+    if ( aIndex == KErrNotFound )
+        {
+        return KErrNotFound;
+        }
+
+    TInt count = iList.Count();   
+    if ( aIndex < 0 || aIndex >= count )
+        {
+        return KErrNotFound;
+        }
+    
+    
+    TInt ret = KErrNotFound;
+    if ( aAttr == CMediaFileHandler::EAttrMediaType )
+        {
+        CSearchListItem* item = iList[aIndex];
+        ret = item->iMediaType;
+        }
+    
+    else if ( aAttr == CMediaFileHandler::EAttrStorageType )
+        {
+        CSearchListItem* item = iList[aIndex];
+        ret = item->iStorageType;
+        }
+    else if ( aAttr == CMediaFileHandler::EAttrMediaFileId )
+        {
+        CSearchListItem* item = iList[aIndex];
+        ret = item->iId;
+        }
+
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::Compare
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::Compare( const CSearchListItem& aFirst, 
+                           const CSearchListItem& aSecond )
+    {
+    TPtrC first = aFirst.Title();
+    TPtrC second = aSecond.Title();
+    
+    return first.Compare( second );    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::Panic
+//
+// -----------------------------------------------------------------------------
+//
+void CSearchList::Panic( TInt aReason ) 
+    {
+    TMFDialogUtil::Panic( aReason );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::TextL
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CSearchList::TextL( CMdEObject& aObject, TInt aId )
+    {
+    CMdEPropertyDef& propDef = 
+    CMediaFileHandler::PropertyDefL( iSession, aId );
+    
+    CMdEProperty* property = NULL;
+    TInt err = aObject.Property( propDef, property, 0 );
+    
+    if ( err != KErrNotFound && property )
+        {
+        return property->TextValueL();
+        }
+    
+    return KNullDesC;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::ItemIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::ItemIndex( TInt aId )
+    {
+    TInt count = iList.Count();
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        CSearchListItem* item = iList[i];
+        if ( item->iId == aId )
+            {
+            return i;
+            }
+        }
+        
+    return KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::ItemIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::ItemIndex( const TDesC& aText )
+    {
+    TInt count = iList.Count();
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        CSearchListItem* item = iList[i];
+        if ( aText.CompareF( item->Title() ) == 0 )
+            {
+            return i;
+            }
+        }
+    
+    
+
+    return KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::ItemIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::ItemIndex( TInt aId, TInt aIndex )
+    {
+    TInt count = iList.Count();
+    if ( aIndex >= 0 && aIndex < count )
+        {
+        CSearchListItem* item = iList[aIndex];
+        if ( item->iId == aId )
+            {
+            return aIndex;
+            }
+        }
+    
+    return ItemIndex( aId );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSearchList::ItemIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CSearchList::ItemIndex( const TDesC& aText, TInt aIndex )
+    {
+    TInt count = iList.Count();
+    if ( aIndex >= 0 && aIndex < count )
+        {
+        CSearchListItem* item = iList[aIndex];
+        if ( aText.CompareF( item->Title() ) == 0 )
+            {
+            return aIndex;
+            }
+        }
+
+    return ItemIndex( aText );
+    }
+
+
+/******************************************************************************
+ * class CArtistQuery
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CArtistQuery* CArtistQuery::NewL()
+    {
+    CArtistQuery* self = new (ELeave) CArtistQuery();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CArtistQuery::~CArtistQuery()
+    {
+    delete iArtist;
+    delete iAlbum;
+    delete iQuery;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::CArtistQuery
+// 
+// -----------------------------------------------------------------------------
+//
+CArtistQuery::CArtistQuery()
+    {
+    iQueryType = KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CArtistQuery::ConstructL()
+    {
+    iArtist = HBufC::NewL( 0 );
+    iAlbum = HBufC::NewL( 0 );
+    }
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::SetQueryType
+// 
+// -----------------------------------------------------------------------------
+//
+void CArtistQuery::SetQueryType( TInt aType )
+    {
+    iQueryType = aType;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::QueryType
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CArtistQuery::QueryType()
+    {
+    return iQueryType;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::SetQuery
+// 
+// -----------------------------------------------------------------------------
+//
+void CArtistQuery::SetQuery( CMdEObjectQuery* aQuery )
+    {
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = aQuery;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::Query
+// 
+// -----------------------------------------------------------------------------
+//
+CMdEObjectQuery* CArtistQuery::Query()
+    {
+    return iQuery;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::Artist
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CArtistQuery::Artist()
+    {
+    return *iArtist;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::Album
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CArtistQuery::Album()
+    {
+    return *iAlbum;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::SetAlbumL
+// 
+// -----------------------------------------------------------------------------
+//
+void CArtistQuery::SetAlbumL( const TDesC& aText )
+    {
+    delete iAlbum;
+    iAlbum = NULL;
+    iAlbum = aText.AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::SetArtistL
+// 
+// -----------------------------------------------------------------------------
+//
+void CArtistQuery::SetArtistL( const TDesC& aText )
+    {
+    delete iArtist;
+    iArtist = NULL;
+    iArtist = aText.AllocL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CArtistQuery::ResetL
+// 
+// -----------------------------------------------------------------------------
+//
+void CArtistQuery::ResetL()
+    {
+    iQueryType = KErrNotFound;
+    
+    delete iArtist;
+    iArtist = NULL;
+
+    delete iAlbum;
+    iAlbum = NULL;
+    
+    delete iQuery;
+    iQuery = NULL;
+    
+    iArtist = HBufC::NewL( 0 );
+    iAlbum = HBufC::NewL( 0 );
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafilelist.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Interface of MediaFileList. Provide some API for 
+*                the user to use mediafilelist
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "mediafilelist.h"
+#include "mediafiledialog.h"
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMediaFileList* CMediaFileList::NewL()
+    {
+    CMediaFileList* self = new (ELeave) CMediaFileList();
+    CleanupStack::PushL( self );
+	self->ConstructL();
+    CleanupStack::Pop( self );
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CMediaFileList::~CMediaFileList()
+    {
+    delete iDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileList::ConstructL()
+    {
+    iDialog = CMediaFileDialog::NewL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::CMediaFileList
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CMediaFileList::CMediaFileList()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::ShowCMediaFileListL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CMediaFileList::ShowMediaFileListL( TDes* aFileName, 
+                                                   TInt* aNullItem,
+                                                   TInt* aInfo,
+                                                   TDes* aDesInfo )
+    {
+    TInt err = KErrNone;
+    TInt ret = EFalse;
+    TRAP( err, ret = iDialog->ShowDialogL( aFileName, aNullItem, aInfo, aDesInfo ) );
+    
+    iDialog = NULL;
+    
+    User::LeaveIfError( err );
+    
+    if ( !ret )
+        {
+    	  return EFalse;
+    	  }
+    
+    if ( aFileName->Length() == 0 )
+        {
+        return EFalse;
+        }
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::SetAttrL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMediaFileList::SetAttrL( TInt aAttr, TInt aValue )
+    {
+    if ( iDialog )
+        {
+        iDialog->SetAttrL( aAttr, aValue );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::SetAttrL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMediaFileList::SetAttrL( TInt aAttr, const TDesC& aValue )
+    {
+    if ( iDialog )
+        {
+        iDialog->SetAttrL( aAttr, aValue );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::SetAttrL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMediaFileList::SetAttrL( TInt aAttr, TAny* aValue )
+    {
+    if ( iDialog )
+        {
+        iDialog->SetAttrL( aAttr, aValue );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileList::SetNullItemL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMediaFileList::SetNullItemL( const TDesC& aText, 
+                                            const TDesC& aMediaFile,
+	                                        TInt aMediaFileType, TInt aIconId )
+    {
+    if ( iDialog )
+        {
+        iDialog->SetNullItemL( aText, aMediaFile, aMediaFileType, aIconId );
+        }
+    }
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafilelist.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,725 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     This file contains all the resources for the MediaFileList module.
+*
+*/
+
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    MFLI // 4 letter ID
+
+//  INCLUDES
+
+#include <eikon.rh>
+#include <mediafilelist.loc>
+#include <drmcommon.loc>
+
+// common avkon strings
+#include <avkon.loc>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <AvkonIcons.hrh>
+
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+
+RESOURCE TBUF r_qtn_media_file_dialog_title
+    {
+    buf = qtn_tsl_title;
+    }
+RESOURCE TBUF r_qtn_info_file_format_error
+    {
+    buf = qtn_tsl_file_format_error;
+    }
+RESOURCE TBUF r_qtn_info_clip_format_error
+    {
+    buf = qtn_mp_note_invalid_clip;
+    }
+RESOURCE TBUF r_qtn_info_file_size_error
+    {
+    buf = qtn_profiles_tone_maxsize_error;
+    }
+RESOURCE TBUF r_qtn_info_drm_protected
+    {
+    buf = qtn_profiles_info_tone_drm_protected;
+    }
+RESOURCE TBUF r_qtn_info_no_drm
+    {
+    // from avkon.loc
+    buf = qtn_profiles_info_tone_no_drm;
+    }
+RESOURCE TBUF r_qtn_info_drm_prev_rights_use
+    {
+    // from drmcommon.loc
+    buf = qtn_drm_prev_rights_use;
+    }
+RESOURCE TBUF r_qtn_info_drm_prev_rights_set
+    {
+    // from drmcommon.loc
+    buf = qtn_drm_prev_rights_set;
+    }
+RESOURCE TBUF r_qtn_info_text_not_allowed
+	{
+	// from avkon.loc
+	buf = text_not_allowed;
+	}
+
+    
+RESOURCE TBUF r_qtn_wait_note_open
+    {
+    buf = qtn_tsl_wait_note_opening;
+    }
+RESOURCE TBUF r_qtn_wait_note_search
+    {
+    buf = qtn_tsl_wait_note_searching;
+    }
+RESOURCE TBUF r_qtn_wait_note_update
+    {
+    buf = qtn_tsl_wait_note_updating;
+    }
+
+
+RESOURCE TBUF r_qtn_folder_download
+    {
+    buf = qtn_tsl_download_tones;
+    }
+RESOURCE TBUF r_qtn_folder_tones
+    {
+    buf = qtn_tsl_tones_folder;
+    }
+RESOURCE TBUF r_qtn_folder_music
+    {
+    buf = qtn_tsl_music_folder;
+    }
+RESOURCE TBUF r_qtn_folder_videos
+    {
+    buf = qtn_tsl_videos_folder;
+    }
+RESOURCE TBUF r_qtn_folder_recordings
+    {
+    buf = qtn_tsl_recordings_folder;
+    }
+RESOURCE TBUF r_qtn_folder_default_tone
+    {
+    buf = qtn_tsl_according_to_profile;
+    }
+RESOURCE TBUF r_qtn_folder_off
+    {
+    buf = qtn_tsl_off;
+    }
+RESOURCE TBUF r_qtn_folder_all_music
+    {
+    buf = qtn_tsl_all_music_folder;
+    }
+RESOURCE TBUF r_qtn_folder_artist
+    {
+    buf = qtn_tsl_artists_folder;
+    }
+RESOURCE TBUF r_qtn_folder_album
+    {
+    buf = qtn_tsl_albums_folder;
+    }
+RESOURCE TBUF r_qtn_folder_genre
+    {
+    buf = qtn_tsl_genres_folder;
+    }
+RESOURCE TBUF r_qtn_folder_composer
+    {
+    buf = qtn_tsl_composers_folder;
+    }
+RESOURCE TBUF r_qtn_folder_artist_all
+    {
+    buf = qtn_tsl_all;
+    }
+
+RESOURCE TBUF r_qtn_unknown_artist
+    {
+    buf = qtn_tsl_unknown_artist;
+    }
+RESOURCE TBUF r_qtn_unknown_album
+    {
+    buf = qtn_tsl_unknown_album;
+    }
+RESOURCE TBUF r_qtn_unknown_genre
+    {
+    buf = qtn_tsl_unknown_genre;
+    }
+RESOURCE TBUF r_qtn_unknown_composer
+    {
+    buf = qtn_tsl_unknown_composer;
+    }
+
+RESOURCE TBUF r_qtn_preview_popup_artist
+    {
+    buf = qtn_tsl_preview_popup_artist;
+    }
+RESOURCE TBUF r_qtn_preview_popup_album
+    {
+    buf = qtn_tsl_preview_popup_album;
+    }
+RESOURCE TBUF r_qtn_preview_popup_genre
+    {
+    buf = qtn_tsl_preview_popup_genre;
+    }
+RESOURCE TBUF r_qtn_preview_popup_composer
+    {
+    buf = qtn_tsl_preview_popup_composer;
+    }
+
+
+RESOURCE TBUF r_qtn_view_tones
+    {
+    buf = qtn_tsl_tones_view;
+    }
+RESOURCE TBUF r_qtn_view_music
+    {
+    buf = qtn_tsl_music_view;
+    }
+RESOURCE TBUF r_qtn_view_videos
+    {
+    buf = qtn_tsl_videos_view;
+    }
+RESOURCE TBUF r_qtn_view_recordings
+    {
+    buf = qtn_tsl_recordings_view;
+    }
+RESOURCE TBUF r_qtn_view_search
+    {
+    buf = qtn_tsl_find_results;
+    }
+RESOURCE TBUF r_qtn_view_artist
+    {
+    buf = qtn_tsl_artists_view;
+    }
+RESOURCE TBUF r_qtn_view_album
+    {
+    buf = qtn_tsl_albums_view;
+    }
+RESOURCE TBUF r_qtn_view_genre
+    {
+    buf = qtn_tsl_genres_view;
+    }
+RESOURCE TBUF r_qtn_view_composer
+    {
+    buf = qtn_tsl_composers_view;
+    }
+
+
+//------------------------------------------------------------------------------
+// number query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_number_query
+    {
+    flags = EAknGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+
+            control = AVKON_DATA_QUERY
+                { 
+                layout = ENumberLayout;
+                control = AVKON_INTEGER_EDWIN
+                    {
+                    min=0;
+                    max=999999;
+                    };
+                };
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// information query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_information_query
+    {
+    flags=EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+// list query resource.
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_list_query
+    {
+    flags=EEikDialogFlagWait | EGeneralQueryFlags;
+
+    buttons=R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT;
+
+    items=
+        {
+        AVKON_LIST_QUERY_DLG_LINE
+            {
+            control = AVKON_LIST_QUERY_CONTROL
+                {
+                listtype = EAknCtSinglePopupMenuListBox;
+                heading = qtn_profile_dialog_title;
+                
+                listbox = AVKON_LIST_QUERY_LIST
+                    {
+                    // items added dynamically
+                    };
+                };
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+// video preview dialog resource
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_video_preview_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    buttons = r_video_preview_dialog_cba;
+
+    items=
+        {
+        };
+    }
+
+
+RESOURCE CBA r_video_preview_dialog_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = text_softkey_select;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = qtn_msk_select;
+            }
+        };
+    }
+
+
+RESOURCE MENU_BAR r_video_preview_dialog_menu
+    {
+    titles= 
+        { 
+        MENU_TITLE 
+            { 
+            menu_pane=r_video_preview_dialog_menu_pane;
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_video_preview_dialog_menu_pane
+    {
+    items=
+        {
+        MENU_ITEM { command=EAknSoftkeySelect; txt=text_softkey_select; },      
+        MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+        MENU_ITEM { command=EAknCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+// media file dialog resource.
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_media_file_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc | EEikDialogFlagNoBackup;
+    //buttons = r_media_file_dialog_cba_select_select_back;
+    buttons = R_AVKON_SOFTKEYS_SELECT_BACK__SELECT;    
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSingleGraphicListBox;
+            itemflags=EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+			id=1;
+			control=LISTBOX
+				{
+				flags = EAknListBoxSelectionList;
+				};   
+            },
+        DLG_LINE
+            {
+            itemflags = EEikDlgItemNonFocusing;
+            id = EFindControl;
+            type = EAknCtSelectionListFixedFind;
+            //type = EAknCtSelectionListPopupFind;
+            }
+		};
+    }
+
+RESOURCE MENU_BAR r_media_file_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_media_file_dialog_menu_pane;
+			}
+		};
+	}
+
+RESOURCE MENU_PANE r_media_file_dialog_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAknCmdOpen; txt=qtn_options_open; },
+		MENU_ITEM { command=EAknSoftkeySelect; txt=text_softkey_select; },		
+        MENU_ITEM { command=EAknSoftkeyView; txt=Preview; },
+	    MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+		MENU_ITEM { command=EAknCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+
+RESOURCE MENU_BAR r_media_file_dialog_context_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_media_file_dialog_context_menu_pane;
+			}
+		};
+	}
+
+RESOURCE MENU_PANE r_media_file_dialog_context_menu_pane
+	{
+	items =
+		{
+		MENU_ITEM { command=EAknSoftkeySelect; txt=text_softkey_select; },		
+		MENU_ITEM { command=EAknSoftkeyView; txt=Preview; }
+		};
+	}
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_media_file_dialog_cba_open_open_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOpen;
+            txt = text_softkey_open;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOpen;
+            txt = qtn_msk_open;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//
+// Needed because R_AVKON_SOFTKEYS_SELECT_BACK__SELECT gives wrong
+// button id when Back is pressed (EEikBidCancel).
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_media_file_dialog_cba_select_select_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = text_softkey_select;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = qtn_msk_select;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_media_file_dialog_cba_preview_select_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyView;
+            txt = text_softkey_preview;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = text_softkey_select;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+/*
+RESOURCE CBA r_media_file_dialog_cba_preview_preview_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyView;
+            txt = text_softkey_preview;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyView;
+            txt = text_softkey_preview;
+            }
+        };
+    }
+*/
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+/*
+RESOURCE CBA r_media_file_dialog_cba_options_select_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = qtn_msk_select;
+            }
+        };
+    }
+*/
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+/*
+RESOURCE CBA r_media_file_dialog_cba_options_open_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOpen;
+            txt = qtn_msk_open;
+            }
+        };
+    }
+*/
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+/*
+RESOURCE CBA r_media_file_dialog_cba_options_search_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySearch;
+            txt = text_softkey_search;
+            }
+        };
+    }
+*/
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+/*
+RESOURCE CBA r_media_file_dialog_cba_options_context_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyContextOptions;
+            txt = text_softkey_option;
+            }
+        };
+    }
+*/
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+/*
+RESOURCE CBA r_media_file_dialog_cba_empty_empty_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = text_softkey_empty;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = text_softkey_empty;
+            }
+        };
+    }
+*/
+
+//------------------------------------------------------------------------------
+// wait note resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_media_file_wait_note
+	{ 
+	flags=EAknProgressNoteFlags | EEikDialogFlagNotifyEsc;
+	buttons=R_AVKON_SOFTKEYS_CANCEL;
+	items= 
+		{
+		DLG_LINE
+			{
+			type=EAknCtNote;
+			id=EGeneralNote;
+			control=AVKON_NOTE 
+				{
+        animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+				layout=EProgressLayout;
+
+        imagefile = AVKON_BITMAP_FILE;
+        imageid = EMbmAvkonQgn_note_progress;
+        imagemask = EMbmAvkonQgn_note_progress_mask;
+				
+				singular_label = qtn_gen_note_opening;
+				};
+			}
+		};
+	} 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafilepreview.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1539 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class for preview audio and video
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "mediafilepreview.h"
+#include "mediafiledialogutils.h"
+#include "mediafilelist.h"
+#include "mediafilelistdebug.h"
+
+#include <ScreensaverInternalPSKeys.h>   // KPSUidScreenSaver
+#include <AudioPreference.h>             // KAudioPriorityPreview
+#include <c3dringingtoneinterface.h>     // C3DRingingToneInterface
+
+#include <ctsydomainpskeys.h>            // for phone call states
+
+// for reading active profile settings
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileTones.h>
+#include "TProfileToneSettings.h"
+#include <MProfileExtraSettings.h>
+#include <MProfile3DToneSettings.h>
+#include <ProfileInternal.hrh>
+#include <ProfileEngineDomainCRKeys.h>   // KProEngDefaultRingingTone
+
+
+/******************************************************************************
+ * class CMFPreviewHandlerBase
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::CMFPreviewHandlerBase
+// 
+// -----------------------------------------------------------------------------
+//
+CMFPreviewHandlerBase::CMFPreviewHandlerBase()
+	{
+    iMediaType = KErrNotFound;
+    iRingingVolume = KErrNotFound;
+    iRingingType = KErrNotFound;
+    iVibra = KErrNotFound;
+    i3DEffect = KErrNotFound;
+    i3DEcho = KErrNotFound;
+    iFileSize = KErrNotFound;
+	
+	iFullName = NULL;
+	
+	iActiveProfileRead = EFalse;
+	iPlayerStatus = EPlayerNotCreated;
+	
+    iObserver = NULL;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::CMFPreviewHandlerBase
+//
+// -----------------------------------------------------------------------------
+//
+void CMFPreviewHandlerBase::ConstructL()
+    {
+   	// To allow/not allow screensaver
+   	// Errors ignored, no actions needed if API is not available
+    iProperty.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver );
+    
+    User::LeaveIfError( iApaSession.Connect() );
+    
+    TRAP_IGNORE( ReadDefaultToneL() );
+    // To keep backlight on while a video is being previewed
+    iBacklightTimer = CPeriodic::NewL( EPriorityLow );
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMFPreviewHandlerBase::~CMFPreviewHandlerBase()
+    {
+    delete iFullName;
+    iProperty.Close();
+    
+    iApaSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::SetAttr
+// 
+// -----------------------------------------------------------------------------
+void CMFPreviewHandlerBase::SetAttrL( TInt aAttr, TInt aValue )
+	{
+	switch ( aAttr )
+	    {
+	    case CMediaFileList::EAttrVolume:
+	        {
+	        iRingingVolume = aValue;
+	        break;
+	        }
+	    case CMediaFileList::EAttrRingingType:
+	        {
+	        iRingingType = aValue;
+	        break;
+	        }
+	    case CMediaFileList::EAttrVibra:
+	        {
+	        iVibra = aValue;
+	        break;
+	        }
+	    case CMediaFileList::EAttr3DEffect:
+	        {
+	        i3DEffect = aValue;
+	        break;
+	        }
+	    case CMediaFileList::EAttr3DEcho:
+	        {
+	        i3DEcho = aValue;
+	        break;
+	        }
+	    case CMediaFileList::EAttrFileSize:
+	        {
+	        iFileSize = aValue;
+	        break;
+	        }
+	    default:
+	        {
+	        break;
+	        }
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::Attr
+// 
+// -----------------------------------------------------------------------------
+TInt CMFPreviewHandlerBase::Attr( TInt aAttr )
+    {
+    TInt ret = KErrNotFound;
+    
+    switch ( aAttr )
+        {
+        case CMediaFileList::EAttrVolume:
+            {
+            ret = iRingingVolume;
+            break;
+            }
+        case CMediaFileList::EAttrRingingType:
+            {
+            ret = iRingingType;
+            break;
+            }
+        case CMediaFileList::EAttrVibra:
+            {
+            ret = iVibra;
+            break;
+            }
+        case CMediaFileList::EAttr3DEffect:
+            {
+            ret = i3DEffect;
+            break;
+            }
+        case CMediaFileList::EAttr3DEcho:
+            {
+            ret = i3DEcho;
+            break;
+            }
+        case CMediaFileList::EAttrFileSize:
+            {
+            ret = iFileSize;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+void CMFPreviewHandlerBase::SetAttrL( TInt aAttr, const TDesC& aValue )
+	{
+    if ( aAttr == TMFDialogUtil::EAttrFileName )
+	    {
+	    delete iFullName;
+	    iFullName = NULL;
+	    iFullName = aValue.AllocL();
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::SetAttr
+// 
+// -----------------------------------------------------------------------------
+//
+void CMFPreviewHandlerBase::SetAttrL( TInt aAttr, TAny* aValue )
+    {
+	if ( aAttr == TMFDialogUtil::EAttrDrawingWindow )
+	    {
+	    iWindow = static_cast<RWindow*>( aValue );
+	    }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::SetObserver
+// 
+// -----------------------------------------------------------------------------
+//
+void CMFPreviewHandlerBase::SetObserver( MPreviewHandlerObserver* aObserver )
+    {
+    iObserver = aObserver;
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::IsCallOngoing
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMFPreviewHandlerBase::IsCallOngoing()
+    {
+    TInt err = KErrNone;
+    TInt callState = EPSCTsyCallStateUninitialized; 
+
+    err = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
+    if ( err == KErrNone )
+        {
+        if( callState != EPSCTsyCallStateUninitialized && 
+            callState != EPSCTsyCallStateNone && 
+            callState != EPSCTsyCallStateDisconnecting ) 
+            {
+            // There was call ongoing
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::RingingVolume
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::RingingVolume()
+    {
+    const TInt KDefaultVolumeLevel = 7; // see profile.hrh for volume levels
+    
+    if ( iRingingVolume != KErrNotFound )
+        {
+        return iRingingVolume;
+        }
+        
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfileRingingVolume;
+        }
+
+    return KDefaultVolumeLevel;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::RingingType
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::RingingType()
+    {
+    if ( iRingingType != KErrNotFound )
+        {
+        return iRingingType;
+        }
+        
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfileRingingType;
+        }
+
+    return ERingingTypeRinging;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::Vibra
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::Vibra()
+    {
+    if ( iVibra != KErrNotFound )
+        {
+        return iVibra;
+        }
+        
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfileVibra;
+        }
+    
+    return 0;  // in case of error vibra is off
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::Echo3D
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::Echo3D()
+    {
+    if ( i3DEcho != KErrNotFound )
+        {
+        return i3DEcho;
+        }
+    
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfile3DEcho;
+        }
+
+    return EProfile3DEchoOff;  // from ProfileInternal.hrh
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::Effect3D
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::Effect3D()
+    {
+    if ( i3DEffect != KErrNotFound )
+        {
+        return i3DEffect;
+        }
+    
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfile3DEffect;
+        }
+
+    return EProfile3DEffectOff;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::ConvertVolume
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::ConvertVolume( TInt aVolume, TInt aMaxVolume )
+    {
+  	const TInt KMinVolumeLevel = 1;
+    const TInt KMaxVolumeLevel = 10;
+    	
+    TInt result = aMaxVolume * aVolume / KMaxVolumeLevel;
+    
+    // if user has selected minimum volume level set HW volume 1
+    if ( aVolume == KMinVolumeLevel && result == 0 )
+        {
+        result = 1;
+        }
+
+    return result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::ReadActiveProfileL
+// -----------------------------------------------------------------------------
+//    
+void CMFPreviewHandlerBase::ReadActiveProfileL()
+    {
+    iActiveProfileRead = EFalse;
+    
+    MProfileEngine* profileEngine = CreateProfileEngineL();
+    CleanupReleasePushL( *profileEngine );
+    
+    MProfile* activeProfile  = profileEngine->ActiveProfileL();
+    CleanupReleasePushL( *activeProfile );
+        
+    const MProfileTones& profileTones = activeProfile->ProfileTones();
+     
+    const TProfileToneSettings& toneSettings = profileTones.ToneSettings();
+    iActiveProfileVibra = toneSettings.iVibratingAlert;
+    iActiveProfileRingingVolume = toneSettings.iRingingVolume;
+    iActiveProfileRingingType = toneSettings.iRingingType;
+          
+    const MProfileExtraSettings& extra = activeProfile->ProfileExtraSettings();
+    const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings();
+    
+    iActiveProfile3DEffect = threeD.Effect();
+    iActiveProfile3DEcho = threeD.Echo();
+   
+    CleanupStack::PopAndDestroy( activeProfile ); 
+    CleanupStack::PopAndDestroy( profileEngine );
+    
+    iActiveProfileRead = ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::ReadDefaultToneL
+// -----------------------------------------------------------------------------
+//    
+void CMFPreviewHandlerBase::ReadDefaultToneL()
+    {
+    CRepository* cenrep = CRepository::NewLC( KCRUidProfileEngine );
+
+    User::LeaveIfError( cenrep->Get( KProEngDefaultRingingTone, iDefaultTone ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::EnableScreenSaver
+//
+// -----------------------------------------------------------------------------
+//
+void CMFPreviewHandlerBase::EnableScreenSaver( TBool aEnable )
+    {
+    if ( aEnable )
+        {
+   	    // allow screen saver, unless there's a call ongoing
+   	    if( !IsCallOngoing() )
+   		    {
+	        // ignore error, no actions needed if API is not available	   	
+	   	    iProperty.Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver,
+	   	                   EFLScreenSaverAllowed );
+   		    }
+        }
+    else
+        {
+   	    iProperty.Set( KPSUidScreenSaver,
+			       KScreenSaverAllowScreenSaver, EFLScreenSaverNotAllowed );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::GetDataType
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::GetDataType( const TDesC& aFileName, TDataType& aDataType )
+    {
+   	TUid dummyUid( KNullUid );
+	return iApaSession.AppForDocument( aFileName, dummyUid, aDataType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::Panic
+//
+// -----------------------------------------------------------------------------
+//
+void CMFPreviewHandlerBase::Panic( TInt aReason ) 
+    {
+	_LIT( KPanicCategory, "CMFPreviewHandlerBase" );
+	
+	User::Panic( KPanicCategory, aReason ); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::DoResetInactivityTimer()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CMFPreviewHandlerBase::DoResetInactivityTimer( TAny* /*aObject*/ )
+    {
+    User::ResetInactivityTime();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CMFPreviewHandlerBase::DisableBackLight()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CMFPreviewHandlerBase::DisableBackLight()
+	{
+		const TInt KResetInactivityTimerDelay = 2000000;
+    iBacklightTimer->Cancel(); // Just in case
+    // Disable backlight turn off during video preview
+    iBacklightTimer->Start( KResetInactivityTimerDelay,
+                            KResetInactivityTimerDelay,
+                            TCallBack( DoResetInactivityTimer, NULL ) );
+	
+	}
+
+
+/******************************************************************************
+ * class CMFVideoPreviewHandler
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::NewL
+//
+// -----------------------------------------------------------------------------
+CMFVideoPreviewHandler* CMFVideoPreviewHandler::NewL()
+    {
+    CMFVideoPreviewHandler* self = new (ELeave) CMFVideoPreviewHandler();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::CMFVideoPreviewHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CMFVideoPreviewHandler::CMFVideoPreviewHandler()
+	{
+	iPlayerStatus = EPlayerNotCreated;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::ConstructL()
+    {
+    CMFPreviewHandlerBase::ConstructL();
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMFVideoPreviewHandler::~CMFVideoPreviewHandler()
+    {
+    Cancel();
+    
+    if( iVolumeRampTimer )
+	    {
+    	delete iVolumeRampTimer;
+	    }
+	    
+	if( iVideoPlayer )
+		{
+		delete iVideoPlayer;
+    	}
+	
+	if ( iBacklightTimer )
+		{
+		delete iBacklightTimer;
+		iBacklightTimer = NULL;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::IsPlaying
+// 
+// -----------------------------------------------------------------------------
+TBool CMFVideoPreviewHandler::IsPlaying()
+    {
+    if ( iPlayerStatus == EPlayerNotCreated )
+        {
+        return EFalse;
+        }
+    
+    return ETrue;
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::SetDisplayWindowL
+// 
+// -----------------------------------------------------------------------------
+void CMFVideoPreviewHandler::SetDisplayWindowL()
+    {
+    if ( !iVideoPlayer )
+        {
+        return;
+        }
+    
+    if ( !iWindow )
+        {
+        return;  // no screen for showing video
+        }
+
+    // Screen and clip rectangles to window dimensions
+    TPoint wndPosition( iWindow->AbsPosition() );
+    TSize wndSize( iWindow->Size() );
+
+    TRect wndRect( wndPosition, wndSize );
+
+    iVideoPlayer->SetDisplayWindowL( CCoeEnv::Static()->WsSession(),
+                                     *(CCoeEnv::Static()->ScreenDevice()),
+                                     *iWindow,
+                                     wndRect,
+                                     wndRect );
+    }
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::PlayL
+// 
+// -----------------------------------------------------------------------------
+void CMFVideoPreviewHandler::PlayL()
+	{
+    Cancel(); // stop previous playing
+    
+    if ( !iFullName || iFullName->Des().Length() == 0 )
+        {
+        User::Leave( KErrNotFound );
+        }
+
+	if ( !iWindow )
+	    {
+	    return;  // no screen for showing video
+        }
+    
+	TRAP_IGNORE( ReadActiveProfileL() );
+	
+    // Screen and clip rectangles to window dimensions
+    TPoint wndPosition( iWindow->AbsPosition() );
+    TSize wndSize( iWindow->Size() );
+
+    // iY and iHeight should be even numbers
+	if( wndPosition.iY % 2 )
+		{
+		wndPosition.iY = wndPosition.iY + 1;
+		wndSize.iHeight = wndSize.iHeight - 1;
+		}
+	if( wndSize.iHeight % 2 )
+		{
+		wndSize.iHeight = wndSize.iHeight - 1;
+		}
+
+    TRect wndRect( wndPosition, wndSize );
+ 
+
+	// check video file
+	TDataType dataType;
+	TInt err = GetDataType( iFullName->Des(), dataType );
+    if ( err != KErrNone )
+        {
+        User::Leave( err );
+        }
+
+    TInt vibra = Vibra();
+    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;       		
+    if ( vibra )
+        {
+        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
+        }
+        
+	delete iVideoPlayer;
+	iVideoPlayer = NULL;
+
+    iVideoPlayer = CVideoPlayerUtility::NewL ( *this, KAudioPriorityPreview, pref,
+                                               CCoeEnv::Static()->WsSession(),
+		                                       *(CCoeEnv::Static()->ScreenDevice()),
+		                                       *iWindow,
+		                                       wndRect,
+		                                       wndRect );
+		
+    iVideoPlayer->OpenFileL( iFullName->Des() );
+
+	iPlayerStatus = EPlayerInitializing;
+	   	
+   	EnableScreenSaver( EFalse ); // do not allow screen saver while playing
+   	DisableBackLight();
+
+#ifdef _DEBUG
+    User::InfoPrint( iFullName->Des() );
+    FLOG( _L("CMFVideoPreviewHandler::PlayL  '%S'"), &iFullName->Des() );
+#endif
+
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::Stop
+// 
+// -----------------------------------------------------------------------------
+void CMFVideoPreviewHandler::Stop()
+	{
+	Cancel();
+	}
+
+    
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::Cancel
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::Cancel()
+    {
+   	TBool isPlaying = EFalse;
+   	
+    if( iVolumeRampTimer )
+	    {
+    	iVolumeRampTimer->Cancel();
+	    }
+	    
+	if( iVideoPlayer )
+		{
+		isPlaying = ETrue;
+		
+		if ( iPlayerStatus == EPlayerPlaying )
+		    {
+		    iVideoPlayer->Stop();    
+		    }
+		iVideoPlayer->Close();
+
+		delete iVideoPlayer;
+		iVideoPlayer = NULL;
+    	}
+
+   	if ( isPlaying )
+   	    {
+   	    User::InfoPrint( _L("cancel video") );
+
+   	    EnableScreenSaver( ETrue );
+   	    iBacklightTimer->Cancel(); 
+   	    }
+   	    
+   	iPlayerStatus = EPlayerNotCreated;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::SetRingingType
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::SetRingingType( TInt aRingingType )
+    {
+    const TInt KMinVolumeLevel = 1;
+   	const TInt KAscendingVolumeRampInterval = 3000000; // 3 seconds
+
+    if ( aRingingType == ERingingTypeAscending )
+        {
+        if ( !iVolumeRampTimer )
+            {
+            iVolumeRampTimer = CPeriodic::New( CActive::EPriorityStandard );
+            }
+
+        if ( iVolumeRampTimer && !iVolumeRampTimer->IsActive() )
+            {
+            TCallBack cb( VolumeRampTimerCallback, this );
+            iRampedVolume = KMinVolumeLevel;
+            iVolumeRampTimer->Start( KAscendingVolumeRampInterval, 
+                                     KAscendingVolumeRampInterval, cb );
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::ConvertVolume
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFVideoPreviewHandler::ConvertVolume( TInt aVolume )
+    {
+    if ( !iVideoPlayer )
+        {
+        return 0;
+        }
+    
+    TInt result = 0;
+    TBool audioEnabled = EFalse;
+
+	TRAP_IGNORE( audioEnabled = iVideoPlayer->AudioEnabledL() );
+
+	if ( audioEnabled )
+		{
+        result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iVideoPlayer->MaxVolume() );
+
+        // if user has selected silent ringing type or beeb once, set volume off
+     	TInt ringingType = RingingType();
+		if ( ringingType == ERingingTypeSilent || ringingType == ERingingTypeBeepOnce )
+			{
+			result = 0;
+			}
+		}
+
+    return result;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::VolumeRampTimerCallback
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFVideoPreviewHandler::VolumeRampTimerCallback( TAny* aObj )
+    {
+    return static_cast<CMFVideoPreviewHandler*>( aObj )->VolumeRamp();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::VolumeRamp
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFVideoPreviewHandler::VolumeRamp()
+    {
+	const TInt KPhoneVideoVolumeRampStep = 1;
+	    
+	TInt ringingVolume = RingingVolume();
+    if ( iRampedVolume < ringingVolume )
+        {
+        iRampedVolume = iRampedVolume + KPhoneVideoVolumeRampStep;
+        if ( iRampedVolume >= ringingVolume )
+            {
+            // target volume level reached
+            iRampedVolume = ringingVolume;
+            iVolumeRampTimer->Cancel();
+            }
+        }
+        
+    TRAP_IGNORE( iVideoPlayer->SetVolumeL( ConvertVolume( iRampedVolume ) ) );
+
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::MvpuoOpenComplete (from MVidePlayerUtilityObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::MvpuoOpenComplete( TInt aError )
+	{
+    __ASSERT_DEBUG( iPlayerStatus == EPlayerInitializing, Panic( KErrGeneral ) );
+    
+    if ( aError )
+        {
+        Cancel();
+        
+        if ( iObserver )
+            {
+            TInt event = MPreviewHandlerObserver::EPreviewError;
+            TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+            }
+        }
+	else
+	    {
+	    iVideoPlayer->Prepare();    
+	    }
+    }
+	
+	
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::MvpuoPrepareComplete (from MVidePlayerUtilityObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::MvpuoPrepareComplete( TInt aError )
+	{
+	const TInt KMinVolumeLevel = 1;
+	
+    __ASSERT_DEBUG( iPlayerStatus == EPlayerInitializing, Panic( KErrGeneral ) );
+    
+    if ( aError != KErrNone )
+        {
+        Cancel();
+
+        if ( iObserver )
+            {
+            TInt event = MPreviewHandlerObserver::EPreviewError;
+            TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+            }
+        return;
+        }
+    	
+    iPlayerStatus = EPlayerInitialized;
+    
+    TInt ringingType = RingingType();
+    TInt ringingVolume = RingingVolume();
+    TInt vibra = Vibra();
+
+    
+    SetRingingType( ringingType );
+
+    TInt startVolume = KMinVolumeLevel;
+	if ( ringingType != ERingingTypeAscending )
+		{
+		startVolume = ConvertVolume( ringingVolume );
+		}
+	else
+		{
+		// Ascending starts from minimum volume level
+		startVolume = ConvertVolume( KMinVolumeLevel );
+		}			
+    TRAP_IGNORE( iVideoPlayer->SetVolumeL( startVolume ) );
+    
+    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;       		
+    if ( vibra )
+        {
+        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
+        }
+
+	// Unfortunately SetPriorityL uses always priority/preference
+	// settings which are given in videoPlayer constructor and ONLY
+	// after that sets SetPriorityL parameter to its member data
+	// which leads to a situation that we need to make SetPriorityL
+	// call twice to make new settings effect.
+    TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview, pref ) );
+    TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview, pref ) );
+                                             
+ 	iVideoPlayer->Play();
+	iPlayerStatus = EPlayerPlaying;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::MvpuoPlayComplete (from MVidePlayerUtilityObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::MvpuoPlayComplete( TInt aError )
+	{
+    __ASSERT_DEBUG( iPlayerStatus == EPlayerPlaying, Panic( KErrGeneral ) );
+    
+    if ( aError != KErrNone )
+        {
+        Cancel();
+        
+        if ( iObserver )
+            {
+            TInt event = MPreviewHandlerObserver::EVideoPreviewComplete;
+            TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+            }
+        return;
+        }
+	
+	TInt ringingType = RingingType();
+    if( ringingType != ERingingTypeRingOnce )
+		{
+		iVideoPlayer->Play();
+		}
+	else
+		{
+		Cancel();
+        if ( iObserver )
+            {
+            TInt event = MPreviewHandlerObserver::EVideoPreviewComplete;
+            TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+            }
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::MvpuoFrameReady (from MVidePlayerUtilityObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::MvpuoFrameReady( CFbsBitmap& /*aFrame*/,TInt /*aError*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::MvpuoEvent (from MVidePlayerUtilityObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFVideoPreviewHandler::MvpuoEvent( const TMMFEvent& /*aEvent*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFVideoPreviewHandler::GetRectData
+// 
+// -----------------------------------------------------------------------------
+void CMFVideoPreviewHandler::GetRectData( TRect aRect, TDes& aText )
+    {
+    _LIT( KFormat, "top left (%d,%d)  bottom right (%d,%d)" );
+    
+    TPoint p1 = aRect.iTl;
+    TPoint p2 = aRect.iBr;
+    
+    aText.Format( KFormat, p1.iX, p1.iY, p2.iX, p2.iY );
+    }
+
+
+
+
+/******************************************************************************
+ * class CMFAudioPreviewHandler
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::NewL
+//
+// -----------------------------------------------------------------------------
+CMFAudioPreviewHandler* CMFAudioPreviewHandler::NewL()
+    {
+    CMFAudioPreviewHandler* self = new (ELeave) CMFAudioPreviewHandler();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::CMFAudioPreviewHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CMFAudioPreviewHandler::CMFAudioPreviewHandler()
+	{
+	iAudioPlayerStatus = EPlayerNotCreated;
+	iTonePlayerStatus = EPlayerNotCreated;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::CMFAudioPreviewHandler
+//
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::ConstructL()
+    {
+    CMFPreviewHandlerBase::ConstructL();
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMFAudioPreviewHandler::~CMFAudioPreviewHandler()
+    {
+    Cancel();
+    
+    delete iAudioPlayer;
+    delete iTonePlayer;
+    delete i3dRingingTonePlugin;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::IsPlaying
+// 
+// -----------------------------------------------------------------------------
+TBool CMFAudioPreviewHandler::IsPlaying()
+    {
+    if ( iAudioPlayerStatus != EPlayerNotCreated )
+        {
+        return ETrue;
+        }
+    
+    if ( iTonePlayerStatus != EPlayerNotCreated )
+        {
+        return ETrue;
+        }
+
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::PlayL
+// 
+// -----------------------------------------------------------------------------
+void CMFAudioPreviewHandler::PlayL()
+	{
+	//sequence for playing a beep once sound
+	_LIT8( KFileListBeepSequence, "\x00\x11\x06\x0A\x08\x73\x0A\x40\x28\x0A\xF7\
+	\x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B" ); 
+
+	// rng mime type
+	_LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" );
+	
+	Cancel(); // stop previous play
+	
+    if ( !iFullName || iFullName->Des().Length() == 0 )
+        {
+        User::Leave( KErrNotFound );
+        }
+
+	TRAP_IGNORE( ReadActiveProfileL() );
+
+	TPtrC fileName( iFullName->Des() );
+	TDataType dataType;
+	TInt err = GetDataType( fileName, dataType );
+    if ( err == KErrNotFound )
+        {
+        fileName.Set( iDefaultTone );
+        if ( fileName.Length() == 0 )
+             {
+             User::Leave( KErrNotFound );
+             }
+        }
+    else if ( err != KErrNone )
+        {
+        User::Leave( err );
+        }
+ 	    
+    TBool mimeTypeRng = EFalse;
+    
+    if ( err == KErrNone )
+        {
+        if( dataType.Des().CompareF( KFileListRngMimeType ) == 0 )
+            {
+            mimeTypeRng = ETrue;
+            }
+        }
+
+	TInt ringingType = RingingType();
+	if ( ringingType == ERingingTypeBeepOnce )
+		{
+		// Active profile ringing tone is set to Beep Once
+		// Don't initialize a FileSequence but use DesSequence instead
+ 		iTonePlayer = CMdaAudioToneUtility::NewL( *this );
+		iTonePlayer->PrepareToPlayDesSequence( KFileListBeepSequence() );
+		iTonePlayerStatus = EPlayerInitializing;
+		}
+    else
+		{
+        if( mimeTypeRng )
+            {
+            //Ringingtone is a RNG-file
+            iTonePlayer = CMdaAudioToneUtility::NewL( *this );
+            iTonePlayer->PrepareToPlayFileSequence( fileName );
+            iTonePlayerStatus = EPlayerInitializing;
+            }
+        else
+            {
+            delete iAudioPlayer;
+            iAudioPlayer = NULL;
+
+            iAudioPlayer = CDrmPlayerUtility::NewFilePlayerL(
+             	fileName, *this, KAudioPriorityRingingTonePreview,
+             	( TMdaPriorityPreference )KAudioPrefRingFilePreview );
+	
+            iAudioPlayerStatus = EPlayerInitializing;
+            }
+		}
+		
+    EnableScreenSaver( EFalse );
+    DisableBackLight();
+	
+#ifdef _DEBUG
+    User::InfoPrint( iFullName->Des() );
+    FLOG( _L("CMFAudioPreviewHandler::PlayL  '%S'"), &iFullName->Des() );
+#endif
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::Stop
+// 
+// -----------------------------------------------------------------------------
+void CMFAudioPreviewHandler::Stop()
+	{
+	Cancel();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::ConvertVolume
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFAudioPreviewHandler::ConvertVolume( TInt aVolume )
+    {
+    TInt result = 0;
+    if ( iAudioPlayer )
+        {
+        result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iAudioPlayer->MaxVolume() );
+        }
+    else if ( iTonePlayer )
+        {
+        result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iTonePlayer->MaxVolume() );
+        }
+        
+    //if user has selected silent ringing type, set volume off
+    TInt ringingType = RingingType();
+    if( ringingType == ERingingTypeSilent )
+        {
+        result = 0;
+        }
+
+    return result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::SetToneRingingType
+//
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::SetToneRingingType( TInt aRingingType )
+    {
+    const TInt KToneInterval = 1000000; // 1 second pause between tones
+    const TInt KAscendingVolumeInterval = 3000000; // 3 seconds
+    
+    if ( !iTonePlayer )
+        {
+        return;
+        }
+    
+    __ASSERT_DEBUG( iTonePlayerStatus == EPlayerInitialized, Panic( KErrGeneral ) );
+
+
+    TInt ringingVolume = RingingVolume();
+
+    switch( aRingingType )
+        {
+    	case ERingingTypeRinging:
+		case ERingingTypeSilent:
+            {
+            iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                     TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+        case ERingingTypeAscending:
+            {
+            iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                     TTimeIntervalMicroSeconds( KToneInterval ) );
+            
+            TInt volRamp = KAscendingVolumeInterval * ringingVolume;
+            iTonePlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
+            break;
+            }
+	    case ERingingTypeRingOnce:
+		case ERingingTypeBeepOnce:
+            {
+            iTonePlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+	    default:
+            {
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::SetAudioRingingType
+//
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::SetAudioRingingType( TInt aRingingType )
+    {
+    const TInt KToneInterval = 1000000; // 1 second pause between tones
+    const TInt KAscendingVolumeInterval = 3000000; // 3 seconds
+    
+    if ( !iAudioPlayer )
+        {
+        return;
+        }
+
+    __ASSERT_DEBUG( iAudioPlayerStatus == EPlayerInitialized, Panic( KErrGeneral ) );
+
+
+    TInt ringingVolume = RingingVolume();
+        
+    switch( aRingingType )
+        {
+        case ERingingTypeRinging:
+        case ERingingTypeSilent:
+            {
+            iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                      TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+        case ERingingTypeAscending:
+            {
+            iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                      TTimeIntervalMicroSeconds( KToneInterval ) );
+            TInt volRamp = KAscendingVolumeInterval * ringingVolume;
+            iAudioPlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
+		    break;
+            }
+        case ERingingTypeRingOnce:
+            {
+            iAudioPlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::Cancel
+//
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::Cancel()
+    {
+   	TBool isPlaying = EFalse;
+   	
+   	if ( iAudioPlayer )
+   	    {
+   	    isPlaying = ETrue;
+   	    if ( iAudioPlayerStatus == EPlayerPlayingWith3DEffect )
+   	        {
+   	        i3dRingingTonePlugin->Stop();
+   	        // plugin calls AudioPlayer->Stop()
+	        iAudioPlayer->Close();
+   	        }
+     	if ( iAudioPlayerStatus == EPlayerPlaying )
+            {
+      	    iAudioPlayer->Stop();
+    	    iAudioPlayer->Close();
+            }
+        
+        delete iAudioPlayer;
+        iAudioPlayer = NULL;
+        iAudioPlayerStatus = EPlayerNotCreated;
+  	    }
+    
+	if ( iTonePlayer )
+        {
+        isPlaying = ETrue;
+        if ( iTonePlayerStatus == EPlayerPlaying )
+            {
+    	    iTonePlayer->CancelPlay();
+	        }
+        
+        delete iTonePlayer;
+        iTonePlayer = NULL;
+        iTonePlayerStatus = EPlayerNotCreated;
+        }
+        
+
+   	if ( isPlaying )
+   	    {
+   	    //User::InfoPrint(_L("cancel"));
+   	    EnableScreenSaver( ETrue );
+   	    iBacklightTimer->Cancel();
+   	    }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::MatoPlayComplete (from MMdaAudioToneObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::MatoPlayComplete( TInt aError )
+    {
+    if ( iObserver )
+        {
+        TInt event = MPreviewHandlerObserver::EAudioPreviewComplete;
+        TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+        }
+    
+	Cancel();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::MatoPrepareComplete (from MMdaAudioToneObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::MatoPrepareComplete( TInt aError )
+    {
+    __ASSERT_DEBUG( iTonePlayerStatus == EPlayerInitializing, Panic( KErrGeneral ) );
+
+    if ( aError != KErrNone )
+        {
+        Cancel();
+        
+        if ( iObserver )
+            {
+            TInt event = MPreviewHandlerObserver::EPreviewError;
+            TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+            }
+        
+        return;
+        }
+
+    TInt ringingVolume = RingingVolume();
+    TInt ringingType = RingingType();
+    TInt vibra = Vibra();
+       
+    iTonePlayerStatus = EPlayerInitialized;
+    SetToneRingingType( ringingType );
+    iTonePlayer->SetVolume( ConvertVolume( ringingVolume ) );
+    
+    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;               
+    if ( vibra )
+        {
+        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
+        }
+    iTonePlayer->SetPriority( KAudioPriorityPreview, pref );
+                                             
+    iTonePlayer->Play();
+    iTonePlayerStatus = EPlayerPlaying;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::MdapcInitComplete (from MDrmAudioPlayerCallback)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::MdapcInitComplete( TInt aError, 
+                        const TTimeIntervalMicroSeconds& /* aDuration */ )
+    {
+    __ASSERT_DEBUG( iAudioPlayer, Panic( KErrGeneral ) );
+
+    if ( aError != KErrNone )
+        {
+        Cancel();
+
+        if ( iObserver )
+            {
+            TInt event = MPreviewHandlerObserver::EPreviewError;
+            TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+            }
+        return;
+        }
+        
+
+    TInt ringingVolume = RingingVolume();
+    TInt ringingType = RingingType();
+    TInt vibra = Vibra();
+    TInt echo3D = Echo3D();
+    TInt effect3D = Effect3D();
+
+    __ASSERT_DEBUG( ringingType != ERingingTypeBeepOnce,
+                     TMFDialogUtil::Panic( KErrGeneral ) );
+
+    iAudioPlayerStatus = EPlayerInitialized;
+    SetAudioRingingType( ringingType );
+    iAudioPlayer->SetVolume( ConvertVolume( ringingVolume ) );
+    
+    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;               
+    if ( vibra )
+        {
+        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
+        }
+    iAudioPlayer->SetPriority( KAudioPriorityPreview, pref );
+     
+    iAudioPlayerStatus = EPlayerPlaying;
+    
+    if ( effect3D == EProfile3DEffectOff )
+        {
+        iAudioPlayer->Play();  // 3D not used
+       	return;
+        }
+
+    if ( !i3dRingingTonePlugin )
+        {
+        TUid emptyUid = { 0 };
+        TRAPD( err, i3dRingingTonePlugin = C3DRingingToneInterface::NewL( emptyUid ) );
+        if ( err != KErrNone || !i3dRingingTonePlugin )
+            {
+       	    iAudioPlayer->Play();
+       	    return;
+            }
+        }       
+   
+    i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEffect, effect3D );
+    i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEcho, echo3D );    
+    i3dRingingTonePlugin->SetAttr( E3DRTIAttrDrmPlayerUtility, iAudioPlayer );
+    TRAP_IGNORE( i3dRingingTonePlugin->PlayL() );
+
+    iAudioPlayerStatus = EPlayerPlayingWith3DEffect;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFAudioPreviewHandler::MdapcPlayComplete (from MDrmAudioPlayerCallback)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFAudioPreviewHandler::MdapcPlayComplete( TInt aError )
+    {
+    if ( iObserver )
+        {
+        TInt event = MPreviewHandlerObserver::EAudioPreviewComplete;
+        TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) );
+        }
+
+	Cancel();
+    }
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafileprotection.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,603 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class used to check the protection of the 
+*                media files.
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "mediafileprotection.h"
+#include "mediafilelist.h"
+#include "mediafilelistdebug.h"
+#include <mediafilelist.rsg>
+
+#include <DRMCommon.h>
+#include <drmutility.h>
+#include <drmagents.h>
+#include <bautils.h>
+#include <StringLoader.h>
+
+
+
+/******************************************************************************
+ * class CMFProtectionHandler
+ ******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::NewL
+//
+// -----------------------------------------------------------------------------
+CMFProtectionHandler* CMFProtectionHandler::NewL()
+    {
+    CMFProtectionHandler* self = new (ELeave) CMFProtectionHandler();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::CMFProtectionHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CMFProtectionHandler::CMFProtectionHandler()
+	{
+	iMaxFileSize = KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::CMFProtectionHandler
+//
+// -----------------------------------------------------------------------------
+//
+void CMFProtectionHandler::ConstructL()
+    {
+    iDriveUtil = CDriveUtil::NewL();
+    iVariation = CMediaFileDialogVariation::NewL();
+
+    iDRMHelper = CDRMHelper::NewL( *CCoeEnv::Static() );
+    
+    iDRMCommon = DRMCommon::NewL();
+    User::LeaveIfError( iDRMCommon->Connect() );
+    
+    iExcludedMimeTypes = CMimeTypeList::NewL();
+    
+    User::LeaveIfError( iApaLsSession.Connect() );
+    User::LeaveIfError( iFsSession.Connect() );
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMFProtectionHandler::~CMFProtectionHandler()
+    {
+    delete iDriveUtil;
+    delete iVariation;
+    
+    delete iDRMHelper;
+    
+    if ( iDRMCommon )
+        {
+        iDRMCommon->Disconnect(); // ignore possible error
+        delete iDRMCommon;
+        }
+    
+    delete iExcludedMimeTypes;
+    iApaLsSession.Close();
+    iFsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::SetAttr
+// 
+// -----------------------------------------------------------------------------
+void CMFProtectionHandler::SetAttrL( TInt aAttr, TInt aValue )
+    {
+    switch ( aAttr )
+        {
+        case CMediaFileList::EAttrFileSize:
+            {
+            iMaxFileSize = aValue;
+            break;
+            }
+        case CMediaFileList::EAttrAutomatedType:
+            {
+            iAutomatedType = (CDRMHelper::TDRMHelperAutomatedType) aValue;
+            break;
+            }
+
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+void CMFProtectionHandler::SetAttrL( TInt aAttr, const TDesC& aValue )
+    {
+    if ( aAttr == CMediaFileList::EAttrExcludeMimeType )
+        {
+        if ( aValue.Length() > KMaxFileName || aValue.Length() == 0 )
+            {
+            User::Leave( KErrArgument );
+            }
+            
+        iExcludedMimeTypes->AddMimeTypeL( aValue );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::IsVideoValid
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::IsVideoValid( const TDesC& aFileName,
+                                         TIntention aIntention )
+    {
+    TInt err = KErrNone;
+    TBool ret = EFalse;
+    
+    TRAP( err, ret = IsVideoValidL (aFileName, aIntention ) )
+    
+    if ( err != KErrNone )
+        {
+        return EFalse;  // in case of error file is not valid
+        }
+    
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::IsVideoValidL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::IsVideoValidL( const TDesC& aFileName,
+                                          TIntention /*aIntention*/ )
+    {
+    TBuf<KMaxDataTypeLength> dataType( DataTypeL( aFileName ).Des() );
+  
+    if ( iExcludedMimeTypes->FindMimeTypeL( dataType ) )
+        {
+        return EFalse;
+        }
+
+    CContent* content = CContent::NewLC( aFileName,
+                                         EContentShareReadWrite );
+    TInt deliveryMethod = 0;
+    content->GetAttribute( EDeliveryMethod, deliveryMethod );
+    
+    CleanupStack::PopAndDestroy( content );
+    
+    if( deliveryMethod == EOmaDrm2 )
+        {
+        // if video it is OMA DRM 2 protected, it cannot be previewed
+        return EFalse;
+        }
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::IsFileValid
+// 
+// Checks protection state of media file. If this function returns EFalse,
+// media file cannot be used for playing/selection.
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::IsFileValid( const TDesC& aFileName,
+                                         TIntention aIntention )
+    {
+    TInt err = KErrNone;
+    TBool ret = EFalse;
+    
+    TRAP( err, ret = IsFileValidL (aFileName, aIntention ) )
+    
+    if ( err != KErrNone )
+        {
+        return EFalse;  // in case of error file is not valid
+        }
+    
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::IsFileValidL
+// 
+// Function is copy from CFLDDRMImplementation.cpp.
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::IsFileValidL( const TDesC& aFileName, 
+                                          TIntention aIntention )
+    {
+    TInt err = KErrNone;
+    TBuf<KMaxDataTypeLength> dataType( DataTypeL( aFileName ).Des() );
+    
+    if ( aFileName.Length() == 0 )
+        {
+        return ETrue;  // empty filename is valid??
+        }
+ 
+    if ( iExcludedMimeTypes->FindMimeTypeL( dataType ) )
+        {
+        ShowErrorNoteL( R_QTN_INFO_FILE_FORMAT_ERROR );
+        return EFalse;
+        }
+    
+    if ( aIntention == CMFProtectionHandler::ESelect && 
+        !CheckFileSize( aFileName, dataType ) )
+        {
+        HBufC* hBuf = StringLoader::LoadLC( R_QTN_INFO_FILE_SIZE_ERROR, iMaxFileSize );
+        TMFDialogUtil::ShowInformationNoteL( *hBuf );
+        CleanupStack::PopAndDestroy( hBuf );
+        return EFalse;
+        }
+
+    if ( iDriveUtil->IsRom( aFileName ) )
+        {
+        return ETrue;      // files in ROM are always valid
+        }
+
+    // check if file is WMDRM protected
+    TBool prot =  EFalse;
+    TRAP( err, prot = IsFileWMDRMProtectedL( aFileName ) );
+    if ( err != KErrNone )
+        {
+        ShowErrorNoteL( R_QTN_INFO_FILE_FORMAT_ERROR );
+        return EFalse;
+        }
+    if ( prot )
+        {
+        if ( aIntention == EPlay )
+            {
+            ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_USE );
+            }
+        else
+            {
+            ShowErrorNoteL( R_QTN_INFO_DRM_PROTECTED );
+            }
+        return EFalse;
+        }
+
+    ContentAccess::TVirtualPathPtr path( aFileName,
+                        ContentAccess::KDefaultContentObject );
+    CData* data = CData::NewLC( path, EContentShareReadWrite );
+    TInt isProtected;
+    err = data->GetAttribute( EIsProtected, isProtected );
+    CleanupStack::PopAndDestroy( data );
+
+    if ( err != DRMCommon::EOk )
+        {
+        // DRM Helper class knows at least rights db corrupted error message.
+        // Leaves on system-wide error code.
+        iDRMHelper->HandleErrorL( err, aFileName );
+        return EFalse;
+        }
+
+    // Obtain information whether the file can be set as automated content
+    TBool canSetAutomated = EFalse;
+    TInt canSetAutomatedErr = 
+         iDRMHelper->CanSetAutomated( aFileName, canSetAutomated );
+
+    if ( !isProtected && canSetAutomated )
+        {
+        // The file in question is not DRM protected.
+        // Return ETrue if file is also Ok unprotected, otherwise EFalse.
+        TBool ret = IsFileValidUnprotectedL( aFileName, aIntention );
+        return ret;
+        }
+    
+    // Operator requirement: Check restrictions if file is mp4 audio
+    if ( iVariation->IsBlockedProtectedType( dataType ) )
+        {
+        ShowErrorNoteL( R_QTN_INFO_DRM_PROTECTED );
+        return EFalse;
+        }
+    
+    if ( canSetAutomatedErr == DRMCommon::ERightsExpired ||
+        canSetAutomatedErr == DRMCommon::ENoRights )
+        {
+        // Rights are expired, future rights or missing
+        iDRMHelper->HandleErrorL( canSetAutomatedErr, aFileName );
+        return EFalse;
+        }
+
+    // Operator requirement: Check DRM v2 tones
+    if ( !canSetAutomated )
+        {
+        // This is DRM v2 file OR count based v1 tone
+        if ( aIntention == EPlay )
+            {
+            ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_USE );
+            }
+        else
+            {
+            ShowErrorNoteL( R_QTN_INFO_DRM_PROTECTED );
+            }
+        return EFalse;
+        }
+            
+    TInt32 infoBits( 0x00000000 );
+
+    // Find out rights information
+    if ( !GetFileInfoL( aFileName, infoBits ) )
+        {
+        // Corrupted file or "No rights" situation
+        return EFalse;
+        }
+
+    // Operator requirement: Check CFM protection
+    if ( infoBits & ENoRingingTone )
+        {
+        // This is CFM protected file, ringingtone is set to "no"
+        if ( aIntention == EPlay )
+            {
+            ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_USE );
+            }
+        else
+            {
+            ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_SET );
+            }
+        return EFalse;
+        }
+      
+    if ( aIntention == ESelect )
+        {
+        // Rights are good to go, and intention is selection
+        // call SetAutomatedPassive to show 'activation query' 
+        iDRMHelper->SetAutomatedType( iAutomatedType );
+        err = iDRMHelper->SetAutomatedPassive( aFileName );
+        if ( err != KErrCancel )
+            {
+            // User accepted dialog
+            User::LeaveIfError( err );
+            // New way, does not require DRM capability
+            data = CData::NewLC( path, EContentShareReadWrite );
+            err = data->ExecuteIntent( ContentAccess::EPlay );
+            // Wrongly requires DRM after all. According to Risto Vilkman
+            // from DRM, KErrAccessDenied can be ignored, since if
+            // CanSetAutomated says the tone is OK, it's OK.
+            if ( err != KErrNone && err != KErrAccessDenied )
+                {
+                User::Leave( err );
+                }
+            CleanupStack::PopAndDestroy( data );
+            }
+        else
+            {
+            // User canceled dialog
+            return EFalse;
+            }
+        }
+        
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::GetFileInfo
+//
+// Function is copy from CFLDDRMImplementation.cpp.
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::GetFileInfoL( const TDesC& aFileName,
+                                          TInt32& aInfoBits )
+    {
+    DRMCommon::TContentProtection contentProtection; // ignored
+    HBufC8* mimeType = NULL; // ignored
+    TUint dataLength = 0; // ignored
+    HBufC8* contentURI = NULL;
+       
+    // Obtain content URI
+    TInt error = iDRMCommon->GetFileInfo(
+        aFileName, contentProtection, mimeType, contentURI, dataLength );
+    delete mimeType;
+
+    if ( error != DRMCommon::EOk )
+        {
+        delete contentURI;
+        // Handle possible corrupt file situation
+        iDRMHelper->HandleErrorL( error, aFileName );
+        return EFalse;
+        }
+
+    // Obtain rights object
+    CDRMRights* rights = NULL;
+    error = iDRMCommon->GetActiveRights( *contentURI, DRMCommon::EPlay, rights );
+    delete contentURI;
+
+    if ( error == DRMCommon::ENoRights )
+        {
+        delete rights;
+        // There is no rights for given file
+        // Should never arrive here, ENoRights is handled
+        // already in IsFileValidL()
+        iDRMHelper->HandleErrorL( error, aFileName );
+        return EFalse;
+        }
+     
+    // Obtain infobits ( needed only for CFM case )     
+   aInfoBits = rights->GetPermission().iInfoBits;
+   delete rights;
+   return ETrue;
+   }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::IsFileWMDRMProtectedL
+//
+// Function is copy from CFLDDRMImplementation.cpp.
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::IsFileWMDRMProtectedL( const TDesC& aFileName )
+    {
+    TBool res = EFalse;
+    RFile hFile;
+
+    TInt err = hFile.Open( iFsSession, aFileName, 
+                           EFileRead | EFileStream | EFileShareReadersOnly );
+    if ( err == KErrInUse )
+        {
+        err = hFile.Open( iFsSession, aFileName, 
+                        EFileRead | EFileStream | EFileShareAny );
+        }
+    if ( err != KErrNone )
+        {
+        User::Leave( err );
+        }
+    CleanupClosePushL( hFile );
+
+    TPtrC agent( KNullDesC );
+    DRM::CDrmUtility* drmUtil = DRM::CDrmUtility::NewLC();
+    drmUtil->GetAgentL( hFile, agent );
+    if ( agent.Compare( DRM::KDrmWMAgentName ) == 0 )
+        {
+        res = ETrue;
+        }
+    CleanupStack::PopAndDestroy( drmUtil );
+
+    CleanupStack::PopAndDestroy( &hFile );
+    return res;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::DataTypeL
+//
+// Function is copy from CFLDDRMImplementationCommon.cpp.
+// -----------------------------------------------------------------------------
+//
+TDataType CMFProtectionHandler::DataTypeL( const TDesC& aFileName )
+    {
+    TUid dummyUid = { 0 };
+    TDataType dataType( dummyUid );
+    User::LeaveIfError(
+        iApaLsSession.AppForDocument( aFileName, dummyUid, dataType ) );
+
+    return dataType;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::IsFileValidUnprotectedL
+// 
+// Function is copy from CFLDDRMImplementationCommon.cpp.
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::IsFileValidUnprotectedL( const TDesC& aFileName,
+                                                     TIntention aIntention )
+    {
+    TDataType dataType = DataTypeL( aFileName );
+    TBuf<KMaxDataTypeLength> mimeType;
+    
+    mimeType = dataType.Des();
+
+    if ( iVariation->IsBlockedType( mimeType ) )
+        {
+        if ( aIntention == ESelect )
+            {
+            ShowErrorNoteL( R_QTN_INFO_TEXT_NOT_ALLOWED );
+            }
+        return EFalse;
+        }
+
+    // Operator requirement. Check if DRM is required with tones.
+    if ( aIntention == EPlay )
+        {
+        if ( iVariation->IsBlockedDemoPlayType( mimeType ) )
+            {
+            return EFalse;
+            }
+        }
+    else
+        {
+        if ( iVariation->IsBlockedUnprotectedType( mimeType ) )
+            {
+            ShowErrorNoteL( R_QTN_INFO_NO_DRM );
+            return EFalse;
+            }
+        }
+
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::CheckFileSize
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMFProtectionHandler::CheckFileSize( const TDesC& aFile, const TDesC& aMimeType  )
+    {
+    _LIT( KVideo, "video" );
+    const TInt KKiloByte = 1024;
+    const TInt KSmallSize = 10;
+   
+    if ( iMaxFileSize < KSmallSize )
+        {
+        return ETrue; // too small size limit
+        }
+    if ( aMimeType.Find( KVideo ) != KErrNotFound )
+        {
+        return ETrue;  // only audio files are checked
+        }
+    
+    TEntry entry;
+    TInt err = iFsSession.Entry( aFile, entry );
+    if ( err == KErrNone && iMaxFileSize != KErrNotFound )
+        {
+        TInt size = iMaxFileSize * KKiloByte; // KBytes -> Bytes
+        if ( entry.iSize > size )
+            {
+            return EFalse;
+            }
+        }
+  
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFProtectionHandler::ShowErrorNoteL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMFProtectionHandler::ShowErrorNoteL( TInt aResourceId )
+    {
+    TMFDialogUtil::ShowInformationNoteL( aResourceId );
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafiletest.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,2489 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class create for testing.
+*
+*/
+
+
+
+
+// INCLUDE FILES
+
+#include "mediafiletest.h"
+#include "mediafiledialog.h"
+#include "mediafilepreview.h"
+#include "mediafilelistdebug.h"
+
+#include <mediafilelist.rsg>
+
+#include <aknappui.h>  // for macro iAvkonAppUi
+#include <eikcapc.h>   // for CEikCaptionedControl
+#include <e32math.h>  // Math::FRand
+
+#include <bautils.h>  // bafl.lib
+#include <s32file.h>  // RFileReadStream
+
+
+
+#ifdef _DEBUG
+/******************************************************************************
+ * class CMFDialogTest
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::NewL
+//
+// -----------------------------------------------------------------------------
+CMFDialogTest* CMFDialogTest::NewL( CMediaFileDialog* aDialog )
+    {
+    CMFDialogTest* self = new (ELeave) CMFDialogTest( aDialog );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::CMFDialogTest
+// 
+// -----------------------------------------------------------------------------
+//
+CMFDialogTest::CMFDialogTest( CMediaFileDialog* aDialog )
+    {
+    iDlg = aDialog;
+    
+    iTestCounter = 0;
+    iBottomVisited = EFalse;
+    iDestroyedPtr = NULL;
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMFDialogTest::~CMFDialogTest()
+    {
+    SetScreenSaverPeriod( iScreenSaverPeriod );
+    
+    delete iTestCaller;
+    delete iRandomNum;
+   
+    if ( iPopupNote )
+        {
+        iPopupNote->HideInfoPopupNote();
+        delete iPopupNote;
+        }
+
+    if ( iDestroyedPtr )
+        {
+        *iDestroyedPtr = ETrue;
+        iDestroyedPtr = NULL;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::ConstructL()
+    {
+    const TInt KLongPeriod = 60*60*24; // 24 h in seconds
+    
+    iTestCaller = CMFActiveCaller::NewL( this );
+    iRandomNum = CRandomNum::NewL();
+   
+    iScreenSaverPeriod = ScreenSaverPeriodL();
+    SetScreenSaverPeriod( KLongPeriod );
+    
+    iPopupNote = CAknInfoPopupNoteController::NewL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::TestL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMFDialogTest::TestL( TInt /*aAttr*/ )
+    {
+    TInt index = 0;
+    CDesCArray *arr = new(ELeave) CDesCArrayFlat( 1 );
+    CleanupStack::PushL( arr );
+     
+    arr->AppendL(_L("random play"));
+    arr->AppendL(_L("test 1"));
+    arr->AppendL(_L("test 2"));
+
+    if ( !TMFDialogUtil::ShowListQueryL( _L("huu"), arr, &index ) )
+        {
+        CleanupStack::PopAndDestroy( arr );
+        return EFalse;
+        }
+    if ( index == 0 )
+        {
+        NextListItemL();
+        }
+    else if ( index == 1 )
+        {
+        Test1L( 0 );    
+        }
+    else if ( index == 2 )
+        {
+        Test2L( 0 );
+        }
+    else
+        {
+        }
+
+    CleanupStack::PopAndDestroy( arr );
+    return ETrue; 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::Test1L
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::Test1L( TInt /*aAttr*/ )
+    {
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::Test2L
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::Test2L( TInt /*aAttr*/ )
+    {
+    TInt num10 = 0; TInt num11 = 0; TInt num12 = 0; 
+    TInt num13 = 0; TInt num14 = 0; TInt num15 = 0;
+    TInt num16 = 0; TInt num17 = 0; TInt num18 = 0;
+    TInt num19 = 0; TInt num20 = 0; TInt numOther = 0;
+    
+    for (TInt i=0; i<100000; i++)
+        {
+        TInt num = iRandomNum->Random( 10, 20 );
+        
+        if ( num == 10 )
+            {
+            num10++;
+            }
+        else if ( num == 11 )
+            {
+            num11++;
+            }
+        else if ( num == 12 )
+            {
+            num12++;
+            }
+        else if ( num == 13 )
+            {
+            num13++;
+            }
+        else if ( num == 14 )
+            {
+            num14++;
+            }
+        else if ( num == 15 )
+            {
+            num15++;
+            }
+        else if ( num == 16 )
+            {
+            num16++;
+            }
+        else if ( num == 17 )
+            {
+            num17++;
+            }
+        else if ( num == 18 )
+            {
+            num18++;
+            }
+        else if ( num == 19 )
+            {
+            num19++;
+            }
+        else if ( num == 20 )
+            {
+            num20++;
+            }
+        else
+            {
+            numOther++;
+            }
+      
+        }
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::NextFolderL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::NextFolderL() 
+    {
+    const TInt KDelay = 2000;
+    
+    TBool destroyed = EFalse;
+    iDestroyedPtr = &destroyed;  // updated in this class destructor
+    
+    TInt currentFolder = iDlg->iState->CurrentFolder();
+    TInt currentIndex = iDlg->CurrentItemListIndex();
+    TInt folderId = iDlg->iState->FolderId( currentIndex );
+    
+    if ( currentFolder == EEFolderRoot )
+        {
+        // root folder
+        iBottomVisited = EFalse;
+        if ( iRandomNum->Match( 30 ) )
+            {
+            SimulateSearchEventL();  // search
+            }
+        else if ( folderId == EEFolderMusic || folderId == EEFolderTones ||
+             folderId == EEFolderRecordings || folderId == EEFolderVideos )
+            {
+            SimulateOpenEventL();  // go down    
+            }
+        else
+            {
+            iTestCaller->Start( ENextListItem, KDelay );
+            }
+        }
+    else if ( currentIndex == KErrNotFound )
+        {
+        // empty folder
+        SimulateBackEventL();  // go up
+        }
+    else if ( folderId == KErrNotFound )
+        {
+        // this folder has files, not subfolders
+        iBottomVisited = ETrue;
+        if ( iRandomNum->Match( 50 ) )
+            {
+            // stay in this folder and select a file
+            iTestCaller->Start( ENextListItem, KDelay );
+            return;
+            }
+        else
+            {
+            SimulateBackEventL();  // go up
+            }
+        }
+    else  // this folder has subfolders
+        {
+        TInt num = 15;
+        if ( !iBottomVisited )
+            {
+            num = 85;
+            }
+            
+        if ( iRandomNum->Match( num ) )
+            {
+            SimulateOpenEventL();  // go down 
+            }
+        else
+            {
+            SimulateBackEventL();  // go up
+            }
+        }
+    
+    // select listbox item after delay
+    if ( !destroyed )
+        {
+        iDestroyedPtr = NULL;
+        iTestCaller->Start( ENextListItem, KDelay );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::NextListItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::NextListItemL() 
+    {
+    const TInt KDelay = 250;
+    const TInt KLongDelay = 2000;
+    
+    TInt delay = KDelay;
+    
+    TInt currentIndex = iDlg->CurrentItemListIndex();
+    TInt folderId = iDlg->iState->FolderId( currentIndex );
+    
+    if ( folderId == KErrNotFound && currentIndex == 0 )
+        {
+        // this folder contain files - make delay longer to 
+        // allow first file preview
+        delay = KLongDelay;  
+        }
+        
+    TInt itemCount = iDlg->iListBox->Model()->NumberOfItems();
+    iNewIndex = iRandomNum->Random( itemCount - 1);
+   
+    if ( iDlg->iState->CurrentFolder() == EEFolderRoot )
+        {
+        if ( iRandomNum->Match( 50 ) )
+            {
+            iNewIndex = 2; // more chances to Music folder
+            }
+        }
+    
+    if ( iNewIndex == currentIndex )
+        {
+        iTestCaller->Start( ENextFolder, delay );
+        }
+    else
+        {
+        iTestCaller->Start( EMovePosition, delay );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::MovePositionL
+//
+// Scrolls listbox until selected item (iNewIndex) is found.
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::MovePositionL()
+    {
+    const TInt KMoveDelay = 150;
+    const TInt KThousand = 1000;
+   
+    TInt currentIndex = iDlg->CurrentItemListIndex();
+    TInt folderId = iDlg->iState->FolderId( currentIndex );
+    TInt itemCount = iDlg->iListBox->Model()->NumberOfItems();
+
+    TBool itemFound = EFalse;
+    if ( currentIndex == iNewIndex )
+        {
+        itemFound = ETrue; // listbox has scrolled to new item
+        }
+    if ( currentIndex == KErrNotFound )
+        {
+        itemFound = ETrue; // folder is empty
+        }
+    if ( iNewIndex >= itemCount )
+        {
+        itemFound = ETrue; // wrong folder
+        }
+
+    if ( itemFound )
+        {
+        // next listbox selection found
+        
+        TInt delay = KMoveDelay;
+        if ( folderId == KErrNotFound )
+            {
+            // selection is file - allow time for preview
+            delay = iRandomNum->Random( 3, 10 );
+            delay = delay * KThousand;
+            }
+        iTestCaller->Start( ENextFolder, delay );
+        return;
+        }
+    
+    // Simulate listbox item selection.
+    SimulateKeyEventL( EKeyUpArrow );
+    
+    //FLOG( _L("CMediaFileDialog::MovePositionL '%d/%d'"), currentIndex, iNewIndex );
+    
+    iTestCaller->Start( EMovePosition, KMoveDelay );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::SimulateKeyEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::SimulateKeyEventL( TInt aEvent )
+    {
+    TKeyEvent key;
+    key.iModifiers = 0;
+    key.iRepeats = 0;
+    key.iCode = aEvent;
+    key.iScanCode = aEvent;
+
+    //iListBox->SetCurrentItemIndexAndDraw( newIndex );
+    CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::SimulateOpenEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::SimulateOpenEventL()
+    {
+    TKeyEvent keyEvent;
+    keyEvent.iCode = EKeyDevice3;
+    keyEvent.iScanCode = EStdKeyDevice3;
+    keyEvent.iRepeats = 0;          
+    CCoeEnv::Static()->SimulateKeyEventL( keyEvent, EEventKey );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::SimulateBackEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::SimulateBackEventL()
+    {
+    TKeyEvent keyEvent;
+    keyEvent.iCode = EKeyDevice1;
+    keyEvent.iScanCode = EStdKeyDevice1;
+    keyEvent.iRepeats = 0;          
+    CCoeEnv::Static()->SimulateKeyEventL( keyEvent, EEventKey );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::SimulateSearchEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::SimulateSearchEventL()
+    {
+    // letter a 97/65
+    // letter b 98/66
+    
+    TKeyEvent keyEvent;
+    keyEvent.iCode = 97;
+    keyEvent.iScanCode = 65;
+    keyEvent.iRepeats = 0;          
+    CCoeEnv::Static()->SimulateKeyEventL( keyEvent, EEventKey );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::SetScreenSaverPeriod
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::SetScreenSaverPeriod( TInt aPeriod )
+    {
+    TRAP_IGNORE( SetScreenSaverPeriodL( aPeriod ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::SetScreenSaverPeriodL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::SetScreenSaverPeriodL( TInt aPeriod )
+    {
+    // from SettingsInternalCRKeys.h
+    const TUid KCRUidPersonalizationSettings = {0x101F877C};
+    const TUint32 KSettingsScreenSaverPeriod =  0x00000008;
+
+    CRepository* repository =
+                 CRepository::NewL( KCRUidPersonalizationSettings );
+    
+    // ignore error
+    repository->Set( KSettingsScreenSaverPeriod, aPeriod );
+    
+    delete repository;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::ScreenSaverPeriodL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMFDialogTest::ScreenSaverPeriodL()
+    {
+    // from SettingsInternalCRKeys.h
+    const TUid KCRUidPersonalizationSettings = {0x101F877C};
+    const TUint32 KSettingsScreenSaverPeriod =  0x00000008;
+
+    CRepository* repository =
+                 CRepository::NewL( KCRUidPersonalizationSettings );
+    
+    TInt period = 60; // 60 seconds
+    // ignore error
+    repository->Get( KSettingsScreenSaverPeriod, period );
+
+    delete repository;
+    
+    return period;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::HandleActiveCallL (from MMFActiveCallerObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::HandleActiveCallL( TInt aCallId )
+    {
+    if ( aCallId == ENextFolder )
+        {
+        //FLOG( _L("CMFDialogTest::HandleActiveCallL: ENextFolder") );
+        
+        TRAP_IGNORE( NextFolderL() );
+        iDestroyedPtr = NULL;
+        }
+    if ( aCallId == ENextListItem )
+        {
+        //FLOG( _L("CMFDialogTest::HandleActiveCallL: ENextListItem") );
+        NextListItemL();    
+        }
+
+    if ( aCallId == EMovePosition )
+        {
+        //FLOG( _L("CMFDialogTest::HandleActiveCallL: EMovePosition") );
+        
+        MovePositionL();    
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::SetTime
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::SetTime()
+    {
+    iTime = TimeBefore();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::PrintTimeL
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::PrintTimeL( const TDesC& aText )
+    {
+    TBuf<128> buf;
+    TInt milliSeconds = TimeAfter( iTime );
+    buf.Format( _L("%S %d ms"), &aText, milliSeconds );
+    
+    ShowPopupNoteL( buf );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::TimeBefore
+//
+// Function returns TTime of the current time (needed with function TimeAfter).
+// -----------------------------------------------------------------------------
+//
+TTime CMFDialogTest::TimeBefore()
+    {
+    TTime now;
+    now.UniversalTime();
+    return now;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::TimeAfter
+//
+// Function returns milliseconds passed since aBefore.
+// -----------------------------------------------------------------------------
+//
+TInt64 CMFDialogTest::TimeAfter( TTime aBefore )
+    {
+    TTime after;
+    after.UniversalTime();
+    TTimeIntervalMicroSeconds microSeconds=after.MicroSecondsFrom( aBefore ); 
+    TInt64 milliSeconds=microSeconds.Int64()/1000;
+    return milliSeconds;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMFDialogTest::ShowPopupNote
+//
+// -----------------------------------------------------------------------------
+//
+void CMFDialogTest::ShowPopupNoteL( const TDesC& aText ) 
+    {
+    const TInt KPopupDisplayTime = 3*1000;
+    const TInt KPopupDelayTime = 500;
+    
+    iPopupNote->SetTextL( aText );
+    iPopupNote->SetTimeDelayBeforeShow( KPopupDelayTime );
+    iPopupNote->SetTimePopupInView( KPopupDisplayTime );    
+    iPopupNote->ShowInfoPopupNote();    
+    }
+
+
+
+
+/******************************************************************************
+ * class CRandomNum
+ ******************************************************************************/
+
+
+ 
+// -----------------------------------------------------------------------------
+// CRandomNum::NewLC
+// 
+// -----------------------------------------------------------------------------
+//
+CRandomNum* CRandomNum::NewLC()
+    {
+    CRandomNum* randomdata = new (ELeave) CRandomNum;
+    CleanupStack::PushL( randomdata );
+    return randomdata;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRandomNum::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CRandomNum* CRandomNum::NewL()
+    {
+    CRandomNum* randomdata = new (ELeave) CRandomNum;
+    return randomdata;
+    }
+
+// -----------------------------------------------------------------------------
+// CRandomNum::CRandomNum
+// 
+// -----------------------------------------------------------------------------
+//
+CRandomNum::CRandomNum()
+    {
+    TTime now;
+    now.UniversalTime();
+    iSeed = now.Int64();
+    }
+
+// -----------------------------------------------------------------------------
+// CRandomNum::~CRandomNum
+// 
+// -----------------------------------------------------------------------------
+//
+CRandomNum::~CRandomNum()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRandomNum::Random
+// 
+// Return random integer from 0 to aMax (including 0 and aMax).
+// -----------------------------------------------------------------------------
+//
+TInt CRandomNum::Random( TInt aMax )
+    {
+    TReal real = Math::FRand( iSeed ); // FRand updates iSeed
+    TReal real2 = real * ( aMax+1 );
+    TInt num = (TInt) real2;
+    return num;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRandomNum::Random
+// 
+// Return random integer from aMin to aMax (including aMin and aMax).
+// -----------------------------------------------------------------------------
+//
+TInt CRandomNum::Random( TInt aMin, TInt aMax )
+    {
+    if ( aMin >= aMax )
+        {
+        return aMin;
+        }
+    
+    TInt range = aMax - aMin;
+    
+    TInt num = Random( range );
+    
+    return aMin + num;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRandomNum::Match
+//
+// Return ETrue according to percentage parameter (eg. in case
+// aPercentage is 10 Match returns ETrue in 10% of the calls).
+// -----------------------------------------------------------------------------
+//
+TBool CRandomNum::Match( TInt aPercentage )
+    {
+    if ( aPercentage < 1 )
+        {
+        return EFalse;
+        }
+    
+    TInt num = Random( 99 ); // 0..99
+    num++; // 1..100
+
+    if ( num <= aPercentage )
+        {
+        return ETrue;
+        }
+    
+    return EFalse;
+    }
+
+
+
+
+
+
+/******************************************************************************
+ * class CMediaFileDialog3
+ ******************************************************************************/
+
+/*
+
+// -----------------------------------------------------------------------------
+// media file dialog resource (test code).
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_media_file_dialog_3
+    {
+    //flags = EEikDialogFlagNoBackup | EEikDialogFlagFillAppClientRect;
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    //buttons = R_AVKON_SOFTKEYS_OK_BACK__OK;
+    buttons = r_media_file_dialog_3_cba;
+
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSingleGraphicListBox;
+            itemflags=EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            id=1;
+            control=LISTBOX
+                {
+                flags = EAknListBoxSelectionList;
+                };   
+            }
+        };
+    
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_media_file_dialog_3_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = qtn_msk_select;
+            }
+        };
+    }
+
+RESOURCE MENU_BAR r_media_file_dialog_3_menu
+    {
+    titles= 
+        { 
+        MENU_TITLE 
+            { 
+            menu_pane=r_media_file_dialog_3_menu_pane;
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_media_file_dialog_3_menu_pane
+    {
+    items=
+        {
+        MENU_ITEM { command=EAknCmdOpen; txt=qtn_options_open; },
+        MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+        MENU_ITEM { command=EAknCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+*/
+/*
+ 
+// -----------------------------------------------------------------------------
+// CMediaFileDialog3::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CMediaFileDialog3::ShowDialogL()
+    {
+    CMediaFileDialog3* dlg = CMediaFileDialog3::NewL();
+    TBool ret = dlg->ExecuteLD( R_MEDIA_FILE_DIALOG_3 );
+
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMediaFileDialog3::~CMediaFileDialog3()
+    {
+    delete iVideoPreviewHandler;
+    
+    if ( iAvkonAppUi )
+        {
+        iAvkonAppUi->RemoveFromStack( this );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog3::CMediaFileDialog3
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileDialog3::CMediaFileDialog3()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog3::NewL
+//
+// -----------------------------------------------------------------------------
+CMediaFileDialog3* CMediaFileDialog3::NewL()
+    {
+    CMediaFileDialog3* self = new (ELeave) CMediaFileDialog3();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog3::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog3::ConstructL()
+    {
+    FLOG( _L("CMediaFileDialog3::ConstructL START") );
+    
+    CAknDialog::ConstructL( R_MEDIA_FILE_DIALOG_3_MENU );
+
+    iVideoPreviewHandler = CMFVideoPreviewHandler::NewL();
+    
+    FLOG( _L("CMediaFileDialog3::ConstructL END") );
+    }
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialog3::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialog3::PreLayoutDynInitL()
+    {
+    }
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog3::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CMediaFileDialog3::OkToExitL(TInt aButtonId)
+    {
+    if ( aButtonId == EAknSoftkeyBack )
+        {
+        }
+
+    return CAknDialog::OkToExitL( aButtonId );
+    }
+
+
+
+//------------------------------------------------------------------------------
+// CMediaFileDialog3::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CMediaFileDialog3::ProcessCommandL(TInt aCommandId)
+    {
+    HideMenu();
+    
+    
+    switch (aCommandId)
+        {
+        case EAknCmdHelp:
+            {
+            break;
+            }
+            
+        case EAknCmdOpen:
+            {
+            CEikCaptionedControl *ctrl = Line( 1 );  // dialog has one line (listbox) with id 1
+            iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrDrawingWindow, (ctrl->iControl->DrawableWindow()) );
+                
+            iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, _L("C:\\Data\\Videos\\video2.mp4") );
+            iVideoPreviewHandler->PlayL(); 
+
+            break;
+            }
+ 
+        case EAknCmdExit:
+        case EEikCmdExit:
+            {
+            // close dialog and exit calling application
+            iAvkonAppUi->ProcessCommandL( EAknCmdExit );
+            break;
+            }
+
+        default:            
+            break;
+        }
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryAllL (obsolete)
+// 
+// Finds all tones, music, videos or recordings.
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::QueryAllL( TInt aAttr )
+    {
+    if ( !iSessionOpen )
+        {
+        User::Leave( KErrDisconnected );
+        }
+
+    if ( aAttr != EAttrMusic && aAttr != EAttrVideo )
+        {
+        User::Leave( KErrNotSupported );
+        }
+        
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& musicObjectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+    CMdEObjectDef& videoObjectDef = defNS.GetObjectDefL( MdeConstants::Video::KVideoObject );
+   
+    delete iQuery;
+    iQuery = NULL;
+
+    if ( aAttr == EAttrVideo )
+        {
+        iQuery = iSession->NewObjectQueryL( defNS, videoObjectDef, this );
+        iQueryType = EQueryVideo;
+        }
+    else
+        {
+        iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this );
+        iQueryType = EQueryAudio;
+        }
+    
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    
+    // define sort order
+    iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    iQuery->FindL();
+    
+    iQueryType = EQueryAudio;
+    }
+*/
+
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryArtistUnknownL (obsolete)
+// 
+// Finds all songs for aArtist that miss album property.
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::QueryArtistUnknownL( const TDesC& aArtist )
+    {
+    if ( !iSessionOpen )
+        {
+        return;
+        }
+
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+
+    iQueryType = EQueryAudio;
+    
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    CMdEPropertyDef& artistPropertyDef = PropertyDefL( EAttrArtist );
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    CMdEPropertyDef& albumPropertyDef = PropertyDefL( EAttrAlbum );
+    
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    
+    // add root condition: get all songs by aArtist
+    conditions.AddPropertyConditionL( artistPropertyDef, 
+                                      ETextPropertyConditionCompareEquals,
+                                      aArtist );
+                                      
+    // set attributes that are included in query result  
+    iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    iQuery->AddPropertyFilterL( &artistPropertyDef );
+    
+    
+    // add other condition: get songs that do not have album attribute
+    CMdELogicCondition& albumCondition = 
+        conditions.AddLogicConditionL( ELogicConditionOperatorAnd );
+    albumCondition.AddPropertyConditionL( albumPropertyDef );
+    albumCondition.SetNegate( ETrue );
+
+    iQuery->FindL();
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler2::QueryAlbumsL (obsolete)
+// 
+// Finds all albums for aArtist.
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::QueryAlbumsL( const TDesC& aArtist )
+    {
+    if ( !iSessionOpen )
+        {
+        return;
+        }
+
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+
+    iQueryType = EQueryAudio;
+    
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    iQuery->SetResultMode( EQueryResultModeDistinctValues );
+    
+    CMdEPropertyDef& propertyDef = PropertyDefL( EAttrAlbum );
+    
+    // distinct query requires exactly one property filter
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    conditions.AddPropertyConditionL( propertyDef );
+    iQuery->AppendOrderRuleL( TMdEOrderRule( propertyDef, ESortAscending ) );
+    iQuery->AddPropertyFilterL( &propertyDef );
+    
+    CMdEPropertyDef& propertyDef2 = PropertyDefL( EAttrArtist );
+    conditions.AddPropertyConditionL( propertyDef2, 
+                            ETextPropertyConditionCompareEquals, aArtist );
+        
+    iQuery->FindL();
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryArtistAlbumL (obsolete)
+// 
+// Finds songs for aArtist/aAlbum.
+// -----------------------------------------------------------------------------
+//
+
+/*
+void CMediaFileHandler::QueryArtistAlbumL( const TDesC& aArtist, const TDesC& aAlbum )
+    {
+    if ( !iSessionOpen )
+        {
+        return;
+        }
+    
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+
+    iQueryType = EQueryAudio;
+
+    delete iQuery;
+    iQuery = NULL;
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    CMdEPropertyDef& artistDef = PropertyDefL( EAttrArtist );
+    CMdEPropertyDef& albumDef = PropertyDefL( EAttrAlbum );
+    CMdEPropertyDef& nameDef = PropertyDefL( EAttrSongName );
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    
+    conditions.AddPropertyConditionL( artistDef, 
+                            ETextPropertyConditionCompareEquals, aArtist );
+
+    conditions.AddPropertyConditionL( albumDef, 
+                            ETextPropertyConditionCompareEquals, aAlbum );
+        
+    iQuery->AppendOrderRuleL( TMdEOrderRule( nameDef, ESortAscending ) );
+    iQuery->AddPropertyFilterL( &nameDef );
+   
+    
+    User::Leave(KErrNoMemory);
+    iQuery->FindL();
+    
+    
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryL (test code)
+// 
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::QueryL( TInt aAttr )
+    {
+    if ( aAttr != EAttrArtist && aAttr != EAttrAlbum &&
+         aAttr != EAttrGenre && aAttr != EAttrComposer )
+        {
+        User::Leave( KErrNotSupported );
+        }
+   
+
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    
+    
+    RArray<TItemId> itemIds;
+    itemIds.Append( 22 );
+    itemIds.Append( 5 );
+    itemIds.Append( 18 );
+    //itemLogicCondition->AddObjectConditionL(itemIds);
+            
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    conditions.AddObjectConditionL( itemIds );
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    itemIds.Close();
+    
+    iQuery->FindL();
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryL (test code)
+// 
+// -----------------------------------------------------------------------------
+//
+
+/*
+void CMediaFileHandler::QueryL()
+    {
+    if ( !iSession )
+        {
+        User::Leave( KErrSessionClosed );
+        }
+   
+    delete iQuery;
+    iQuery = NULL;
+    
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    
+    CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
+    iQuery = iSession->NewObjectQueryL( defNS, objectDef, this );
+    iQuery->SetResultMode( EQueryResultModeId );
+    iQuery->FindL();
+    
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    
+    //conditions.AddPropertyConditionL(composerPropertyDef, 
+    //CMdETextPropertyCondition::ECompareEquals, text);
+
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleQueryCompletedOneL
+// 
+// -----------------------------------------------------------------------------
+//
+
+/*
+void CMediaFileHandler::HandleQueryCompletedOneL( CMdEQuery& aQuery, 
+                                                  TInt aError )
+    {
+    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
+    
+    CMdEObjectDef& objectDef      = defNS.GetObjectDefL( 
+                                    MdeConstants::Object::KBaseObject );
+    CMdEObjectDef& mediaObjectDef = defNS.GetObjectDefL( 
+                                    MdeConstants::MediaObject::KMediaObject );
+    CMdEObjectDef& audioObjectDef = defNS.GetObjectDefL( 
+                                    MdeConstants::Audio::KAudioObject );
+    
+    
+    CMdEPropertyDef& songPropertyDef   = objectDef.GetPropertyDefL( 
+                                         MdeConstants::Object::KTitleProperty );
+    CMdEPropertyDef& artistPropertyDef = mediaObjectDef.GetPropertyDefL( 
+                                         MdeConstants::MediaObject::KArtistProperty );
+    CMdEPropertyDef& albumPropertyDef  = audioObjectDef.GetPropertyDefL( 
+                                         MdeConstants::Audio::KAlbumProperty );
+    CMdEPropertyDef& genrePropertyDef  = mediaObjectDef.GetPropertyDefL( 
+                                         MdeConstants::MediaObject::KGenreProperty );
+
+    CMdEProperty* property = NULL;
+    
+    const RArray<TItemId>& arr = iQuery->ResultIds();
+    
+    TBuf<256> buf;
+    TInt count = arr.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        TItemId id = arr[i];
+        CMdEObject* object = iSession->GetFullObjectL( id );
+        CleanupStack::PushL( object );
+        
+        buf = object->Uri();
+        TInt propertyCount = object->PropertyCount();
+        for ( TInt j=0; j<propertyCount; j++ )
+            {
+            CMdEProperty& pr = object->PropertyL( j );
+            const CMdEPropertyDef& prDef = pr.Def();
+            buf.Append(_L(" "));
+            buf.Append(prDef.Name());
+            }
+        TMFDialogUtil::ShowInformationQueryL( buf );
+        
+        CMdEPropertyDef& tmpDef = object->Def().GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty );
+        TInt ret = object->Property( tmpDef, property, 0 );
+        if ( ret != KErrNotFound )
+            {
+            buf = property->TextValueL();    
+            }
+
+        
+        ret = object->Property( songPropertyDef, property, 0 );
+        if ( ret != KErrNotFound )
+            {
+            buf = property->TextValueL();    
+            }
+
+        ret = object->Property( artistPropertyDef, property, 0 );
+        if ( ret != KErrNotFound )
+            {
+            buf = property->TextValueL();    
+            }
+        
+        ret = object->Property( albumPropertyDef, property, 0 );
+        if ( ret != KErrNotFound )
+            {
+            buf = property->TextValueL();    
+            }
+            
+        ret = object->Property( genrePropertyDef, property, 0 );
+        if ( ret != KErrNotFound )
+            {
+            buf = property->TextValueL();    
+            }
+        
+
+        CleanupStack::PopAndDestroy( object );
+        }
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleQueryCompletedTwoL
+// 
+// -----------------------------------------------------------------------------
+//
+
+/*
+void CMediaFileHandler::HandleQueryCompletedTwoL( CMdEQuery& aQuery,
+                                                  TInt aError )
+    {
+    TBuf<256> buf;
+    
+    TInt count = iQuery->Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        buf = iQuery->ResultDistinctValue( i );
+       
+        CMdEObject& object = iQuery->Result( i );
+        
+        buf = object.Uri();
+        TInt propertyCount = object.PropertyCount();
+        for ( TInt j=0; j<propertyCount; j++ )
+            {
+            CMdEProperty& pr = object.PropertyL( j );
+            const CMdEPropertyDef& prDef = pr.Def();
+            buf.Append(_L(" "));
+            buf.Append(prDef.Name());
+            }
+        TMFDialogUtil::ShowInformationQueryL( buf );
+        
+        CMdEProperty* property = NULL;
+        CMdEPropertyDef& propDef = object.Def().GetPropertyDefL( MdeConstants::Audio::KAlbumProperty );
+        TInt ret = object.Property( propDef, property, 0 );
+        if ( ret != KErrNotFound )
+            {
+            buf = property->TextValueL();    
+            }
+        }
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ResultCount
+// 
+// -----------------------------------------------------------------------------
+//
+
+/*
+TInt CMediaFileHandler::ResultCount()
+    {
+    if ( iQueryType == EQueryRomFile )
+        {
+        return iRomFileList.Count();
+        }
+         
+    if ( iQueryType == ESearchVideo )
+        {
+        return iSearchList->Count();
+        }
+
+    if ( !iQuery || !iQueryReady || !iSessionOpen )
+        {
+        return 0;
+        }
+        
+    TInt count = 0;
+    TQueryResultMode resultMode = iQuery->ResultMode();
+    
+    if ( resultMode == EQueryResultModeDistinctValues ||
+         resultMode == EQueryResultModeItem ||
+         resultMode == EQueryResultModeCount )
+        {
+        count = iQuery->Count();
+        }
+    else if ( resultMode == EQueryResultModeId )
+        {
+        count = iQuery->Count();
+        const RArray<TItemId>& arr = iQuery->ResultIds();
+        count = arr.Count();
+        }
+    
+    return count;
+    }
+*/    
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::GetRecentFileAttribute
+// 
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::GetRecentFileAttribute( TInt aIndex, TInt aAttr, TDes& aValue )
+    {
+    TInt count = iRecentList->Count();
+    
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) );
+    
+    if ( aAttr == EAttrFullName )
+        {
+        StrCopy( aValue, iRecentList->FileName( aIndex ) );
+        }
+    else if ( aAttr == EAttrSongName || aAttr == EAttrFileName )
+        {
+        TParsePtrC parse( iRecentList->FileName( aIndex ) );
+        StrCopy( aValue, parse.Name() );
+        }
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::RecentFileAttribute
+// 
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CMediaFileHandler::RecentFileAttribute( TInt aIndex, TInt aAttr )
+    {
+    TInt count = iRecentList->Count();
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) );
+    
+    TInt ret = KErrNotFound;
+    
+    if ( aAttr == EAttrMediaType )
+        {
+        ret = EAttrMusic;
+        }
+    if ( aAttr == EAttrStorageType )
+        {
+        ret = EPhoneMemory;
+        }
+
+    return ret;
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::Attribute
+// 
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CMediaFileHandler::Attribute( TInt aIndex, TInt aAttr )
+    {
+    if ( iQueryType == EQueryRomFile )
+        {
+        return RomFileAttribute( aIndex, aAttr );
+        }
+    if ( iQueryType == ESearchVideo )
+         {
+         return iSearchList->Attribute( aIndex, aAttr );
+         }
+  
+    if ( aAttr == EAttrMediaType )
+        {
+        if ( iQueryType == EQueryVideo )
+            {
+            return EAttrVideo;
+            }
+        else
+            {
+            return EAttrMusic;
+            }
+        }
+    else if ( aAttr == EAttrStorageType )
+         {
+         TInt ret = CMediaFileHandler::EPhoneMemory;
+
+         if ( !iQuery || !iQueryReady || !iSessionOpen )
+              {
+              return ret;
+              }
+         TQueryResultMode resultMode = iQuery->ResultMode();
+         if ( resultMode != EQueryResultModeItem )
+             {
+             return ret;
+             }
+         
+         CMdEObject& object = iQuery->Result( aIndex );
+         if ( iDriveUtil->IsMemoryCard( object.Uri() ) )
+             {
+             ret = CMediaFileHandler::EMemoryCard;
+             }
+         else if ( iDriveUtil->IsMassStorage( object.Uri() ) )
+             {
+             ret = CMediaFileHandler::EMassStorage;
+             }
+         return ret;
+         }
+    
+    else if ( aAttr == EAttrMediaFileId )
+          {
+          if ( !iQuery || !iQueryReady || !iSessionOpen )
+              {
+              return KErrNotFound;
+              }
+          CMdEObject& object = iQuery->Result( aIndex );
+          return object.Id();
+          }
+
+    return KErrNotFound;
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::GetAttributeL
+// 
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue )
+    {
+    aValue = KNullDesC;
+    
+    if ( iQueryType == EQueryRomFile )
+        {
+        GetRomFileAttribute( aIndex, aAttr, aValue );
+        return;
+        }
+    if ( iQueryType == ESearchVideo )
+        {
+        if ( iSessionOpen )
+            {
+            iSearchList->SetSession( iSession );
+            }
+        else
+            {
+            iSearchList->SetSession( NULL );
+            }
+        iSearchList->GetAttributeL( aIndex, aAttr, aValue );
+        return;
+        }
+    
+
+    if ( !iQuery || !iQueryReady || !iSessionOpen )
+        {
+        return;
+        }
+
+    TInt count = ResultCount();
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) );
+    
+    TQueryResultMode resultMode = iQuery->ResultMode();
+    
+    if ( resultMode == EQueryResultModeDistinctValues )
+        {
+        TPtrC ptr = iQuery->ResultDistinctValue( aIndex );
+        StrCopy( aValue, ptr );
+        }
+
+    if ( resultMode == EQueryResultModeItem )
+        {
+        CMdEObject& object = iQuery->Result( aIndex );
+        
+        if ( aAttr == EAttrFullName )
+            {
+            StrCopy( aValue, object.Uri() );
+            return;
+            }
+        
+        CMdEPropertyDef& propDef = PropertyDefL( aAttr );
+        CMdEProperty* property = NULL;
+        TInt ret = object.Property( propDef, property, 0 );
+        if ( ret != KErrNotFound )
+            {
+            StrCopy( aValue, property->TextValueL() );
+            }
+        else if ( aAttr == EAttrSongName || aAttr == EAttrFileName)
+            {
+            TParsePtrC parse( object.Uri() );
+            StrCopy( aValue, parse.Name() );
+            }
+        }
+    }
+*/    
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::UpdateRecentListL
+//
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::UpdateRecentListL()
+    {
+    if ( !iSessionOpen )
+        {
+        return;
+        }
+    
+    TInt count = iRecentList->Count();
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        TItemId id = iRecentList->Id( i );
+        CMdEObject* object = NULL;
+        
+        TInt err = KErrNone;
+        TRAP( err, object = iSession->GetFullObjectL( id ) );
+        if ( err != KErrNone || !object )
+            {
+            iRecentList->SetPresent( EFalse, i );
+            }
+        else
+            {
+            CleanupStack::PushL( object );
+            iRecentList->SetFileNameL( object->Uri(), i );
+            CleanupStack::PopAndDestroy( object );
+            }        
+        }
+        
+    iRecentList->Clean();
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::StoreRecentFileL
+//
+// -----------------------------------------------------------------------------
+//
+/*
+void CMediaFileHandler::StoreRecentFileL( TInt aIndex )
+    {
+    if ( iQueryType == EQueryRomFile )
+        {
+        return;  // tones not part of recent files
+        }
+    
+    if ( iQueryType == EQueryRecentFile )
+        {
+        TInt64 id = iRecentList->Id( aIndex );
+        iRecentList->AddItemL( id );
+        return;
+        }
+        
+    if ( !iQuery || !iQueryReady || !iSessionOpen )
+        {
+        return;
+        }
+
+    TQueryResultMode resultMode = iQuery->ResultMode();
+    if ( resultMode == EQueryResultModeItem )
+        {
+        CMdEObject& object = iQuery->Result( aIndex );
+        TItemId id = object.Id();
+        iRecentList->AddItemL( id );
+        }
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::HandleQueryCompletedL
+//
+// -----------------------------------------------------------------------------
+//
+
+/*
+void CMediaFileHandler::HandleQueryCompletedL( CMdEQuery& aQuery, TInt aError )
+    {
+    iQueryReady = ETrue;
+    
+    if ( !iQuery )
+        {
+        iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, KErrCancel );
+        return;  // query has been canceled
+        }
+    
+    if ( aError != KErrNone )
+        {
+        iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, aError );
+        return;
+        }
+    
+    TQueryResultMode resultMode = iQuery->ResultMode();
+    
+    if ( resultMode == EQueryResultModeDistinctValues )
+        {
+        iObserver->HandleMFEventL( MMediaFileHandlerObserver::EQueryComplete, aError );
+        }
+    else if ( resultMode == EQueryResultModeId )
+        {
+        // const RArray<TItemId>& arr = iQuery->ResultIds();
+        // CopyArrayL( iResultArray, arr );
+        //
+        // copy this arr into member iResultIds and perform full search
+        // for the whole set or a partial search if result set is very large
+        // partial search indexes could be in another member iPartialResultdIds
+        // observer gets notified after the first partial search
+        
+        iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, KErrNotSupported );
+        }
+    else if ( resultMode == EQueryResultModeCount )
+        {
+        iObserver->HandleMFEventL( MMediaFileHandlerObserver::EUnknownQueryComplete, aError );
+        }
+    else if ( resultMode == EQueryResultModeItem )
+        {
+        if ( iQueryType == ESearchAudio )
+            {
+            iSearchList->Reset();
+            iSearchList->TakeResultL( iQuery, EAttrMusic );
+            SearchVideoL( iSearchText );
+            }
+        else if ( iQueryType == ESearchVideo )
+            {
+            iSearchList->TakeResultL( iQuery, EAttrVideo );
+            iSearchList->Sort();
+            iObserver->HandleMFEventL( MMediaFileHandlerObserver::EQueryComplete, aError );
+            }
+        else
+            {
+            iObserver->HandleMFEventL( MMediaFileHandlerObserver::EQueryComplete, aError );
+            }
+        }
+    else
+        {
+        iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, KErrNotSupported );
+        }
+    }
+*/
+
+
+/*
+    //private:
+        //void ReadDirectoryL( const TDesC& aDirectory );
+        //void ReadRomFilesL();
+        //void SortRomFiles();
+        //static TInt CompareFileName( const TFileName& aFirst, const TFileName& aSecond );
+        //static TInt CompareStr( const TFileName& aFirst, const TFileName& aSecond );
+  
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ReadRomFilesL (to be removed)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::ReadRomFilesL()
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    iRomFileList.Reset();
+    
+    TFileName fileName;
+    fileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SoundsPath() );
+    TRAP_IGNORE( ReadDirectoryL( fileName ) );
+    
+    fileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::DigitalSoundsPath() );
+    TRAP_IGNORE( ReadDirectoryL( fileName ) );
+
+    fileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SimpleSoundsPath() );
+    TRAP_IGNORE( ReadDirectoryL( fileName ) );
+
+    TInt count = iRomFileList.Count();
+    for ( TInt i=0; i<count; i++ )
+        {
+        fileName = iRomFileList[i];
+        }
+        
+    SortRomFiles();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::ReadDirectoryL (to be removed)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::ReadDirectoryL( const TDesC& aDirectory )
+    {
+    _LIT( KFormat, "%S%S" );
+    
+    TBuf<128> buf( aDirectory );
+    
+    CDir* dir = NULL;
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() ); 
+    CleanupClosePushL( fsSession );
+    
+    if ( !BaflUtils::FolderExists( fsSession, aDirectory ) )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    TInt err = fsSession.GetDir( aDirectory, KEntryAttNormal, ESortByName, dir );
+    User::LeaveIfError( err );
+    CleanupStack::PushL( dir );
+    
+    TInt count = dir->Count();
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        const TEntry item = (*dir)[i];
+        TFileName fullName;
+        fullName.Format( KFormat, &aDirectory, &item.iName );
+        iRomFileList.Append( fullName );
+        }
+
+    CleanupStack::PopAndDestroy( dir );
+
+    CleanupStack::PopAndDestroy(); // fsSession
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::SortRomFiles (to be removed)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::SortRomFiles()
+    {
+    iRomFileList.Sort(TLinearOrder<TFileName>(CMediaFileHandler::CompareFileName));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::QueryRomFilesL (to be removed)
+// 
+// Finds all tones from rom directories.
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::QueryRomFilesL( TInt aAttr )
+    {
+    QueryEmptyL();
+    
+    iQueryType = EQueryRomFile;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::GetRomFileAttribute (to be removed)
+// 
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHandler::GetRomFileAttribute( TInt aIndex, TInt aAttr, TDes& aValue )
+    {
+    TInt count = iRomFileList.Count();
+    
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) );
+    
+    if ( aAttr == EAttrFullName )
+        {
+        StrCopy( aValue, iRomFileList[aIndex] );
+        }
+    else if ( aAttr == EAttrSongName || aAttr == EAttrFileName )
+        {
+        TParsePtrC parse( iRomFileList[aIndex] );
+        StrCopy( aValue, parse.Name() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::RomFileAttribute (to be removed)
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHandler::RomFileAttribute( TInt aIndex, TInt aAttr )
+    {
+    TInt count = iRomFileList.Count();
+    
+    __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) );
+    
+    TInt ret = KErrNotFound;
+    if ( aAttr == EAttrMediaType )
+        {
+        ret = EMediaTypeTone;
+        }
+    else if ( aAttr == EAttrStorageType )
+        {
+        ret = EPhoneMemory;
+        }
+    
+    return ret;
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::CompareFileName
+//
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CMediaFileHandler::CompareFileName(const TFileName& aFirst, const TFileName& aSecond)
+    {
+    TParsePtrC parseFirst( aFirst );
+    TParsePtrC parseSecond( aSecond );
+    
+    return parseFirst.Name().Compare( parseSecond.Name() );
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// CMediaFileHandler::CompareStr
+//
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CMediaFileHandler::CompareStr(const TFileName& aFirst, const TFileName& aSecond)
+    {
+    return aFirst.Compare( aSecond );
+    }
+*/
+
+
+
+/*******************************************************************************
+ * class TMediaFileHistoryItem
+ *******************************************************************************/
+
+/*
+// -----------------------------------------------------------------------------
+// TMediaFileHistoryItem::Id
+//
+// -----------------------------------------------------------------------------
+//
+TInt64 TMediaFileHistoryItem::Id()
+    {
+    return iId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMediaFileHistoryItem::SetId
+//
+// -----------------------------------------------------------------------------
+//
+void TMediaFileHistoryItem::SetId( TInt64 aId )
+    {
+    iId = aId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMediaFileHistoryItem::Time
+//
+// -----------------------------------------------------------------------------
+//
+TTime TMediaFileHistoryItem::Time()
+    {
+    return iTime;
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMediaFileHistoryItem::SetTime
+//
+// -----------------------------------------------------------------------------
+//
+void TMediaFileHistoryItem::SetTime( TTime aTime )
+    {
+    iTime = aTime;
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMediaFileHistoryItem::InternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void TMediaFileHistoryItem::InternalizeL( RReadStream& aStream )
+    {
+    aStream >> iId;
+
+    if ( iId < 0 )
+        {
+        User::Leave( KErrCorrupt );
+        }
+
+    TInt64 temp = 0;
+    aStream >> temp;
+    
+    if ( temp <= 0 )
+        {
+        User::Leave( KErrCorrupt );
+        }
+    TTime time( temp );
+    iTime = time;
+    
+    iPresent = ETrue;
+    iFullName = KNullDesC;
+    }
+
+
+// -----------------------------------------------------------------------------
+// TMediaFileHistoryItem::ExternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void TMediaFileHistoryItem::ExternalizeL( RWriteStream& aStream )
+    {
+    aStream << iId;
+    aStream << iTime.Int64();
+    }
+*/
+
+
+
+/*******************************************************************************
+ * class CMediaFileHistory
+ *******************************************************************************/
+
+/*
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CMediaFileHistory* CMediaFileHistory::NewL()
+    {
+    CMediaFileHistory* self = new (ELeave) CMediaFileHistory();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(self );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::CMediaFileHistory
+// 
+// -----------------------------------------------------------------------------
+//
+CMediaFileHistory::CMediaFileHistory()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::ConstructL
+//
+// Note: Sessionpath in emulator is '\epoc32\winscw\c\private\2000F85A'
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::ConstructL()
+    {
+    _LIT( KHistoryFile, "MediaFileHistory" );
+    const TInt KHistoryDrive = EDriveC;
+    
+    User::LeaveIfError( iFsSession.Connect() );
+    User::LeaveIfError( iFsSession.SetSessionToPrivate( KHistoryDrive ) );
+    
+    User::LeaveIfError( iFsSession.SessionPath( iPath ) );
+    BaflUtils::EnsurePathExistsL( iFsSession, iPath );
+    iPath.Append( KHistoryFile );
+    
+    TInt err = KErrNone;
+    TRAP( err, ReadHistoryL() );
+    
+    if ( err != KErrNone && err != KErrNoMemory )
+        {
+        // history file was just created or it is corrupted
+        iList.Reset();
+        }
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CMediaFileHistory::~CMediaFileHistory()
+    {
+    Clean();
+    
+    TRAP_IGNORE( WriteHistoryL() );
+    
+    iList.Close();
+    iFsSession.Close();
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::AddItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::AddItemL( TInt64 aId )
+    {
+    TMediaFileHistoryItem item;
+    
+    TTime t;
+    t.UniversalTime();
+    
+    item.SetTime( t );
+    item.SetId( aId );
+    
+    AddItemL( item );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::Count
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHistory::Count()
+    {
+    return iList.Count();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::Reset
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::Reset()
+    {
+    iList.Reset();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::SetFileNameL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::SetFileNameL( const TDesC& aFullName, TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iList.Count() )
+        {
+        TMFDialogUtil::Panic( KErrArgument );
+        }
+        
+    TMediaFileHistoryItem& item = iList[aIndex];
+    TMFDialogUtil::StrCopy( item.iFullName, aFullName );
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::FileName
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CMediaFileHistory::FileName( TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iList.Count() )
+        {
+        TMFDialogUtil::Panic( KErrArgument );
+        }
+        
+    TMediaFileHistoryItem& item = iList[aIndex];
+    return item.iFullName;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::SetPresent
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::SetPresent( TBool aPresent, TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iList.Count() )
+        {
+        TMFDialogUtil::Panic( KErrArgument );
+        }
+        
+    TMediaFileHistoryItem& item = iList[aIndex];
+    item.iPresent = aPresent;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::Id
+//
+// -----------------------------------------------------------------------------
+//
+TInt64 CMediaFileHistory::Id( TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iList.Count() )
+        {
+        TMFDialogUtil::Panic( KErrArgument );
+        }
+        
+    TMediaFileHistoryItem& item = iList[aIndex];
+    return item.iId;
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::InternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::InternalizeL( RReadStream& aStream )
+    {
+    TInt count = aStream.ReadInt32L();
+    if ( count < 0 || count > KMaxHistoryItemCount )
+        {
+        User::Leave( KErrCorrupt );
+        }
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMediaFileHistoryItem item;
+        TInt err = KErrNone;
+        TRAP( err, item.InternalizeL( aStream ) );
+        if ( err != KErrNone )
+            {
+            User::Leave( err );
+            }
+        iList.AppendL( item );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::ExternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::ExternalizeL(RWriteStream& aStream)
+    {
+    TInt count = iList.Count();
+    aStream.WriteInt32L( count );
+        
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMediaFileHistoryItem& item = iList[i];
+        item.ExternalizeL( aStream );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::ReadHistoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::ReadHistoryL()
+    {
+    RFile file;
+    TInt err = file.Open( iFsSession, iPath, EFileRead );
+    if ( err == KErrNotFound )
+        {
+        err = file.Create( iFsSession, iPath, EFileRead );
+        }
+    User::LeaveIfError( err );
+        
+    CleanupClosePushL( file );
+    
+    RFileReadStream stream( file, 0 );
+    CleanupClosePushL( stream );
+
+    TRAP( err, InternalizeL( stream ) );
+    User::LeaveIfError( err );
+
+    CleanupStack::PopAndDestroy( &stream );
+    CleanupStack::PopAndDestroy( &file );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::WriteHistoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::WriteHistoryL()
+    {
+    RFile file;
+    User::LeaveIfError( file.Replace( iFsSession, iPath, EFileWrite ) );
+    CleanupClosePushL( file );
+    
+    RFileWriteStream stream( file, 0 );
+    CleanupClosePushL( stream );
+
+    TInt err = KErrNone;
+    TRAP( err, ExternalizeL( stream ) );
+    
+    if ( err == KErrNone )
+        {
+        TRAP( err, stream.CommitL() );
+        User::LeaveIfError( err );
+        }
+
+    CleanupStack::PopAndDestroy( &stream );
+    CleanupStack::PopAndDestroy( &file );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::Clean
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::Clean()
+    {
+    Sort();
+    
+    for (;;)
+        {
+        TInt ret = RemoveOldItem();
+        if ( !ret )
+            {
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::RemoveOldItem
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileHistory::RemoveOldItem()
+    {
+    TInt count = iList.Count();
+    
+    for ( TInt i=0; i<count; i++ )
+        {
+        TMediaFileHistoryItem& item= iList[i];
+        if ( !item.iPresent )
+            {
+            iList.Remove( i );
+            return ETrue;
+            }
+        }
+    
+    count = iList.Count();
+    
+    if ( count > KMaxHistoryItemCount )
+        {
+        iList.Remove( count - 1 );
+        return ETrue;
+        }
+    
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::AddItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::AddItemL( TMediaFileHistoryItem aItem )
+    {
+    TInt index = ItemIndex( aItem.iId );
+    if ( index != KErrNotFound )
+        {
+        iList.Remove(index);
+        }
+
+    User::LeaveIfError( iList.Append( aItem ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::ItemIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHistory::ItemIndex( TInt aId )
+    {
+    TInt count = iList.Count();
+    
+    for (TInt i=0; i<count; i++)
+        {
+        TMediaFileHistoryItem& item= iList[i];
+        if ( item.iId == aId )
+            {
+            return i;
+            }
+        }
+        
+    return KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::Item
+//
+// -----------------------------------------------------------------------------
+//
+TMediaFileHistoryItem& CMediaFileHistory::Item( TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iList.Count() )
+        {
+        TMFDialogUtil::Panic( KErrArgument );
+        }
+
+    return iList[aIndex];
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::Sort
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::Sort()
+    {
+    iList.Sort( TLinearOrder<TMediaFileHistoryItem>(CMediaFileHistory::CompareItems) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::CompareItems
+//
+// -----------------------------------------------------------------------------
+//
+TInt CMediaFileHistory::CompareItems( const TMediaFileHistoryItem& aFirst, 
+                                      const TMediaFileHistoryItem& aSecond )
+    {
+    if ( aFirst.iTime > aSecond.iTime )
+        {
+        return -1;
+        }
+    else if ( aFirst.iTime < aSecond.iTime )
+        {
+        return 1;
+        }
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileHistory::GetTimeText
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileHistory::GetTimeText( TDes& aText, TTime aTime )
+    {
+    _LIT( KFormat, "%02d.%02d.%04d %02d:%02d:%02d" );
+    
+    TDateTime dt = aTime.DateTime();
+    aText.Format( KFormat, dt.Day()+1, dt.Month()+1, dt.Year(),  dt.Hour(), dt.Minute(), dt.Second() );
+    }
+
+*/
+
+#endif  // #ifdef _DEBUG
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafilevariation.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,232 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Variation functionality class
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "mediafilevariation.h"
+
+#include <centralrepository.h>
+#include <apmstd.h> // for KMaxDataTypeLength
+#include <ProfileEngineDomainCRKeys.h>
+
+
+
+/******************************************************************************
+ * class CMediaFileDialogVariation
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CMediaFileDialogVariation* CMediaFileDialogVariation::NewL()
+    {
+    CMediaFileDialogVariation* self = new ( ELeave ) CMediaFileDialogVariation( 0 );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self);
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::~CMediaFileDialogVariation
+//
+// -----------------------------------------------------------------------------
+//
+CMediaFileDialogVariation::~CMediaFileDialogVariation()
+    {
+    iBlockedTones.Close();
+    iBlockedUnprotectedTones.Close();
+    iBlockedProtectedTones.Close();
+    iBlockedDemoPlayTones.Close();
+    iExcludedTones.Close();
+    iMimeBuf.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::CMediaFileDialogVariation
+//
+// -----------------------------------------------------------------------------
+//
+CMediaFileDialogVariation::CMediaFileDialogVariation( TInt aFeatureBitMask )
+    : iFeatureBitMask( aFeatureBitMask )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogVariation::ConstructL()
+    {
+    _LIT( KSpace, " " );
+    
+    CRepository* cenrep = CRepository::NewL( KCRUidProfilesLV );
+    CleanupStack::PushL( cenrep );
+    
+    User::LeaveIfError( cenrep->Get( KProfilesLVFlags, iFeatureBitMask ) );
+    ReadListKeyL( *cenrep, KProEngBlockedTones, iBlockedTones );
+    ReadListKeyL( *cenrep, KProEngBlockedUnprotectedTones,
+                  iBlockedUnprotectedTones );
+    ReadListKeyL( *cenrep, KProEngBlockedProtectedTones,
+                  iBlockedProtectedTones );
+    ReadListKeyL( *cenrep, KProEngBlockedDemoPlayTones,
+                  iBlockedDemoPlayTones );
+    ReadListKeyL( *cenrep, KProEngExcludedTones,
+                  iExcludedTones );
+    
+    CleanupStack::PopAndDestroy( cenrep );
+    
+    iMimeBuf.CreateL( KMaxDataTypeLength + KSpace().Length() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::IsFeatureSupported
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogVariation::IsFeatureSupported( TInt aLocalFeatureId )
+    {
+    return iFeatureBitMask & aLocalFeatureId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::IsBlockedType
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogVariation::IsBlockedType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedTones, aMimeType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::IsBlockedUnprotectedType
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogVariation::IsBlockedUnprotectedType(
+        const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedUnprotectedTones, aMimeType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::IsBlockedProtectedType
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogVariation::IsBlockedProtectedType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedProtectedTones, aMimeType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::IsBlockedDemoPlayType
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogVariation::IsBlockedDemoPlayType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedDemoPlayTones, aMimeType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::IsExcludedType
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogVariation::IsExcludedType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iExcludedTones, aMimeType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::ReadListKeyL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileDialogVariation::ReadListKeyL( CRepository& aCenRep,
+                                              TUint32 aKey, RBuf& aValue )
+    {
+    _LIT( KSpace, " " );
+    
+    TBuf<1> tmp; // one char to get length of actual value
+    TInt realLen = 0;
+    TInt err = aCenRep.Get( aKey, tmp, realLen );
+    if ( err == KErrOverflow )
+        {
+        // prepare list of blocked MIME types
+        aValue.CreateL( realLen + KSpace().Length() );
+        User::LeaveIfError( aCenRep.Get( aKey, aValue ) );
+        aValue.Append( KSpace );
+        }
+    else
+        {
+        User::LeaveIfError( err );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileDialogVariation::ContainsMimeTypeL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CMediaFileDialogVariation::ContainsMimeType( const TDesC& aList,
+                                                   const TDesC& aMimeType )
+    {
+    _LIT( KSpace, " " );
+    
+    if( aList.Length() == 0 )
+        {
+        return EFalse;
+        }
+
+    iMimeBuf.Copy( aMimeType );
+    // FindF() would find "audio/3gpp" in "audio/3gpp2" without
+    // the added space.
+    iMimeBuf.Append( KSpace );
+    
+    if ( aList.FindF( iMimeBuf ) == KErrNotFound )
+        {
+        // aMimeType was not in blocked list
+        return EFalse;
+        }
+    
+    return ETrue;
+    }
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafilevideopreviewdialog.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,350 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Dialog create for video preview
+*
+*/
+
+
+
+#include <aknappui.h>
+#include "mediafilevideopreviewdialog.h"
+#include "mediafilepreview.h"
+#include <mediafilelist.rsg>
+
+
+
+/******************************************************************************
+ * class CVideoPreviewDialog
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::ShowDialogLD
+// 
+// NOTE: ExecuteLD deletes dialog object.
+// -----------------------------------------------------------------------------
+TBool CVideoPreviewDialog::ShowDialogLD( TInt* aError )
+    {
+    iError = aError;
+    *iError = KErrNone;
+    
+    TBool ret = ExecuteLD( R_VIDEO_PREVIEW_DIALOG );
+
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CVideoPreviewDialog::~CVideoPreviewDialog()
+    {
+    CCoeEnv::Static()->RemoveForegroundObserver( *this );
+    
+    delete iIdle;
+    
+    if ( iVideoHandlerCreated )
+        {
+        delete iVideoHandler;    
+        }
+   
+    if ( iAvkonAppUi )
+        {
+        iAvkonAppUi->RemoveFromStack( this );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::CVideoPreviewDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CVideoPreviewDialog::CVideoPreviewDialog( TAny* aVideoHandler )
+    {
+    if ( aVideoHandler )
+        {
+        iVideoHandler = static_cast<CMFVideoPreviewHandler*>( aVideoHandler );
+        //iVideoHandler = aVideoHandler;
+        }
+    iVideoHandlerCreated = EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CVideoPreviewDialog* CVideoPreviewDialog::NewL( TAny* aVideoHandler )
+    {
+    CVideoPreviewDialog* self = new (ELeave) CVideoPreviewDialog( aVideoHandler );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::ConstructL()
+    {
+    CCoeEnv::Static()->AddForegroundObserverL( *this );
+    
+    CAknDialog::ConstructL( R_VIDEO_PREVIEW_DIALOG_MENU );
+
+    if ( !iVideoHandler )
+        {
+        iVideoHandler = CMFVideoPreviewHandler::NewL();
+        iVideoHandlerCreated = ETrue;
+        }
+    
+    iVideoHandler->SetObserver( this );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::SetAttrL( TInt aAttr, TInt aValue )
+    {
+    iVideoHandler->SetAttrL( aAttr, aValue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::SetAttrL
+// 
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::SetAttrL( TInt aAttr, const TDesC& aValue )
+    {
+    iVideoHandler->SetAttrL( aAttr, aValue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::SetAttr
+// 
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::SetAttrL( TInt aAttr, TAny* aValue )
+    {
+    iVideoHandler->SetAttrL( aAttr, aValue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::PreLayoutDynInitL()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::PostLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::PostLayoutDynInitL()
+    {
+    // dialog has two lines (see .rss). Listbox line id is 1
+    //CEikCaptionedControl *ctrl = Line( 1 );
+    //iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrDrawingWindow, (ctrl->iControl->DrawableWindow()) );
+    
+    iVideoHandler->SetAttrL( TMFDialogUtil::EAttrDrawingWindow, DrawableWindow() );
+    iVideoHandler->PlayL();
+    }
+
+
+//------------------------------------------------------------------------------
+// CVideoPreviewDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CVideoPreviewDialog::OkToExitL(TInt aButtonId)
+    {
+    if ( aButtonId == EEikBidCancel )
+        {
+        if ( iVideoHandler->IsPlaying() )
+            {
+            iVideoHandler->Stop();
+            }
+
+        return ETrue;  // close dialog
+        }
+
+    if ( aButtonId == EAknSoftkeySelect || aButtonId == EEikBidOk )
+        {
+        if ( iVideoHandler->IsPlaying() )
+            {
+            iVideoHandler->Stop();
+            }
+        return ETrue;  // close dialog
+        }
+
+    if ( aButtonId == EAknSoftkeyBack )
+        {
+        if ( iVideoHandler->IsPlaying() )
+            {
+            iVideoHandler->Stop();
+            }
+        return ETrue;  // close dialog
+        }
+
+    return CAknDialog::OkToExitL( aButtonId );
+    }
+
+
+// ----------------------------------------------------------------------------
+// CVideoPreviewDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::HandleResourceChange(TInt aType)
+    {   
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        // handle change in layout orientation
+        
+        CAknDialog::HandleResourceChange( aType );
+        
+        TRAP_IGNORE( iVideoHandler->SetDisplayWindowL() );
+        return;
+        }
+    }
+
+    
+//------------------------------------------------------------------------------
+// CVideoPreviewDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::ProcessCommandL(TInt aCommandId)
+    {
+    HideMenu();
+    
+    switch (aCommandId)
+        {
+        case EAknCmdExit:
+        case EEikCmdExit:
+            {
+            // close dialog and exit calling application
+            iAvkonAppUi->ProcessCommandL( EAknCmdExit );
+            break;
+            }
+
+        default:            
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::CloseDialogWithDelayL
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::CloseDialogWithDelayL()
+    {    
+    // close after short delay (dialog cannot be closed from this function)
+    delete iIdle;
+    iIdle = NULL;
+    iIdle = CIdle::NewL( CActive::EPriorityIdle );                
+    if ( iIdle )
+        {                    
+        iIdle->Start( TCallBack( CloseDialog, this ) );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::CloseDialogL()
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::CloseDialogL()
+    {    
+    // close the dialogue immediately
+    CloseDialog( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::CloseDialog
+//
+// -----------------------------------------------------------------------------
+//
+TInt CVideoPreviewDialog::CloseDialog( TAny *aObj )
+    {    
+    CVideoPreviewDialog *dlg = (CVideoPreviewDialog*) aObj;
+    
+    TRAP_IGNORE( dlg->TryExitL( EAknSoftkeyBack ) );
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::HandlePreviewEventL (from MPreviewHandlerObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::HandlePreviewEventL( TInt aEvent, TInt aError )
+    {
+    if ( aEvent == MPreviewHandlerObserver::EVideoPreviewComplete )
+        {
+        *iError = aError;
+        CVideoPreviewDialog::CloseDialogWithDelayL();
+        }
+
+    if ( aEvent == MPreviewHandlerObserver::EPreviewError )
+        {
+        *iError = aError;
+        CVideoPreviewDialog::CloseDialogWithDelayL();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::HandleLosingForeground (from MCoeForegroundObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::HandleLosingForeground()
+    {
+    TRAP_IGNORE( CVideoPreviewDialog::CloseDialogWithDelayL() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CVideoPreviewDialog::HandleGainingForeground (from MCoeForegroundObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CVideoPreviewDialog::HandleGainingForeground()
+    {
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/Src/mediafilewaitnote.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,344 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Waiting note for query
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "mediafilewaitnote.h"
+#include <mediafilelist.rsg>
+
+#include <eikprogi.h>
+#include <notecontrol.h>
+#include <aknappui.h>   // macro iAvkonAppUi
+
+
+
+
+
+/*******************************************************************************
+ * class CMediaFileWaitNote
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::CMediaFileWaitNote
+//
+// -----------------------------------------------------------------------------
+//
+CMediaFileWaitNote::CMediaFileWaitNote( MMediaFileWaitNoteObserver* aObserver )
+: iObserver( aObserver )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CMediaFileWaitNote* CMediaFileWaitNote::NewL( MMediaFileWaitNoteObserver* aObserver )
+    {
+    CMediaFileWaitNote* self = new (ELeave) CMediaFileWaitNote( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return( self );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::ConstructL()
+    {
+    iObserverCallNeeded = ETrue;
+    iDialogDismissed = EFalse;
+    iLastText = KNullDesC;
+	iAnimation = EFalse;
+    iImageFile = KNullDesC;
+    } 
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CMediaFileWaitNote::~CMediaFileWaitNote()
+    {
+    delete iProgressDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::LaunchL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::LaunchL( const TDesC& aLabel )
+    {
+    if ( iProgressDialog )
+        {
+        // CAknNoteDialog::~CAknNoteDialog sets iProgressDialog to NULL after:
+        // 1. CAknProgressDialog::ProcessFinishedL is called
+        // 2. dialog is closed using Cancel button
+        return;
+        }
+    
+    iObserverCallNeeded = ETrue;
+    iDialogDismissed = EFalse;
+    
+    iProgressDialog = new(ELeave) 
+    CAknProgressDialog( reinterpret_cast<CEikDialog**>(&iProgressDialog), EFalse );
+    
+    iProgressDialog->PrepareLC( R_MEDIA_FILE_WAIT_NOTE );
+    iProgressDialog->SetTextL( aLabel );
+    
+    if ( iImageFile.Length() > 0 )
+        {
+        CEikImage* image = TMFDialogUtil::CreateImageLC( iImageId, iImageFile,
+                           iBitmapId,  iBitmapMaskId );
+        iProgressDialog->SetImageL( image );
+        CleanupStack::Pop( image );
+        }
+
+    // get reference to progress info bar
+    //iProgressInfo = iProgressDialog->GetProgressInfoL();
+
+    iProgressDialog->SetCallback( this );
+    
+    iProgressDialog->RunLD();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::SetImageL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::SetImageL( TAknsItemID aId, const TDesC& aImageFile,
+                                    TInt aBitmapId, TInt aBitmapMaskId )
+	{
+	if ( aImageFile.Length() > iImageFile.MaxLength() )
+        {
+        return;
+        }
+    iImageFile = aImageFile;
+	iImageId = aId;
+	iBitmapId = aBitmapId;
+	iBitmapMaskId = aBitmapMaskId;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::CancelProgressDialogL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::CancelProgressDialogL()
+    {
+    // this function is called from CMediaFileDialog so there is no need 
+    // to notify observer (CMediaFileDialog)
+    iObserverCallNeeded = EFalse;
+    
+    if ( iDialogDismissed )
+        {
+        return; // dialog is already closed
+        }
+    
+	if ( !iProgressDialog )
+		{
+		return; // dialog is already closed
+		}
+		
+	iProgressDialog->ProcessFinishedL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::SetTextL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::SetTextL( const TDesC& aText )
+    {
+    if ( !iProgressDialog )
+        {
+        return;
+        }
+
+    if ( iLastText.Compare( aText ) == 0 )
+		{
+		return;  // text has not changed
+		}
+    
+    iProgressDialog->SetTextL( aText );
+	TMFDialogUtil::StrCopy( iLastText, aText );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::SetProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::SetProgress( TInt aValue )
+    {
+	if ( !iProgressDialog  || !iProgressInfo )
+	    {
+	    return;
+	    }
+
+	CEikProgressInfo::SInfo info = iProgressInfo->Info();
+
+	TInt val = aValue;
+	if ( val > info.iFinalValue )
+		{
+		val = info.iFinalValue;
+		}
+	
+	iProgressInfo->SetAndDraw( val );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::SetFinalProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::SetFinalProgress( TInt aFinalValue )
+	{
+    if ( !iProgressDialog  || !iProgressInfo )
+        {
+        return;
+        }
+
+    if ( aFinalValue < 0 )
+    	{
+    	iProgressInfo->SetFinalValue( 0 );
+    	}
+    else
+    	{
+    	iProgressInfo->SetFinalValue( aFinalValue );
+    	}
+    	
+	iProgressInfo->SetAndDraw( 0 );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::NoteControl
+//
+// -----------------------------------------------------------------------------
+//
+CAknNoteControl* CMediaFileWaitNote::NoteControl()
+	{
+	if ( !iProgressDialog )
+	    {
+	    return NULL;
+	    }
+    CAknNoteControl* note = STATIC_CAST(CAknNoteControl*, iProgressDialog->ControlOrNull(EGeneralNote));
+
+    return note;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::CancelAnimation
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::CancelAnimation()
+	{
+    iAnimation = EFalse;
+	CAknNoteControl* note = NoteControl();
+	if ( note )
+	    {
+	    note->CancelAnimation();
+	    }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CMediaFileWaitNote::StartAnimationL
+//
+// ----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::StartAnimationL()
+	{
+    if ( !iAnimation )
+		{
+	    CAknNoteControl* note = NoteControl();
+	    if ( note )
+	        {
+	        note->StartAnimationL();
+	        iAnimation = ETrue;
+	        }
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::DialogDismissedL (From MProgressDialogCallback)
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::DialogDismissedL( TInt aButtonId )
+    {
+    iDialogDismissed = ETrue;
+    
+    if ( !iObserver )
+		{
+		return;
+		}
+	
+    if ( !iObserverCallNeeded )
+        {
+        return;
+        }
+    
+    TRAP_IGNORE( iObserver->HandleWaitNoteL( aButtonId ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CMediaFileWaitNote::HideButtonL
+//
+// -----------------------------------------------------------------------------
+//
+void CMediaFileWaitNote::HideButtonL()
+    {
+    const TInt KLastButtonIndex = 2;
+    
+   	if ( !iProgressDialog )
+   	    {
+   	    return;
+   	    }
+   	
+    CEikButtonGroupContainer& container = iProgressDialog->ButtonGroupContainer();
+	
+	container.RemoveCommandFromStack( KLastButtonIndex, EAknSoftkeyCancel );
+	container.AddCommandToStackL( KLastButtonIndex, EAknSoftkeyEmpty, KNullDesC );
+	container.DrawDeferred();
+    }
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/bwins/MediaFileListu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,9 @@
+EXPORTS
+	?NewL@CMediaFileList@@SAPAV1@XZ @ 1 NONAME ; class CMediaFileList * CMediaFileList::NewL(void)
+	?SetAttrL@CMediaFileList@@QAEXHABVTDesC16@@@Z @ 2 NONAME ; void CMediaFileList::SetAttrL(int, class TDesC16 const &)
+	?SetAttrL@CMediaFileList@@QAEXHH@Z @ 3 NONAME ; void CMediaFileList::SetAttrL(int, int)
+	?SetAttrL@CMediaFileList@@QAEXHPAX@Z @ 4 NONAME ; void CMediaFileList::SetAttrL(int, void *)
+	?SetNullItemL@CMediaFileList@@QAEXABVTDesC16@@0HH@Z @ 5 NONAME ; void CMediaFileList::SetNullItemL(class TDesC16 const &, class TDesC16 const &, int, int)
+	?ShowMediaFileListL@CMediaFileList@@QAEHPAVTDes16@@PAH10@Z @ 6 NONAME ; int CMediaFileList::ShowMediaFileListL(class TDes16 *, int *, int *, class TDes16 *)
+	??1CMediaFileList@@UAE@XZ @ 7 NONAME ; CMediaFileList::~CMediaFileList(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/eabi/MediaFileListu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,13 @@
+EXPORTS
+	_ZN14CMediaFileList12SetNullItemLERK7TDesC16S2_ii @ 1 NONAME
+	_ZN14CMediaFileList18ShowMediaFileListLEP6TDes16PiS2_S1_ @ 2 NONAME
+	_ZN14CMediaFileList4NewLEv @ 3 NONAME
+	_ZN14CMediaFileList8SetAttrLEiPv @ 4 NONAME
+	_ZN14CMediaFileList8SetAttrLEiRK7TDesC16 @ 5 NONAME
+	_ZN14CMediaFileList8SetAttrLEii @ 6 NONAME
+	_ZN14CMediaFileListD0Ev @ 7 NONAME
+	_ZN14CMediaFileListD1Ev @ 8 NONAME
+	_ZN14CMediaFileListD2Ev @ 9 NONAME
+	_ZTI14CMediaFileList @ 10 NONAME ; #<TI>#
+	_ZTV14CMediaFileList @ 11 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/group/MediaFileList.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MMP file of mediafilelist. Information require by
+*              this project. Provide a UI for selecting a ring tong 
+*              from media files.
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          MediaFileList.dll
+TARGETTYPE      DLL
+
+UID             0x1000008d 0x20015A2B
+VENDORID 	VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+START RESOURCE  ../Src/mediafilelist.rss
+  HEADER
+  TARGETPATH    RESOURCE_FILES_DIR
+  LANGUAGE_IDS
+END
+
+
+SOURCEPATH  ../Src
+SOURCE      mediafiledialog.cpp
+SOURCE      mediafiledialogstate.cpp
+SOURCE      mediafiledialogutils.cpp
+SOURCE      mediafilehandler.cpp
+SOURCE      mediafilelist.cpp
+SOURCE      mediafilepreview.cpp
+SOURCE      mediafilewaitnote.cpp
+SOURCE      mediafileprotection.cpp
+SOURCE      mediafilevariation.cpp
+SOURCE      mediafilevideopreviewdialog.cpp
+SOURCE      mediafiletest.cpp
+
+
+USERINCLUDE    ../Inc
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/mmf/common
+
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib
+LIBRARY   cone.lib
+LIBRARY   efsrv.lib
+LIBRARY   eikcoctl.lib
+LIBRARY   euser.lib
+LIBRARY   commonengine.lib
+LIBRARY   eikcore.lib
+LIBRARY   eikctl.lib
+LIBRARY   AknSkins.lib
+LIBRARY   FeatMgr.lib
+LIBRARY   platformenv.lib
+LIBRARY	  centralrepository.lib
+LIBRARY	  ws32.lib // RWindow methods
+LIBRARY   ecom.lib
+LIBRARY   eikdlg.lib
+LIBRARY   estor.lib
+LIBRARY   apgrfx.lib  // RApaLsSession
+LIBRARY   apmime.lib  // TDataType
+LIBRARY   CdlEngine.lib
+LIBRARY   egul.lib	// CGulIcon 
+LIBRARY	  caf.lib        // Content access framework
+LIBRARY	  cafutils.lib   // Content access framework
+LIBRARY   ProfileEng.lib
+LIBRARY   peninputClient.lib
+LIBRARY   mediaclientaudio.lib
+LIBRARY   DrmAudioPlayUtility.lib
+LIBRARY   mediaclientvideo.lib
+LIBRARY   DRMCommon.lib
+LIBRARY   DrmRights.lib
+LIBRARY   DrmHelper.lib
+LIBRARY	  drmutility.lib
+
+LIBRARY   mdccommon.lib           // mds
+LIBRARY   mdeclient.lib           // mds
+LIBRARY   harvesterclient.lib     // mds
+
+LIBRARY   servicehandler.lib   // CAiwGenericParamList
+LIBRARY   browserlauncher.lib  // CBrowserLauncher
+LIBRARY   CommonUI.lib         // CDocumentHandler
+
+DEBUGLIBRARY flogger.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     This file provides the information required for building
+*     MediaFileList.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE mediafilelist.mif
+  OPTION HEADERFILE mediafilelist.mbg
+  OPTION SOURCES \
+		-c8,8 qgn_indi_ai_nt_music.svg \
+		-c8,8 qgn_prop_mup_audio.svg \
+		-c8,8 qgn_prop_fmgr_file_video.svg \
+		-c8,8 qgn_prop_fmgr_file_voicerec.svg \
+		-c8,8 qgn_prop_mup_artist.svg \
+		-c8,8 qgn_prop_mup_album.svg \
+		-c8,8 qgn_prop_mup_genre.svg \
+		-c8,8 qgn_prop_mup_composer.svg \
+		-c8,8 qgn_prop_link_embd_small.svg \
+		-c8,8 qgn_prop_folder_small.svg \
+		-c8,8 qgn_prop_sml_sync_off.svg \
+		-c8,8 qgn_indi_fmgr_ms_add.svg \
+		-c8,8 qgn_indi_mmc_add.svg \
+		-c8,8 qgn_prop_mce_unknown_read
+END
+
+PRJ_MMPFILES
+
+
+MediaFileList.mmp
+
+PRJ_EXPORTS
+../rom/mediafilelist.iby		CORE_MW_LAYER_IBY_EXPORT_PATH(mediafilelist.iby)
+../rom/mediafilelistResources.iby	LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(mediafilelistResources.iby)
+../loc/MediaFileList.loc		MW_LAYER_LOC_EXPORT_PATH(mediafilelist.loc)
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/group/mediafilelist_icons_aif_scalable_dc.mk	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:   Icons makefiles for project MediaFileList
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=/epoc32/release/$(PLATFORM)/$(CFG)/Z
+else
+ZDIR=/epoc32/data/z
+endif
+
+# ----------------------------------------------------------------------------
+# 
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)/resource/apps
+HEADERDIR=/epoc32/include
+ICONTARGETFILENAME=$(TARGETDIR)/mediafilelist.mif
+HEADERFILENAME=$(HEADERDIR)/mediafilelist.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_indi_ai_nt_music.svg \
+	/c8,8 qgn_prop_mup_audio.svg \
+	/c8,8 qgn_prop_fmgr_file_video.svg \
+	/c8,8 qgn_prop_fmgr_file_voicerec.svg \
+	/c8,8 qgn_prop_mup_artist.svg \
+	/c8,8 qgn_prop_mup_album.svg \
+	/c8,8 qgn_prop_mup_genre.svg \
+	/c8,8 qgn_prop_mup_composer.svg \
+	/c8,8 qgn_prop_link_embd_small.svg \
+	/c8,8 qgn_prop_folder_small.svg \
+	/c8,8 qgn_prop_sml_sync_off.svg \
+	/c8,8 qgn_indi_fmgr_ms_add.svg \
+	/c8,8 qgn_indi_mmc_add.svg \
+	/c8,8 qgn_prop_mce_unknown_read \
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/loc/MediaFileList.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,236 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     This is a localisation file for MediaFileList module.
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined.
+*
+*/
+
+
+
+
+//d: Tone Selection List title.
+//l: title_pane_t2/opt9
+//r:5.1
+#define qtn_tsl_title "Select tone"
+
+//d: Softkey label for previewing video files
+//l: control_pane_t1/opt7
+//r:5.1
+#define text_softkey_preview "Preview"
+
+//d:File format error.
+//l:popup_note_window
+//r:5.1
+#define qtn_tsl_file_format_error "Tone format not supported"
+
+//d:File format error.
+//l:popup_note_window
+//r:5.1
+#define qtn_mp_note_invalid_clip "Invalid clip. Operation cancelled"
+
+//d:File size error.
+//l:popup_note_window
+//r:5.1
+//
+#define qtn_profiles_tone_maxsize_error "Files larger than %N kB cannot be set as ringing tone"
+
+//d: Error message text for non-supported file formats
+//l: popup_note_window
+//r:5.1
+#define qtn_profiles_info_tone_drm_protected "Protected file. Cannot be selected as ringing tone."
+
+//d:Title in wait note that is shown when opening a folder is slow.
+//l:popup_note_wait_window
+//r:5.1
+#define qtn_tsl_wait_note_opening "Opening..."
+
+//d:Title in wait note that is shown when searching media files is slow.
+//l:popup_note_wait_window
+//r:5.1
+#define qtn_tsl_wait_note_searching "Searching..."
+
+//d:Title in wait note that is shown when refreshing media files is slow.
+//l:popup_note_wait_window
+//r:5.1
+#define qtn_tsl_wait_note_updating "Updating..."
+
+//
+// Folder names
+//
+
+//d: Title of the Download tones item.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_download_tones "Download tones"
+ 
+//d: Title of the Tones folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_tones_folder "Tones"
+
+//d: Title of the Music folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_music_folder "Music"
+
+//d: Title of the Videos folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_videos_folder "Videos"
+
+//d: Title of the Recordings folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_recordings_folder "Recordings"
+
+//d: Title of the Default tone item.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_according_to_profile "According to profile"
+
+//d: Title of the Off item.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_off "Off"
+
+//d: Title of the All music folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_all_music_folder "All music"
+
+//d: Title of the Artist folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_artists_folder "Artists"
+
+//d: Title of the Albums folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_albums_folder "Albums"
+
+//d: Title of the Genres folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_genres_folder "Genres"
+
+//d: Title of the Composers folder.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_composers_folder "Composers"
+
+//d: Title of the Artist all folder/view.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_all "All"
+
+
+
+//
+// View names
+//
+
+//d: Navi pane item in Tones view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_tones_view "Tones"
+
+//d: Navi pane item in Music view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_music_view "Music"
+
+//d: Navi pane item in Videos view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_videos_view "Videos"
+
+//d: Navi pane item in Recordings view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_recordings_view "Recordings"
+
+//d: Navi pane item in Find results view
+//d: not in ui spec
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_find_results "Find results (%N)"
+
+//d: Navi pane item in Artists view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_artists_view "Artists"
+
+//d: Navi pane item in Albums view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_albums_view "Albums"
+
+//d: Navi pane item in Genres view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_genres_view "Genres"
+
+//d: Navi pane item in Composers view
+//l: tabs_3_long_active_pane_t1
+//r:5.1
+#define qtn_tsl_composers_view "Composers"
+
+//d: Title of the Unknown folder/view.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_unknown_artist "Unknown"
+
+//d: Title of the Unknown folder/view.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_unknown_album "Unknown"
+
+//d: Title of the Unknown folder/view.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_unknown_genre "Unknown"
+
+//d: Title of the Unknown folder/view.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_unknown_composer "Unknown"
+
+
+
+
+//d: Preview popup metadata field name.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_preview_popup_artist "Artist: "
+
+//d: Preview popup metadata field name.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_preview_popup_album "Album: "
+
+//d: Preview popup metadata field name.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_preview_popup_genre "Genre: "
+
+//d: Preview popup metadata field name.
+//l: heading_pane_t1
+//r:5.1
+#define qtn_tsl_preview_popup_composer "Composer: "
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/rom/mediafilelist.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  IBY file for mediafilelist
+*
+*/
+
+
+#ifndef __MEDIAFILELIST_IBY__
+#define __MEDIAFILELIST_IBY__
+
+file=ABI_DIR\BUILD_DIR\MediaFileList.dll         SHARED_LIB_DIR\MediaFileList.dll
+
+data=DATAZ_\BITMAP_DIR\mediafilelist.mif         BITMAP_DIR\mediafilelist.mif
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/MediaFileList/rom/mediafilelistResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  IBY file for mediafilelist's localization file
+*
+*/
+
+#ifndef __MEDIAFILELIST_RESOURCES_IBY__
+#define __MEDIAFILELIST_RESOURCES_IBY__
+
+//resourcefile for MediaFileList (mediafilelist.iby)
+data=ZRESOURCE\MEDIAFILELIST.RSC                                          RESOURCE_FILES_DIR\MEDIAFILELIST.RSC
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/BMARM/PROFILEENGU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	CreateProfileEngineExtendedL__Fv @ 1 NONAME R3UNUSED ; CreateProfileEngineExtendedL(void)
+	CreateProfileEngineL__Fv @ 2 NONAME R3UNUSED ; CreateProfileEngineL(void)
+	NewL__27CProfileChangeNotifyHandlerP22MProfileChangeObserver @ 3 NONAME R3UNUSED ; CProfileChangeNotifyHandler::NewL(MProfileChangeObserver *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/BWINS/PROFILEENGINEU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	?NewAlertToneSeekerL@ProEngFactory@@SAPAVMProEngAlertToneSeeker@@XZ @ 1 NONAME ; class MProEngAlertToneSeeker * ProEngFactory::NewAlertToneSeekerL(void)
+	?NewEngineL@ProEngFactory@@SAPAVMProEngEngine@@AAVRFs@@@Z @ 2 NONAME ; class MProEngEngine * ProEngFactory::NewEngineL(class RFs &)
+	?NewEngineL@ProEngFactory@@SAPAVMProEngEngine@@XZ @ 3 NONAME ; class MProEngEngine * ProEngFactory::NewEngineL(void)
+	?NewEngineLC@ProEngFactory@@SAPAVMProEngEngine@@AAVRFs@@@Z @ 4 NONAME ; class MProEngEngine * ProEngFactory::NewEngineLC(class RFs &)
+	?NewEngineLC@ProEngFactory@@SAPAVMProEngEngine@@XZ @ 5 NONAME ; class MProEngEngine * ProEngFactory::NewEngineLC(void)
+	?NewNotifyHandlerL@ProEngFactory@@SAPAVMProEngNotifyHandler@@XZ @ 6 NONAME ; class MProEngNotifyHandler * ProEngFactory::NewNotifyHandlerL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/BWINS/PROFILEENGU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,9 @@
+EXPORTS
+	?CreateProfileEngineExtendedL@@YAPAVMProfileEngineExtended@@XZ @ 1 NONAME ; class MProfileEngineExtended * __cdecl CreateProfileEngineExtendedL(void)
+	?CreateProfileEngineL@@YAPAVMProfileEngine@@XZ @ 2 NONAME ; class MProfileEngine * __cdecl CreateProfileEngineL(void)
+	?NewL@CProfileChangeNotifyHandler@@SAPAV1@PAVMProfileChangeObserver@@@Z @ 3 NONAME ; public: static class CProfileChangeNotifyHandler * __cdecl CProfileChangeNotifyHandler::NewL(class MProfileChangeObserver *)
+	?CreateProfileEngineExtendedL@@YAPAVMProfileEngineExtended@@PAVRFs@@@Z @ 4 NONAME ; class MProfileEngineExtended * CreateProfileEngineExtendedL(class RFs *)
+	?CreateProfileEngineL@@YAPAVMProfileEngine@@PAVRFs@@@Z @ 5 NONAME ; class MProfileEngine * CreateProfileEngineL(class RFs *)
+	?ProfileUtilityInstanceL@@YAAAVMProfileUtilitySingleton@@XZ @ 6 NONAME ; class MProfileUtilitySingleton & ProfileUtilityInstanceL(void)
+	?ReleaseProfileUtility@@YAXXZ @ 7 NONAME ; void ReleaseProfileUtility(void)
+
Binary file profilesservices/ProfileEngine/Data/No_Sound.wav has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EABI/ProfileEngU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,9 @@
+EXPORTS
+	_Z20CreateProfileEngineLv @ 1 NONAME
+	_Z28CreateProfileEngineExtendedLv @ 2 NONAME
+	_ZN27CProfileChangeNotifyHandler4NewLEP22MProfileChangeObserver @ 3 NONAME
+	_Z20CreateProfileEngineLP3RFs @ 4 NONAME
+	_Z28CreateProfileEngineExtendedLP3RFs @ 5 NONAME
+	_Z21ReleaseProfileUtilityv @ 6 NONAME
+	_Z23ProfileUtilityInstanceLv @ 7 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EABI/ProfileEngineU.DEF	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN13ProEngFactory10NewEngineLER3RFs @ 1 NONAME
+	_ZN13ProEngFactory10NewEngineLEv @ 2 NONAME
+	_ZN13ProEngFactory11NewEngineLCER3RFs @ 3 NONAME
+	_ZN13ProEngFactory11NewEngineLCEv @ 4 NONAME
+	_ZN13ProEngFactory17NewNotifyHandlerLEv @ 5 NONAME
+	_ZN13ProEngFactory19NewAlertToneSeekerLEv @ 6 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileEngineExtended.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extended profile engine interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEENGINEEXTENDED_H__
+#define __MPROFILEENGINEEXTENDED_H__
+
+//  INCLUDES
+#include <MProfileEngine.h>
+
+// DATA TYPES
+enum TProfileUtilityObjectType
+    {
+    EProfileUtilityObjectPresenceTool      = 0
+    };
+
+// FUNCTION PROTOTYPES
+class MProfileEngineExtended;
+class MProfilesLocalFeatures;
+
+/**
+* Create extended profile engine, ownership transfered.
+*
+*  @lib ProfileEng.lib
+*  @since 2.0
+*/
+IMPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL();
+
+/**
+* Create extended profile engine, ownership transfered.
+*
+*  @param aFs An open file server session, ownership is NOT transferred.
+*  aFs must remain connected for the lifetime of the returned object.
+*  @lib ProfileEng.lib
+*  @since 3.0
+*/
+IMPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL( RFs* aFs );
+
+// FORWARD DECLARATIONS
+class MProfileExtended;
+class MProfilePresence;
+
+// CLASS DECLARATION
+
+/**
+*  Extended profile engine interface.
+*  This interface extend MProfileEngine interface and
+*  offers methods to get profile settings and store profile settings.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileEngineExtended : public MProfileEngine
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileEngineExtended() {};
+
+    public: // New functions
+
+        /**
+        * Create extended profile, ownership transfered.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Instance of the MProfileExtended
+        */
+        virtual MProfileExtended* ProfileLC( TInt aId ) = 0;
+
+        /**
+        * Create extended profile, ownership transfered.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Instance of the MProfileExtended
+        */
+        virtual MProfileExtended* ProfileL( TInt aId ) = 0;
+
+        /**
+        * Store profile settings. Leaves with KErrAccessDenied if one or more
+        * of the settings of the target profile is/are read-only.
+        * @since 2.0
+        * @param aProfile Profile
+        */
+        virtual void CommitChangeL( MProfileExtended& aProfile ) = 0;
+
+        /**
+        * Send presence settings.
+        * @since 2.1
+        * @param aProfile Profile
+        */
+        virtual void SendPresenceSettingsL(
+            const MProfilePresence& aPresence ) = 0;
+
+        /**
+        * Delete profile.
+        * @since 2.1
+        * @param aId Profile ID
+        * @return Error code
+        */
+        virtual TInt DeleteProfileL( TInt aId ) = 0;
+
+        /**
+        * Create new profile, ownership transfered.
+        * @since 2.1
+        * @return Instance of the MProfileExtended
+        */
+        virtual MProfileExtended* CreateProfileL() = 0;
+
+        /**
+        * Returns is profile default profile.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Is profile default profile
+        */
+        virtual TBool IsDefaultProfile( TInt aId ) = 0;
+
+        /**
+        * Returns locally variated features of Profiles.
+        * @since 2.6
+        */
+        virtual MProfilesLocalFeatures& LocalFeatures() = 0;
+
+        /**
+         * Returns an utility object needed for a specific task. The returned
+         * object can be generally of any class and the caller must know what
+         * it wants and cast the returned object to the correct class.
+         * The ownership is not transferred.
+         * @param aType the type of the utility object to be returned.
+         * @param aImpl the utility object needed by the client on return, NULL
+         * if there isn't any of the given type
+         */
+        virtual void GetProfileUtilityObject(
+                TProfileUtilityObjectType aType, TAny*& aImpl ) = 0;
+
+        /**
+        * Set timed active profile. When the time expires the profile which was
+        * active before calling this method will be reactivated.
+        * If ID is incorrect then leave with KErrNotFound.
+        * @since 3.2
+        * @param aId Profile ID
+        * @param aTime time when the profile activation expires
+        */
+        virtual void SetActiveProfileTimedL( TInt aId, TTime aTime ) = 0;
+
+    };
+
+#endif      // __MPROFILEENGINEEXTENDED_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileExtended.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extended profile interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEEXTENDED_H__
+#define __MPROFILEEXTENDED_H__
+
+//  INCLUDES
+#include <MProfile.h>
+
+// DATA TYPES
+enum TProfileFlags
+    {
+    EProfileFlagRingingTone =               0x0001,
+    EProfileFlagRingingType =               0x0002,
+    EProfileFlagRingingVolume =             0x0004,
+    EProfileFlagMessageAlertTone =          0x0008,
+    EProfileFlagInstantMessageAlertTone =   0x0010,
+    EProfileFlagVibratingAlert =            0x0020,
+    EProfileFlagKeypadVolume =              0x0040,
+    EProfileFlagWarningTones =              0x0080,
+    EProfileFlagAlertFor =                  0x0100,
+    EProfileFlagAvailabilityAttribute =     0x0200,
+    EProfileFlagStatusMessage =             0x0400,
+    EProfileFlagProfileName =               0x0800,
+    EProfileFlagEmailAlertTone =            0x1000,
+    EProfileFlagVideoCallRingingTone =      0x2000,
+    EProfileFlagMediaVolume =               0x4000,
+    EProfileFlagTextToSpeechTone =          0x8000,
+//  Free slot              =               0x10000,
+    EProfileFlagPttTone =                  0x20000,
+    EProfileFlagPttStatus =                0x40000,
+    EProfileFlag3DEffect =                 0x80000,
+    EProfileFlag3DEcho =                  0x100000,
+    EProfileFlagTactileFeedback =         0x200000,
+    EProfileFlagAudioFeedback =           0x400000,
+    EProfileFlagAll =                       0xFFFF
+    };
+
+// FORWARD DECLARATIONS
+class MProfileSetName;
+class MProfileSetTones;
+class MProfilePresence;
+class MProfileSetPresence;
+class MProfileSetExtraTones;
+class MProfileSetExtraSettings;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Extended profile interface.
+*  This interface extend MProfile interface.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileExtended : public MProfile
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileExtended() {};
+
+    public: // New functions
+
+        /**
+        * This method set alert for items to the profile.
+        * @since 2.0
+        * @param aAlertFor Alert for item array.
+        */
+        virtual void SetAlertForL(
+            const TArray<TContactItemId>& aAlertFor ) = 0;
+
+        /**
+        * Returns set profile name interface.
+        * @since 2.0
+        * @return Returns set profile name interface.
+        */
+        virtual MProfileSetName& ProfileSetName() const = 0;
+
+        /**
+        * Returns set profile tones interface.
+        * @since 2.0
+        * @return Returns set profile tones interface.
+        */
+        virtual MProfileSetTones& ProfileSetTones() const = 0;
+
+        /**
+        * Returns profile presence interface.
+        * @since 2.0
+        * @return Returns profile presence interface.
+        */
+        virtual const MProfilePresence& ProfilePresence() const = 0;
+
+        /**
+        * Returns set profile presence interface.
+        * @since 2.0
+        * @return Returns set profile presence interface.
+        */
+        virtual MProfileSetPresence& ProfileSetPresence() const = 0;
+
+        /**
+        * Returns set profile extra tones interface.
+        * @since 2.0
+        * @return Returns set profile extra tones interface.
+        */
+        virtual MProfileSetExtraTones& ProfileSetExtraTones() const = 0;
+
+        /**
+        * Returns profile modifiable flags. See TProfileFlags.
+        * @since 2.0
+        * @return Returns profile modifiable flags.
+        */
+        virtual TUint32 ModifiableFlags() const = 0;
+
+        /**
+        * Returns profile visible flags. See TProfileFlags.
+        * @since 2.0
+        * @return Returns profile visible flags.
+        */
+        virtual TUint32 VisibleFlags() const = 0;
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to write the settings
+        */
+        virtual void ExternalizeL( CRepository& aCenRep ) = 0;
+
+        /**
+        * Returns set profile extra settings interface.
+        * @since 3.0
+        * @return set profile extra settings interface.
+        */
+        virtual MProfileSetExtraSettings& ProfileSetExtraSettings() const = 0;
+
+    };
+
+#endif      // __MPROFILEEXTENDED_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfilePresence.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile presence interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEPRESENCE_H
+#define __MPROFILEPRESENCE_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Profile presence interface.
+*  This interface offers methods to get status message and
+*  availability attribute.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfilePresence
+    {
+    protected:  // Destructor
+
+        virtual ~MProfilePresence() {};
+
+    public: // New functions
+
+        /**
+        * Return status message of the profile.
+        * @since 2.1
+        * @return Status message of the profile.
+        */
+        virtual const TDesC& StatusMessage() const = 0;
+
+        /**
+        * Return availability attribute of the profile.
+        * @since 2.1
+        * @return Return availability attribute of the profile.
+        */
+        virtual TUint32 AvailabilityAttribute() const = 0;
+
+    };
+
+#endif      // __MPROFILEPRESENCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSet3DToneSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile set 3D tone settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESET3DTONESETTINGS_H
+#define MPROFILESET3DTONESETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Profile set 3D tone settings interface.
+*  @since 3.1
+*/
+class MProfileSet3DToneSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSet3DToneSettings() {};
+
+    public: // New functions
+
+        /**
+        * Set 3D tone effect of the profile.
+        * @since 3.1
+        */
+        virtual void SetEffect( TProfile3DToneEffect aEffect ) = 0;
+
+        /**
+         * Set 3D tone echo of the profile.
+         * @since 3.1
+         */
+        virtual void SetEcho( TProfile3DToneEcho aEcho ) = 0;
+
+    };
+
+#endif      //  MPROFILESET3DTONESETTINGS_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSetExtraSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESETEXTRASETTINGS_H
+#define MPROFILESETEXTRASETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+class MProfileSetPttSettings;
+class MProfileSetFeedbackSettings;
+class MProfileSet3DToneSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Interface for modifying Profiles extra settings.
+*  @since 3.1
+*/
+class MProfileSetExtraSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetExtraSettings() {};
+
+    public: // New functions
+
+        /**
+         * Returns set profile ptt settings interface.
+         * @return set profile ptt settings interface.
+         * @since 3.1
+         */
+        virtual MProfileSetPttSettings& ProfileSetPttSettings() const = 0;
+
+        /**
+         * Returns set profile feedback settings interface.
+         * @return set profile feedback settings interface.
+         * @since 5.0
+         */
+        virtual MProfileSetFeedbackSettings& ProfileSetFeedbackSettings() const = 0;
+
+        /**
+         * Returns set profile 3D tone settings interface.
+         * @return set profile 3D tone settings interface.
+         * @since 3.1
+         */
+        virtual MProfileSet3DToneSettings& ProfileSet3DToneSettings() const = 0;
+
+    };
+
+#endif      //  MPROFILESETEXTRASETTINGS_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSetExtraTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set profile extra tones interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETEXTRATONES_H
+#define __MPROFILESETEXTRATONES_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Set profile extra tones interface.
+*  This interface offers methods to set IM message alert tone file name.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetExtraTones
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetExtraTones() {};
+
+    public: // New functions
+
+        /**
+        * Set IM message alert tone file name.
+        * @since 2.0
+        * @param aIMMessageAlertTone IM message alert tone.
+        */
+        virtual void SetIMMessageAlertToneL(
+            const TDesC& aIMMessageAlertTone ) = 0;
+
+        /**
+        * Set Email alert tone file name.
+        * @since 2.0
+        * @param aEmailAlertTone Email alert tone.
+        */
+        virtual void SetEmailAlertToneL(
+            const TDesC& aEmailAlertTone ) = 0;
+
+        /**
+        * Set Video call ringing tone file name.
+        * @since 2.6
+        * @param aRingingTone Video call ringing tone file name.
+        */
+        virtual void SetVideoCallRingingToneL(
+            const TDesC& aRingingTone ) = 0;
+
+    };
+
+
+#endif      // __MPROFILESETEXTRATONES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSetFeedbackSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile set feedback settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESETFEEDBACKSETTINGS_H
+#define MPROFILESETFEEDBACKSETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Profile set feedback settings interface.
+*  @since 5.0
+*/
+class MProfileSetFeedbackSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetFeedbackSettings() {};
+
+    public: // New functions
+
+        /**
+        * Set tactile feedback of the profile.
+        * @since 5.0
+        */
+        virtual void SetTactileFeedback( TProfileTactileFeedback aTactileFeedback ) = 0;
+
+        /**
+         * Set audio feedback of the profile.
+         * @since 5.0
+         */
+        virtual void SetAudioFeedback( TProfileAudioFeedback aAudioFeedback ) = 0;
+
+    };
+
+#endif      //  MPROFILESETFEEDBACKSETTINGS_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSetName.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set profile name interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETNAME_H
+#define __MPROFILESETNAME_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Set profile name interface.
+*  This interface offers method to set profile name.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetName
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetName() {};
+
+    public: // New functions
+
+        /**
+        * Set name of the profile.
+        * @since 2.0
+        * @param aName Name of the profile.
+        */
+        virtual void SetNameL( const TDesC& aName ) = 0;
+
+    };
+
+#endif      // __MPROFILESETNAME_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSetPresence.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set profile presence settings interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETPRESENCE_H
+#define __MPROFILESETPRESENCE_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Set profile presence settings interface.
+*  This interface offers methods to set profile status message and
+*  availability attribute.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetPresence
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetPresence() {};
+
+    public: // New functions
+
+        /**
+        * Set status message of the profile.
+        * @since 2.0
+        * @param aStatusMessage status message of the profile.
+        */
+        virtual void SetStatusMessageL( const TDesC& aStatusMessage ) = 0;
+
+        /**
+        * Set availability attribute of the profile.
+        * @since 2.0
+        * @param aAvailabilityAttribute Availability attribute of the profile.
+        */
+        virtual void SetAvailabilityAttribute(
+            const TUint32 aAvailabilityAttribute ) = 0;
+    };
+
+#endif      // __MPROFILESETPRESENCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSetPttSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile set PTT settings interface.
+*
+*/
+
+
+
+#ifndef MPROFILESETPTTSETTINGS_H
+#define MPROFILESETPTTSETTINGS_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Profile set PTT settings interface.
+*  @since 3.1
+*/
+class MProfileSetPttSettings
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetPttSettings() {};
+
+    public: // New functions
+
+        /**
+        * Set PTT ringing tone file name.
+        * @since 3.1
+        */
+        virtual void SetPttRingingToneL( const TDesC& aPttRingingTone ) = 0;
+
+        /**
+         * Set PTT status of the profile.
+         * @since 3.1
+         */
+        virtual void SetPttStatus( TProfilePttStatus aPttStatus ) = 0;
+
+    };
+
+#endif      //  MPROFILESETPTTSETTINGS_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileSetTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Set tone settings interface.
+*
+*/
+
+
+
+#ifndef __MPROFILESETTONES_H
+#define __MPROFILESETTONES_H
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+struct TProfileToneSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Set tone settings interface.
+*  This interface offers methods to set line 1 and 2 ringing tone,
+*  message alert tone and tone settings.
+*
+*  @lib N/A
+*  @since 2.0
+*/
+class MProfileSetTones
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileSetTones() {};
+
+    public: // New functions
+
+        /**
+        * Set line 1 ringing tone.
+        * @since 2.0
+        * @param aRingingTone File name of the ringing tone.
+        */
+        virtual void SetRingingTone1L( const TDesC& aRingingTone ) = 0;
+
+        /**
+        * Set line 2 ringing tone.
+        * @since 2.0
+        * @param aRingingTone File name of the ringing tone.
+        */
+        virtual void SetRingingTone2L( const TDesC& aRingingTone ) = 0;
+
+        /**
+        * Set message alert tone.
+        * @since 2.0
+        * @param aMessageAlertTone File name of the message alert tone.
+        */
+        virtual void SetMessageAlertToneL(
+            const TDesC& aMessageAlertTone ) = 0;
+
+        /**
+        * Set tone settings of the profile.
+        * @since 2.0
+        * @return Tone settings structure.
+        */
+        virtual TProfileToneSettings& SetToneSettings() = 0;
+
+    };
+
+#endif      // __MPROFILESETTONES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfileUtilitySingleton.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile Utility interface.
+*
+*/
+
+
+
+#ifndef __MPROFILEUTILITYSINGLETON_H__
+#define __MPROFILEUTILITYSINGLETON_H__
+
+//  INCLUDES
+
+// FORWARD DECLARATIONS
+class MProfileUtilitySingleton;
+class MProfilesLocalFeatures;
+
+// FUNCTION PROTOTYPES
+/**
+* Return reference to MProfileUtilitySingleton instance. Create it if
+* necessary. For each succesful InstanceL() call there must be a corres-
+* ponding Release() call, so that the internal reference counting works.
+* @since 3.2
+* @return Reference to the only MProfileUtilitySingleton instance.
+*/
+IMPORT_C MProfileUtilitySingleton& ProfileUtilityInstanceL();
+
+/**
+* Release the resources of MProfileUtilitySingleton (when there are no
+* references to it anymore). For each succesful InstanceL() call there
+* must be a corresponding Release() call, so that the internal
+* reference counting works.
+* @since 3.2
+*/
+IMPORT_C void ReleaseProfileUtility();
+
+
+// CLASS DECLARATION
+/**
+*  Profile utility class.
+*
+*  @lib profileeng.lib
+*  @since 3.2
+*/
+class MProfileUtilitySingleton
+    {
+    protected:  // Destructor
+
+        virtual ~MProfileUtilitySingleton() {};
+
+    public: // New functions
+
+        /**
+        * Returns a reference to MProfilesLocalFeatures instance owned by
+        * this MProfileUtility instance.
+        * @since 3.2
+        */
+        virtual MProfilesLocalFeatures& ProfilesLocalFeatures() = 0;
+
+    };
+
+#endif      // __MPROFILEUTILITYSINGLETON_H__
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/MProfilesLocalFeatures.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for locally variated features of Profiles.
+*
+*/
+
+
+
+#ifndef __MPROFILESLOCALFEATURES_H__
+#define __MPROFILESLOCALFEATURES_H__
+
+// CLASS DECLARATION
+
+/**
+*  Profiles local feature variation interface.
+*  MProfilesLocalFeatures offers simple interface to get locally variated
+*  features of Profiles.
+*  How to use:
+*  Get local features object with MProfileEngineExtended::LocalFeaturesL().
+*     MProfilesLocalFeatures& features = iProfileEngine->LocalFeatures();
+*  Check whether a feature is supported (use the ID:s defined in
+*  ProfilesVariant.hrh):
+*     if( features.IsFeatureSupported( KFeatureIdSomeFeature ) )
+*         {
+*         // do stuff
+*         }
+*
+*  @lib N/A
+*  @since 2.6
+*/
+class MProfilesLocalFeatures
+    {
+    protected:  // Destructor
+
+        virtual ~MProfilesLocalFeatures() {};
+
+    public: // New functions
+
+        /**
+        * Checks if the given feature is supported or not.
+        * @since 2.6
+        * @return ETrue if the feature is supported, EFalse otherwise.
+        */
+        virtual TBool IsFeatureSupported( TInt aFeatureId ) const = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from using as
+         * an alert tone.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked, EFalse otherwise.
+         */
+        virtual TBool IsBlockedType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from using as
+         * an alert tone if the alert tone file of the type is unprotected.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked if the alert tone file is
+         *         unprotected, EFalse otherwise.
+         */
+        virtual TBool IsBlockedUnprotectedType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from using as
+         * an alert tone if the alert tone file of the type is protected.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked if the alert tone file is
+         *         protected, EFalse otherwise.
+         */
+        virtual TBool IsBlockedProtectedType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly blocked from demo
+         * playing.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is blocked from demo-playing,
+         *         EFalse otherwise.
+         */
+        virtual TBool IsBlockedDemoPlayType( const TDesC& aMimeType ) = 0;
+
+        /**
+         * Checks if the given MIME-type is explicitly excluded from the tone
+         * selection list. Also when tried to be set as alert tones through
+         * other means, should behave as the tone would be in blocked type list.
+         * @since 3.1
+         * @param aMimeType the MIME-type to be checked.
+         * @return ETrue if the MIME-type is excluded from the tone selection
+         *         list, EFalse otherwise.
+         */
+        virtual TBool IsExcludedType( const TDesC& aMimeType ) = 0;
+    };
+
+#endif      //  __MPROFILESLOCALFEATURES_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/ProfileEng.hrh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine enumeration TProfileSettingKeyType
+*		and TProfileSettingId.
+*
+*/
+
+
+#ifndef __PROFILEENG_HRH__
+#define __PROFILEENG_HRH__
+
+#define PROFILES_ENGINE_RESOURCE_SIGNATURE 75
+#define PROFILES_MAX_NAME_LENGTH           64
+#define PROFILES_MAX_STATUS_MSG_LENGTH     40
+#define PROFILES_MAX_CALL_OBJECT_TEXT_LENGTH 1000
+
+// DATA TYPES
+enum TProfileSettingKeyType
+    {
+    EProfileSettingKeyTypeInt = 0,
+    EProfileSettingKeyTypeString = 1,
+    EProfileSettingKeyTypeBin = 2,
+    EProfileSettingKeyTypeReal = 3
+    };
+
+enum TProfileSettingId
+    {
+    EProfileSettingIdModifiableFlags = 0x00000000,
+    EProfileSettingIdVisibleFlags = 0x00000001,
+    EProfileSettingIdProfileName = 0x00000002,
+    EProfileSettingIdAlertForGroups = 0x00000003,
+    EProfileSettingIdRingingTone = 0x00000004,
+    EProfileSettingIdRingingTone2 = 0x00000005,
+    EProfileSettingIdMsgTone = 0x00000006,
+    EProfileSettingIdRingingType = 0x00000007,
+    EProfileSettingIdKeypadVolume = 0x00000008,
+    EProfileSettingIdRingingVolume = 0x00000009,
+    EProfileSettingIdVibra = 0x0000000A,
+    EProfileSettingIdWarnAndGameTones = 0x0000000B,
+    EProfileSettingIdImTone = 0x0000000C,
+    EProfileSettingIdEmailTone = 0x0000000D,
+    EProfileSettingIdVideoCallTone = 0x0000000E,
+    EProfileSettingIdStatusMsg = 0x0000000F,
+    EProfileSettingIdAvailAttribute = 0x00000010,
+    EProfileSettingIdMediaVolume = 0x00000011,
+    EProfileSettingIdTextToSpeechTone = 0x00000012,
+    EProfileSettingIdNameChanged = 0x00000013,
+    EProfileSettingIdCallObjectContent = 0x00000014,
+    EProfileSettingIdPttTone = 0x00000015,
+    EProfileSettingIdPttStatus = 0x00000016,
+    EProfileSettingId3DEffect = 0x00000017,
+    EProfileSettingId3DEcho = 0x00000018,
+    EProfileSettingIdTactileFeedback = 0x00000019,
+    EProfileSettingIdAudioFeedback = 0x0000001A,
+    EProfileSettingIdEmailVibra=0x0000001B
+    };
+
+#endif // __PROFILEENG_HRH__
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/ProfileEng.rh	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine resource structures.
+*
+*/
+
+
+//  STRUCTURE DEFINITIONS
+
+// -----------------------------------------------------------------------------
+// DEFAULT_PROFILES
+// Default profiles
+// -----------------------------------------------------------------------------
+//
+STRUCT DEFAULT_PROFILES
+    {
+    STRUCT items[];
+    }
+
+// -----------------------------------------------------------------------------
+// PROFILE
+// profile default name and ID
+// -----------------------------------------------------------------------------
+//
+STRUCT PROFILE
+    {
+    LONG id = 0;
+    LTEXT name = "";
+    LTEXT shortname = "";
+    LTEXT naviname = "";
+    LTEXT titlename = "";
+    }
+
+// -----------------------------------------------------------------------------
+// PROFILE_SETTINGS
+// Profile settings
+// -----------------------------------------------------------------------------
+//
+STRUCT PROFILE_SETTINGS
+    {
+    STRUCT items[];
+    }
+
+// -----------------------------------------------------------------------------
+// PROFILE SETTING
+// profile setting for dynamic profiles
+// -----------------------------------------------------------------------------
+//
+STRUCT PROFILE_SETTING
+    {
+    LONG id = 0;
+    LONG key_type = 0;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/ProfileEngineConstants.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine constants
+*
+*/
+
+
+
+#ifndef PROFILEENGINECONSTANTS_H
+#define PROFILEENGINECONSTANTS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "ProfileEng.hrh"
+
+// CONSTANTS
+const TInt KProfileFileEstimationSize( 400 );
+const TInt KProfilesMaxNumberOfDynamicProfiles( 20 );
+const TInt KProfilesMaxTIntLength( 11 );
+const TInt KProfileMaxNameLength( PROFILES_MAX_NAME_LENGTH );
+const TInt KProfileMaxCallObjectTextLength( 1000 );
+const TInt KProfileBaseDynamicProfileId( 30 );    // first dynamic profile ID
+// Used for profile settings cenrep-keys - profile id is encoded in the MSB:
+const TInt KProfileIdShift( 24 );    
+
+_LIT( KProfileDriveC,           "c:" );
+_LIT( KProfileDriveZ,           "z:" );
+_LIT( KProfileFilePrefix,       "Profile" );
+_LIT( KProfileFileExtension,    ".dat" );
+_LIT( KProfileFilePath,         "\\System\\Data\\Profiles\\" );
+_LIT( KProfileEngineResourceDriveAndDir, "Z:ProfileEng.rsc" );
+_LIT( KProfileMutexName,        "ProfileFileAccessMutexName" );
+
+#endif      // PROFILEENGINECONSTANTS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/ProfileEngineInternalCRKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine internal Central Repository keys.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEINTERNALCRKEYS_H
+#define PROFILEENGINEINTERNALCRKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <ProfileEngineDomainCRKeys.h>
+
+// CONSTANTS
+
+/**
+ * Information about whether self recorded tones can be used as ringing tones
+ * or not. Integer value.
+ *
+ * Possible values:
+ *
+ * 0 (disabled)
+ * 1 (enabled)
+ */
+const TUint32 KProEngRecordedRingingTones = 0x80000100;
+
+/**
+ * If this is true, DRM protected MP4 tones are not allowed as ringing tones.
+ *
+ * Possible values:
+ *
+ * 0 (allowed, default)
+ * 1 (not allowed)
+ */
+const TUint32 KProEngNoDrmMP4RingingTones = 0x80000101;
+
+/**
+ * If this is true, WMA tones are not allowed as ringing tones.
+ *
+ * Possible values:
+ *
+ * 0 (allowed, default)
+ * 1 (not allowed)
+ */
+const TUint32 KProEngNoWmaRingingTones = 0x80000102;
+
+/**
+ * Tactile feedback setting for the currently active profile.
+ * THIS COULD BE MOVED TO THE SDK HEADER LATER?
+ *
+ * Possible values:
+ *
+ * 0 (Off)
+ * 1 (Level 1)
+ * 2 (Level 2)
+ * 3 (Level 3)
+ */
+const TUint32 KProEngActiveTactileFeedback = 0x7E000019;
+
+/**
+ * Audio feedback setting for the currently active profile.
+ * THIS COULD BE MOVED TO THE SDK HEADER LATER?
+ *
+ * Possible values:
+ *
+ * 0 (Off)
+ * 1 (Level 1)
+ * 2 (Level 2)
+ * 3 (Level 3)
+ */
+const TUint32 KProEngActiveAudioFeedback = 0x7E00001A;
+
+
+#endif      // PROFILEENGINEINTERNALCRKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/ProfileEngineInternalPSKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine internal Publish & Subscribe keys.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEINTERNALPSKEYS_H
+#define PROFILEENGINEINTERNALPSKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+const TUid KPSUidProfileEngine = {0x101F879F};
+
+#endif      // PROFILEENGINEINTERNALPSKEYS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,439 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine private Central Repository keys
+*
+*/
+
+
+
+#ifndef PROFILEENGINEPRIVATECRKEYS_H
+#define PROFILEENGINEPRIVATECRKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <ProfileEngineInternalCRKeys.h>
+#include "ProfileEng.hrh"
+
+// CONSTANTS
+/**
+ * List of IDs used for user-created profiles. Binary.
+ *
+ * Default value is empty (0-length byte array).
+ */
+const TUint32 KProEngUsedIds               = 0x80000002;
+
+/**
+ * If the current active profile is timed, this contains the ID of the previous
+ * active profile (in other words, the profile which should be activated after
+ * timer goes off). Integer.
+ * Default value: -1
+ */
+const TUint32 KProEngPreviousActiveId      = 0x80000003;
+
+/**
+ * If the current active profile is timed, this contains the scheduler handle
+ * ID for the task for the profile deactivation. Integer.
+ * Default value: -1
+ */
+const TUint32 KProEngSchedulerHandleId     = 0x80000004;
+
+/**
+ * If the current active profile is timed, this contains the scheduler task
+ * ID for the profile deactivation. Integer.
+ * Default value: -1
+ */
+const TUint32 KProEngSchedulerTaskId       = 0x80000005;
+
+//
+// The rest of the constants are used with profile-specific settings. The
+// actual key for a setting of a profile must be constructed as follows:
+//
+//   (PROFILE_ID << 32) & SETTING_CONSTANT
+//
+
+/**
+ * Bitmask used to indicate which of the settings in Profiles are allowed to
+ * be modified by the user. Integer.
+ *
+ * Default value: 0x000037FF for General (id == 0) profile
+ *                0x000000EC for Off-line profile
+ *                0x00003FFF for other profiles
+ */
+const TUint32 KProEngModifiableFlags       = EProfileSettingIdModifiableFlags;
+
+/**
+ * Bitmask used to indicate which of the settings in Profiles should be
+ * visible to the user. Integer.
+ *
+ * Default value: 0x000037FF for General (id == 0) profile
+ *                0x000000EC for Off-line profile
+ *                0x00003FFF for other profiles
+ */
+const TUint32 KProEngVisibleFlags          = EProfileSettingIdVisibleFlags;
+
+/**
+ * The user-given name of the profile. String.
+ *
+ * Default value must be empty string.
+ */
+const TUint32 KProEngProfileName           = EProfileSettingIdProfileName;
+
+/**
+ * List of Contact group IDs. Binary.
+ *
+ * Default value must be empty.
+ */
+const TUint32 KProEngAlertForGroups        = EProfileSettingIdAlertForGroups;
+
+/**
+ * The path to the tone file to be used as (line 1) ringing tone. String.
+ *
+ * Default values:
+ *
+ *   General (0):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Silent (1):   "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Meeting (2):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Outdoor (3):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Pager (4):    "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Off-line (5): "Z:\\resource\\No_Sound.wav
+ */
+const TUint32 KProEngRingingTone           = EProfileSettingIdRingingTone;
+
+/**
+ * The path to the tone file to be used as line 2 ringing tone. String.
+ *
+ * Default values:
+ *
+ *   General (0):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Silent (1):   "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Meeting (2):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Outdoor (3):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Pager (4):    "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Off-line (5): "Z:\\resource\\No_Sound.wav
+ */
+const TUint32 KProEngRingingTone2          = EProfileSettingIdRingingTone2;
+
+/**
+ * The path to the tone file to be used as SMS alert tone. String.
+ *
+ * Default values:
+ *
+ *   General (0):  "Z:\\Nokia\\Sounds\\Digital\\Message 1.mid"
+ *   Silent (1):   "Z:\\resource\\No_Sound.wav
+ *   Meeting (2):  "Z:\\Nokia\\Sounds\\Simple\\Beep twice.rng"
+ *   Outdoor (3):  "Z:\\Nokia\\Sounds\\Digital\\Message 1.mid"
+ *   Pager (4):    "Z:\\Nokia\\Sounds\\Digital\\Message 1.mid"
+ *   Off-line (5): "Z:\\Nokia\\Sounds\\Digital\\Message 1.mid"
+ */
+const TUint32 KProEngMsgTone               = EProfileSettingIdMsgTone;
+
+/**
+ * Ringing type of the profile. Integer.
+ *
+ * Default values:
+ *
+ *   General (0):  0
+ *   Silent (1):   4
+ *   Meeting (2):  3
+ *   Outdoor (3):  0
+ *   Pager (4):    4
+ *   Off-line (5): 0
+ */
+const TUint32 KProEngRingingType           = EProfileSettingIdRingingType;
+
+/**
+ * Volume of the keypad tones of the profile. Integer.
+ *
+ * Default values:
+ *
+ *   General (0):  2
+ *   Silent (1):   0
+ *   Meeting (2):  0
+ *   Outdoor (3):  3
+ *   Pager (4):    2
+ *   Off-line (5): 2
+ */
+const TUint32 KProEngKeypadVolume          = EProfileSettingIdKeypadVolume;
+
+/**
+ * Volume used when playing an alert tone. Integer (1-10).
+ *
+ * Default values:
+ *
+ *   General (0):  7
+ *   Silent (1):   1
+ *   Meeting (2):  1
+ *   Outdoor (3):  10
+ *   Pager (4):    7
+ *   Off-line (5): 7
+ */
+const TUint32 KProEngRingingVolume         = EProfileSettingIdRingingVolume;
+
+/**
+ * This value indicates whether vibra should be on or off. Integer (0 or 1).
+ *
+ * Default values:
+ *
+ *   General (0):  0
+ *   Silent (1):   0
+ *   Meeting (2):  0
+ *   Outdoor (3):  1
+ *   Pager (4):    1
+ *   Off-line (5): 0
+ */
+const TUint32 KProEngVibra                 = EProfileSettingIdVibra;
+
+/**
+ * This value indicates whether Email vibra should be on or off. Integer (0 or 1).
+ *
+ * Default values:
+ *
+ *   General (0):  0
+ *   Silent (1):   0
+ *   Meeting (2):  0
+ *   Outdoor (3):  1
+ *   Pager (4):    1
+ *   Off-line (5): 0
+ */
+const TUint32 KProEngEmailVibra                 = EProfileSettingIdEmailVibra;
+
+/**
+ * This value indicates whether warning and game tones should be on or off.
+ * Integer (0 or 1).
+ *
+ * Default values:
+ *
+ *   General (0):  1
+ *   Silent (1):   0
+ *   Meeting (2):  0
+ *   Outdoor (3):  1
+ *   Pager (4):    1
+ *   Off-line (5): 1
+ */
+const TUint32 KProEngWarnAndGameTones      = EProfileSettingIdWarnAndGameTones;
+
+/**
+ * NOTE! This key is not used anymore.
+ * The path to the tone file to be used as IM alert tone. String.
+ *
+ * Default values:
+ *
+ *   General (0):  "Z:\\Nokia\\Sounds\\Digital\\Chat alert.mid"
+ *   Silent (1):   "Z:\\resource\\No_Sound.wav
+ *   Meeting (2):  "Z:\\Nokia\\Sounds\\Simple\\Beep twice.rng"
+ *   Outdoor (3):  "Z:\\Nokia\\Sounds\\Digital\\Chat alert.mid"
+ *   Pager (4):    "Z:\\Nokia\\Sounds\\Digital\\Chat alert.mid"
+ *   Off-line (5): "Z:\\resource\\No_Sound.wav
+ */
+const TUint32 KProEngImTone                = EProfileSettingIdImTone;
+
+/**
+ * The path to the tone file to be used as E-mail alert tone. String.
+ *
+ * Default values:
+ *
+ *   General (0):  "Z:\\Nokia\\Sounds\\Digital\\Message 1.mid"
+ *   Silent (1):   "Z:\\resource\\No_Sound.wav
+ *   Meeting (2):  "Z:\\Nokia\\Sounds\\Simple\\Beep twice.rng"
+ *   Outdoor (3):  "Z:\\Nokia\\Sounds\\Digital\\Message 1.mid"
+ *   Pager (4):    "Z:\\Nokia\\Sounds\\Digital\\Message 1.mid"
+ *   Off-line (5): "Z:\\resource\\No_Sound.wav"
+ */
+const TUint32 KProEngEmailTone             = EProfileSettingIdEmailTone;
+
+/**
+ * The path to the tone file to be used as video call ringing tone. String.
+ *
+ * Default values:
+ *
+ *   General (0):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Silent (1):   "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Meeting (2):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Outdoor (3):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Pager (4):    "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Off-line (5): "Z:\\resource\\No_Sound.wav
+ */
+const TUint32 KProEngVideoCallTone         = EProfileSettingIdVideoCallTone;
+
+/**
+ * NOTE! This key is not currently used as there is no Presence Application.
+ * If the status message of Presence is set to depend on Profiles, this value
+ * contains the status message used with the profile. String.
+ *
+ * Default value must be empty.
+ */
+const TUint32 KProEngStatusMsg             = EProfileSettingIdStatusMsg;
+
+/**
+ * NOTE! This key is not currently used as there is no Presence Application.
+ * If the availability attribute of Presence is set to depend on Profiles, this
+ * contains the value of the attribute. Integer.
+ *
+ * Default values:
+ *
+ *   General (0):  2
+ *   Silent (1):   1
+ *   Meeting (2):  1
+ *   Outdoor (3):  2
+ *   Pager (4):    1
+ *   Off-line (5): 1
+ */
+const TUint32 KProEngAvailAttribute        = EProfileSettingIdAvailAttribute;
+
+/**
+ * NOTE! This key is not used anymore.
+ * Volume setting used by different media playing applications. Integer.
+ *
+ * Default values:
+ *
+ *   General (0):  7
+ *   Silent (1):   1
+ *   Meeting (2):  1
+ *   Outdoor (3):  10
+ *   Pager (4):    7
+ *   Off-line (5): 7
+ */
+const TUint32 KProEngMediaVolume           = EProfileSettingIdMediaVolume;
+
+/**
+ * This integer key indicates whether text-to-speech ringing tone is on (1)
+ * or off (0).
+ *
+ * Default value: 0 for all profiles
+ */
+const TUint32 KProEngTextToSpeechTone      = EProfileSettingIdTextToSpeechTone;
+
+/**
+ * This integer key indicates if the user has changed the name of the profile.
+ * This information is needed by Profiles Engine to decide whether the name
+ * should be localised or not.
+ *
+ * Not changed:    0
+ * Changed:        1
+ *
+ * Default value: 0
+ */
+const TUint32 KProEngNameChanged           = EProfileSettingIdNameChanged;
+
+/**
+ * NOTE! This key is not used anymore.
+ * This String key contains either the text of the call object if the selected
+ * type is Text (= 2) or the path to the image file if the type is Image (= 3).
+ *
+ * Default value: empty string
+ */
+const TUint32 KProEngCallObjectContent     = EProfileSettingIdCallObjectContent;
+
+/**
+ * Contains the Push to talk ringing tone used with the profile. String.
+ *
+ * Default values:
+ *
+ *   General (0):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Silent (1):   "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Meeting (2):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Outdoor (3):  "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Pager (4):    "Z:\\Nokia\\Sounds\\Digital\\Nokia Tune.mid"
+ *   Off-line (5): "Z:\\resource\\No_Sound.wav
+ */
+const TUint32 KProEngPttTone             = EProfileSettingIdPttTone;
+
+/**
+ * Contains the push to talk status value of this profile. Integer.
+ *
+ * Possible values:
+ *
+ *  0 (EProfilePttActive)
+ *  1 (EProfilePttSilent)
+ *  2 (EProfilePttDoNotDisturb)
+ *
+ * Default value: 1 for all profiles
+ *
+ */
+const TUint32 KProEngPttStatus           = EProfileSettingIdPttStatus;
+
+/**
+ * Contains the 3D effect value of this profile. Integer.
+ *
+ * Possible values:
+ *
+ *  0 (EProfile3DEffectOff)
+ *  1 (EProfile3DEffectCircle)
+ *  2 (EProfile3DEffectFlyby)
+ *  3 (EProfile3DEffectZigZag)
+ *  4 (EProfile3DEffectRandomWalk)
+ *  5 (EProfile3DEffectChaos)
+ *  6 (EProfile3DEffectStereoWidening)
+ *
+ * Default value: 0 for all profiles
+ *
+ */
+const TUint32 KProEng3DToneEffect           = EProfileSettingId3DEffect;
+
+/**
+ * Contains the 3D echo value of this profile. Integer.
+ *
+ * Possible values:
+ *
+ *  0 (EProfile3DEchoOff)
+ *  1 (EProfile3DEchoLivingRoom)
+ *  2 (EProfile3DEchoCave)
+ *  3 (EProfile3DEchoStoneCorridor)
+ *  4 (EProfile3DEchoForest)
+ *  5 (EProfile3DEchoSewerPipe)
+ *
+ * Default value: 0 for all profiles
+ *
+ */
+const TUint32 KProEng3DToneEcho           = EProfileSettingId3DEcho;
+
+/**
+ * Contains the tactile feedback value of this profile. Integer.
+ *
+ * Possible values:
+ *
+ *  0 (EProfileTactileFeedbackOff)
+ *  1 (EProfileTactileFeedbackLevel1)
+ *  2 (EProfileTactileFeedbackLevel2)
+ *  3 (EProfileTactileFeedbackLevel3)
+ *
+ * Default value: 0 for Silent and Public/Drive, 1 for all others 
+ *
+ */
+const TUint32 KProEngTactileFeedback           = EProfileSettingIdTactileFeedback;
+
+/**
+ * Contains the audio feedback value of this profile. Integer.
+ *
+ * Possible values:
+ *
+ *  0 (EProfileAudioFeedbackOff)
+ *  1 (EProfileAudioFeedbackLevel1)
+ *  2 (EProfileAudioFeedbackLevel2)
+ *  3 (EProfileAudioFeedbackLevel3)
+ *
+ * Default value: 0 for all profiles
+ *
+ */
+const TUint32 KProEngAudioFeedback           = EProfileSettingIdAudioFeedback;
+
+
+/**
+ * The id used for storing the default settings for user created profiles.
+ */
+const TInt KProEngDefaultProfileId = 0x007F;
+
+#endif      // PROFILEENGINEPRIVATECRKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngInc/ProfileEnginePrivatePSKeys.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles engine internal Publish & Subscribe keys.
+*
+*/
+
+
+
+#ifndef PROFILEENGINEPRIVATEPSKEYS_H
+#define PROFILEENGINEPRIVATEPSKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "ProfileEngineInternalPSKeys.h"
+
+// CONSTANTS
+
+/**
+ * A setting in the current active profile was modified. This is used
+ * internally by Profiles Engine notification mechanism.
+ * Default value: 0.
+ */
+const TUint32 KProEngActiveProfileModified = 0x7D000001;
+
+/**
+ * The current active profile has changed (or the active profile has been
+ * reactivated). This is used internally by Profiles Engine notification
+ * mechanism.
+ * Default value: 0.
+ */
+const TUint32 KProEngActiveProfileChanged = 0x7D000002;
+
+/**
+ * Power save mode has changed.
+ * This is used internally by Profiles Engine.
+ * Default value: 0.
+ */
+const TUint32 KProEngPsmChanged = 0x7D000003;
+
+#endif      // PROFILEENGINEPRIVATEPSKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfile3DToneSettingsImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfile3DToneSettingsImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfile3DToneSettingsImpl.h"
+#include <centralrepository.h>
+#include "ProfileEngUtils.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfilesDebug.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfile3DToneSettingsImpl* CProfile3DToneSettingsImpl::NewL()
+    {
+    CProfile3DToneSettingsImpl* self = new( ELeave ) CProfile3DToneSettingsImpl;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfile3DToneSettingsImpl* CProfile3DToneSettingsImpl::NewL(
+    const MProfile3DToneSettings& aProfile3DToneSettings )
+    {
+    CProfile3DToneSettingsImpl* self = new( ELeave ) CProfile3DToneSettingsImpl;
+
+    self->iEffect = aProfile3DToneSettings.Effect();
+    self->iEcho = aProfile3DToneSettings.Echo();
+
+    return self;
+    }
+
+
+// Destructor
+CProfile3DToneSettingsImpl::~CProfile3DToneSettingsImpl()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::InternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfile3DToneSettingsImpl::InternalizeL( CRepository& aCenRep,
+                                               TInt aProfileId )
+    {
+    PRODEBUG( "CProfile3DSettings::InternalizeL begin" );
+    TInt tmp( 0 );
+    // 3D effect
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEng3DToneEffect,
+            aProfileId ), tmp ) );
+    iEffect = TProfile3DToneEffect( tmp );
+
+    // 3D echo
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEng3DToneEcho,
+            aProfileId ), tmp ) );
+    iEcho = TProfile3DToneEcho( tmp );
+    PRODEBUG( "CProfile3DSettings::InternalizeL return" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::ExternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfile3DToneSettingsImpl::ExternalizeL( CRepository& aCenRep,
+                                               TInt aProfileId ) const
+    {
+    // 3D effect
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEng3DToneEffect,
+            aProfileId ), iEffect ) );
+
+    // 3D echo
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEng3DToneEcho,
+            aProfileId ), iEcho ) );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::Effect
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfile3DToneEffect CProfile3DToneSettingsImpl::Effect() const
+    {
+    return iEffect;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::SetEffect
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfile3DToneSettingsImpl::SetEffect( TProfile3DToneEffect aEffect )
+    {
+    iEffect = aEffect;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::Echo
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfile3DToneEcho CProfile3DToneSettingsImpl::Echo() const
+    {
+    return iEcho;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3DToneSettingsImpl::SetEcho
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfile3DToneSettingsImpl::SetEcho( TProfile3DToneEcho aEcho )
+    {
+    iEcho = aEcho;
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfile3DToneSettingsImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile 3D tone settings implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILE3DTONESETTINGSIMPL_H
+#define __CPROFILE3DTONESETTINGSIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MProfile3DToneSettings.h>
+#include "MProfileSet3DToneSettings.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Profile extra tones implementation.
+*
+*  @lib ProfileEng.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS(CProfile3DToneSettingsImpl) : public CBase,
+                               public MProfile3DToneSettings,
+                               public MProfileSet3DToneSettings
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfile3DToneSettingsImpl* NewL();
+        static CProfile3DToneSettingsImpl* NewL(
+                const MProfile3DToneSettings& aProfile3DToneSettings );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfile3DToneSettingsImpl();
+
+    public: // New functions
+
+        /**
+        * Internalize data from the central repository.
+        * @since 3.1
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 3.1
+        * @param aCenRep Central Repository object to write the settings
+        */
+        void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfile3DToneSettings.
+        */
+        TProfile3DToneEffect Effect() const;
+
+        /**
+        * From MProfile3DToneSettings.
+        */
+        TProfile3DToneEcho Echo() const;
+
+        /**
+        * From MProfileSet3DToneSettings.
+        */
+        void SetEffect( TProfile3DToneEffect aEffect );
+
+        /**
+        * From MProfileSet3DToneSettings.
+        */
+        void SetEcho( TProfile3DToneEcho aEcho );
+
+    private:    // Data
+
+        // 3D effect
+        TProfile3DToneEffect iEffect;
+
+        // 3D echo
+        TProfile3DToneEcho iEcho;
+    };
+
+#endif      // __CPROFILE3DTONESETTINGSIMPL_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileChangeNotifyHandler
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileChangeNotifyHandler.h"
+#include "MProfileChangeObserver.h"
+#include "ProfileEngPanic.h"
+#include "ProfileEngineSDKCRKeys.h"
+#include "ProfileEnginePrivatePSKeys.h"
+#include <centralrepository.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::CProfileChangeNotifyHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileChangeNotifyHandler::CProfileChangeNotifyHandler(
+    MProfileChangeObserver* aProfileChangeObserver )
+    : iProfileChangeObserver( aProfileChangeObserver )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeNotifyHandler::ConstructL()
+    {
+    iPSObserver = new ( ELeave ) CProfilePSObserver(
+            KProEngActiveProfileModified );
+    iActiveProfileObserver = new ( ELeave ) CProfilePSObserver(
+            KProEngActiveProfileChanged );
+    iPSObserver->iProfileChangeObserver = iProfileChangeObserver;
+    iActiveProfileObserver->iProfileChangeObserver = iProfileChangeObserver;
+    iRepository = CRepository::NewL( KCRUidProfileEngine );
+    iActiveProfileObserver->iCenRep = iRepository;
+    iPSObserver->iCenRep = iRepository;
+    iActiveProfileObserver->RequestNotificationL(); 
+    iPSObserver->RequestNotificationL(); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileChangeNotifyHandler* CProfileChangeNotifyHandler::NewL(
+    MProfileChangeObserver* aProfileChangeObserver )
+    {
+    __ASSERT_ALWAYS( aProfileChangeObserver,
+        ProfileEngPanic::Panic( EProfileEngPanicNullPointer ) );
+
+    CProfileChangeNotifyHandler* self =
+        new ( ELeave ) CProfileChangeNotifyHandler(aProfileChangeObserver);
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// Destructor
+CProfileChangeNotifyHandler::~CProfileChangeNotifyHandler()
+    {
+    delete iActiveProfileObserver;
+    delete iPSObserver;
+    delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::CProfilePSObserver::CProfilePSObserver
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfileChangeNotifyHandler::CProfilePSObserver::CProfilePSObserver(
+    TUint32 aPSKey )
+    : CActive( EPriorityNormal ), iPSKey( aPSKey )
+    {
+    CActiveScheduler::Add( this );
+    iAttached = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::CProfilePSObserver::~CProfilePSObserver
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfileChangeNotifyHandler::CProfilePSObserver::~CProfilePSObserver()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::CProfilePSObserver::RequestNotificationL()
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeNotifyHandler::CProfilePSObserver::RequestNotificationL()
+    {
+    if ( !iAttached )
+        {
+        User::LeaveIfError( iProperty.Attach( KPSUidProfileEngine, iPSKey ) );
+        iAttached = ETrue;
+        }
+
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::CProfilePSObserver::RunL()
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeNotifyHandler::CProfilePSObserver::RunL()
+    {
+    RequestNotificationL();
+    // The id of the current active profile is always passed to the observer:
+    TInt profileId( 0 );
+    User::LeaveIfError( iCenRep->Get( KProEngActiveProfile, profileId ) );
+    TProfileEvent evt( iPSKey == KProEngActiveProfileModified ?
+                       EProfileActiveProfileModified :
+                       EProfileNewActiveProfile );
+    iProfileChangeObserver->HandleActiveProfileEventL( evt, profileId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeNotifyHandler::CProfilePSObserver::DoCancel()
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeNotifyHandler::CProfilePSObserver::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1016 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileEngineImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileEngineImpl.h"
+#include <bautils.h> // BaflUtils
+#include <barsc.h> // RResoureFile
+#include <featmgr.h>
+#include <bldvariant.hrh>
+#include <DRMCommon.h>
+#include <sysutil.h>
+
+#include <ProfileEng.rsg>
+#include <TProfileToneSettings.h>
+#include <MProfileTones.h>
+#include "CProfilesNamesArrayImpl.h"
+#include "CProfileImpl.h"
+#include "CProfileNameImpl.h"
+#include "ProfileEngUtils.h"
+#include "MProfileSetName.h"
+#include "ProfileEng.hrh"
+#include "ProfileEngineConstants.h"
+#include "ProfileEngPanic.h"
+#include "MProfileSetTones.h"
+#include "MProfileSetExtraTones.h"
+#include "MProfileExtraSettings.h"
+#include "MProfileFeedbackSettings.h"
+#include "MProfilesLocalFeatures.h"
+#include "MProfileUtilitySingleton.h"
+#include "ProfilesVariant.hrh" // KProEngFeatureIdVTRingingTone
+#include "CProfileTiming.h"
+#include <centralrepository.h>
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfileEnginePrivatePSKeys.h"
+#include <hwrmvibrasdkcrkeys.h>
+#include <data_caging_path_literals.hrh>
+#include "ProfilesDebug.h"
+
+#include <psmsettings.h>
+#include <psmsrvdomaincrkeys.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileEngineImpl* CProfileEngineImpl::NewL()
+    {
+    CProfileEngineImpl* self = CProfileEngineImpl::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileEngineImpl* CProfileEngineImpl::NewLC()
+    {
+    CProfileEngineImpl* self = new ( ELeave ) CProfileEngineImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileEngineImpl* CProfileEngineImpl::NewL( RFs* aFs )
+    {
+    CProfileEngineImpl* self = CProfileEngineImpl::NewLC( aFs );
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileEngineImpl* CProfileEngineImpl::NewLC( RFs* aFs )
+    {
+    CProfileEngineImpl* self = new ( ELeave ) CProfileEngineImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aFs );
+
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ConstructL()
+    {
+    iFs = new ( ELeave ) RFs;
+    iFsOwned = ETrue;
+    User::LeaveIfError( iFs->Connect() );
+    CommonConstructL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ConstructL( RFs* aFs )
+    {
+    iFs = aFs;
+    CommonConstructL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::CommonConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::CommonConstructL()
+    {
+    PRODEBUG( "Profiles Engine CommonConstructL" );
+
+    FeatureManager::InitializeLibL();
+    iSideVolumeKeys = FeatureManager::FeatureSupported( KFeatureIdSideVolumeKeys );
+    
+
+    iCenRep = CRepository::NewL( KCRUidProfileEngine );
+    iVibraCenRep = CRepository::NewL( KCRUidVibraCtrl );
+
+    // Profile Utility must be released in destructor:
+    iFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() );
+    iProfileLocalisedNames = CProfilesNamesArrayImpl::NewL();
+    ReadProfilesNamesFromResourceL();
+
+    iProfileTiming = CProfileTiming::NewL( *iCenRep, *iFeatures );
+
+    // Open/Create mutex
+    TInt error( KErrNotFound );
+    while( error == KErrNotFound )
+        {
+        error = iMutex.CreateGlobal( KProfileMutexName );
+        if( error != KErrAlreadyExists )
+            {
+            break;
+            }
+        error = iMutex.OpenGlobal( KProfileMutexName );
+        }
+    User::LeaveIfError( error );
+    PRODEBUG( "Profiles Engine CommonConstructL end" );
+    }
+
+// Destructor
+CProfileEngineImpl::~CProfileEngineImpl()
+    {
+    iMutex.Close();
+    iProperty.Close();
+    delete iProfileTiming;
+    delete iProfileLocalisedNames;
+    
+    if ( iFeatures )
+        {
+        ReleaseProfileUtility();    
+        }
+        
+    delete iCenRep;
+    delete iVibraCenRep;
+    if( iFsOwned )
+        {
+        iFs->Close();
+        delete iFs;
+        }
+    
+    FeatureManager::UnInitializeLib();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ActiveProfileLC
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfile* CProfileEngineImpl::ActiveProfileLC()
+    {
+    TInt id( User::LeaveIfError( ActiveProfileId() ) );
+    MProfileExtended* profile = ProfileLC( id );
+    return profile;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ActiveProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfile* CProfileEngineImpl::ActiveProfileL()
+    {
+    MProfile* profile = ActiveProfileLC();
+    CleanupStack::Pop();    // profile
+    return profile;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ProfileLC
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileExtended* CProfileEngineImpl::ProfileLC(
+    TInt aId )
+    {
+    CProfileImpl* profile = NULL;
+
+    iMutex.Wait();
+    TInt err( CheckProfileIdL( aId ) );
+
+    if( !err )
+        {
+        TRAP( err, profile = GetProfileL( aId ) );
+        }
+    iMutex.Signal();
+
+    User::LeaveIfError( err );
+
+    CleanupStack::PushL( profile );
+
+    if( iSideVolumeKeys )
+        {
+        // Because SetTemp*VolumeL() functions update only Shared Data those
+        // values must be read from SD and set to the MProfile instance
+        // returned to the caller:
+        TInt activeId( User::LeaveIfError( ActiveProfileId() ) );
+        if( activeId == aId )
+            {
+            TProfileToneSettings& settings =
+                    profile->ProfileSetTones().SetToneSettings();
+            settings.iRingingVolume = TempRingingVolumeL();
+            settings.iMediaVolume = TempMediaVolumeL();
+            }
+        }
+
+    if( !profile->IsProfileNameChanged() )
+        {
+        if( IsDefaultProfile( aId ) )
+            {
+            profile->SetLocalizedProfileNameL( *iProfileLocalisedNames );
+            }
+        else
+            {
+            SetLocalizedNameForDynamicProfileL( *profile );
+            }
+        }
+
+    return profile;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileExtended* CProfileEngineImpl::ProfileL(
+    TInt aId )
+    {
+    MProfileExtended* profile = ProfileLC( aId );
+    CleanupStack::Pop();    // profile
+    return profile;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SetActiveProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SetActiveProfileL( TInt aId )
+    {
+    PRODEBUG1( "SetActiveProfileL( %d )", aId );
+    CreatePubSubKeysIfNeededL(); 
+
+    iMutex.Wait();
+    TInt err( CheckProfileIdL( aId ) );
+
+    if( !err )
+        {
+        TRAP( err, DoSetActiveProfileL( aId ) );
+        }
+    else
+        {
+        // Timed profile was deleted while time expired
+        // So pass event to ActiveIdle2 to deal with time icon.
+        iProfileTiming->CancelTimedProfileL();
+        PublishChangeL( KProEngActiveProfileModified );    
+        }
+    iMutex.Signal();
+
+    PRODEBUG1( "SetActiveProfileL err=%d", err );
+    User::LeaveIfError( err );
+    PRODEBUG1( "SetActiveProfileL( %d ) end", aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::IsActiveProfileTimedL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileEngineImpl::IsActiveProfileTimedL()
+    {
+    return iProfileTiming->IsTimingActiveL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SetActiveProfileTimedL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SetActiveProfileTimedL( TInt aId, TTime aTime )
+    {
+    if( !iFeatures->IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CreatePubSubKeysIfNeededL(); 
+
+    iMutex.Wait();
+    TInt err( CheckProfileIdL( aId ) );
+
+    if( !err )
+        {
+        TRAP( err, DoSetActiveProfileL( aId, &aTime ) );
+        }
+    iMutex.Signal();
+
+    User::LeaveIfError( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadResourceInBufferLC
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ReadResourceInBufferLC( TInt aResourceId,
+        TResourceReader& aReader )
+    {
+    TParse* fp = new ( ELeave ) TParse();
+    fp->Set( KProfileEngineResourceDriveAndDir, &KDC_RESOURCE_FILES_DIR, NULL );
+    iFileName.Copy( fp->FullName() );
+    delete fp;
+
+    BaflUtils::NearestLanguageFile( *iFs, iFileName );
+
+    RResourceFile resourceFile;
+    resourceFile.OpenL( *iFs, iFileName );
+    CleanupClosePushL( resourceFile );
+
+    resourceFile.ConfirmSignatureL( PROFILES_ENGINE_RESOURCE_SIGNATURE );
+
+    HBufC8* dataBuffer = resourceFile.AllocReadLC( aResourceId );
+
+    CleanupStack::Pop(); // dataBuffer
+    CleanupStack::PopAndDestroy(); // resourceFile.Close()
+    CleanupStack::PushL( dataBuffer );
+
+    aReader.SetBuffer( dataBuffer );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadProfilesNamesFromResourceL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ReadProfilesNamesFromResourceL()
+    {
+    TResourceReader rsReader;
+    ReadResourceInBufferLC( R_DEFAULT_PROFILES, rsReader );
+
+    TInt numOfElements( rsReader.ReadInt16() );
+
+    for( TInt i( 0 ) ; i < numOfElements ; ++i )
+        {
+        TInt profileId( rsReader.ReadInt32() );
+        TPtrC profileName( rsReader.ReadTPtrC() );
+        TPtrC shortName( rsReader.ReadTPtrC() );
+        TPtrC naviName( rsReader.ReadTPtrC() );
+        TPtrC titleName( rsReader.ReadTPtrC() );
+        CProfileNameImpl* pn =
+            CProfileNameImpl::NewLC( profileId, profileName, shortName,
+                                     naviName, titleName );
+        User::LeaveIfError( iProfileLocalisedNames->Append( pn ) );
+        CleanupStack::Pop(); // pn
+        }
+
+    CleanupStack::PopAndDestroy(); // ReadResourceInBufferLC()
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::Release
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::Release()
+    {
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SendPresenceSettingsL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SendPresenceSettingsL(
+    const MProfilePresence& /* aPresence */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::IsDefaultProfile
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileEngineImpl::IsDefaultProfile( TInt aId )
+    {
+    return ( iProfileLocalisedNames->FindById( aId ) != KErrNotFound );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::LocalFeaturesL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfilesLocalFeatures& CProfileEngineImpl::LocalFeatures()
+    {
+    return *iFeatures;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::IsFeatureSupported
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileEngineImpl::IsFeatureSupported(
+        TProfileFeatureId aFeatureId ) const
+    {
+    switch( aFeatureId )
+        {
+        case EProfileFeatureVTRingingTone:
+            {
+            return iFeatures->IsFeatureSupported(
+                    KProEngFeatureIdVTRingingTone );
+            // no break after return
+            }
+        default:
+            {
+            return EFalse;
+            // no break after return
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ProfileUtilityObject
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::GetProfileUtilityObject(
+        TProfileUtilityObjectType /* aType */, TAny*& /* aImpl */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::LeaveIfReadOnlyL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::LeaveIfReadOnlyL( TProfileFlags aFlag )
+    {
+    MProfileExtended* profile = ProfileLC( ActiveProfileId() );
+    TUint32 flags = profile->ModifiableFlags();
+    CleanupStack::PopAndDestroy(); // profile
+    if( !( flags & aFlag ) )
+        {
+        User::Leave( KErrAccessDenied );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ActiveProfileId
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfileEngineImpl::ActiveProfileId()
+    {
+    TInt profileId( 0 );
+    TInt error( iCenRep->Get( KProEngActiveProfile, profileId ) );
+    if( error )
+        {
+        return error;
+        }
+    return profileId;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::CommitChangeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::CommitChangeL(
+    MProfileExtended& aProfile )
+    {
+    CreatePubSubKeysIfNeededL(); 
+    if( SysUtil::FFSSpaceBelowCriticalLevelL( iFs ) )
+        {
+        User::Leave( KErrDiskFull );
+        }
+
+    TInt profileId( aProfile.ProfileName().Id() );
+    // write profile settings
+    iMutex.Wait();
+    TUint32 ignore( 0 );
+    TRAPD( error,
+           TInt activeId( User::LeaveIfError( ActiveProfileId() ) );
+           User::LeaveIfError( iCenRep->StartTransaction(
+                   CRepository::EReadWriteTransaction ) );
+           iCenRep->CleanupCancelTransactionPushL();
+           aProfile.ExternalizeL( *iCenRep );
+
+           if( profileId == activeId )
+               {
+               UpdateActiveProfileSettingsL( aProfile );
+               }
+
+           // write settings to Cenrep:
+           User::LeaveIfError( iCenRep->CommitTransaction( ignore ) );
+           CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL()
+
+           if( profileId == activeId )
+               {
+               //Send event through P&S
+               PublishChangeL( KProEngActiveProfileModified );
+               }
+         );
+    iMutex.Signal();
+    User::LeaveIfError( error );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ProfilesNamesArrayLC
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfilesNamesArray* CProfileEngineImpl::ProfilesNamesArrayLC()
+    {
+    CProfilesNamesArrayImpl* nameArray = CProfilesNamesArrayImpl::NewLC();
+
+    iMutex.Wait();
+    TRAPD( error, ReadProfilesNamesL( nameArray ) );
+    iMutex.Signal();
+    User::LeaveIfError( error );
+
+    return nameArray;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::PublishChangeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::PublishChangeL( TUint32 aPSKey )
+    {
+    TInt flag( 0 );
+    User::LeaveIfError( iProperty.Get( KPSUidProfileEngine,
+                                       aPSKey, flag ) );
+    User::LeaveIfError( iProperty.Set( KPSUidProfileEngine,
+                                       aPSKey, ~flag ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::UpdateActiveProfileSettingsL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::UpdateActiveProfileSettingsL( MProfile& aProfile,
+        TBool aSetId )
+    {
+    const MProfileTones& profileTones = aProfile.ProfileTones();
+    const MProfileName& profileName = aProfile.ProfileName();
+    const TProfileToneSettings& settings = profileTones.ToneSettings();
+
+    // These cannot fail because this method is called only in between
+    // StartTransaction() and CommitTransaction() calls (except vibra)
+    iCenRep->Set( KProEngActiveRingingType, settings.iRingingType );
+    iCenRep->Set( KProEngActiveRingingVolume, settings.iRingingVolume );
+    iCenRep->Set( KProEngActiveMessageAlert, !( aProfile.IsSilent() ) );
+    if ( !PowerSaveMode() )
+        {
+    User::LeaveIfError( iVibraCenRep->Set(
+            KVibraCtrlProfileVibraEnabled, settings.iVibratingAlert ) );
+
+#ifdef RD_TACTILE_FEEDBACK
+	const MProfileExtraSettings& extraSettings = aProfile.ProfileExtraSettings();
+	const MProfileFeedbackSettings& feedbackSettings = 
+			extraSettings.ProfileFeedbackSettings();
+    User::LeaveIfError( iVibraCenRep->Set( KVibraCtrlProfileFeedbackEnabled, 
+    		( feedbackSettings.TactileFeedback() ? 1 : 0 ) ) );
+    iCenRep->Set( KProEngActiveTactileFeedback, feedbackSettings.TactileFeedback() );
+    iCenRep->Set( KProEngActiveAudioFeedback, feedbackSettings.AudioFeedback() );
+#endif
+
+    iCenRep->Set( KProEngActiveKeypadVolume, settings.iKeypadVolume );
+        }
+
+    iCenRep->Set( KProEngActiveWarningTones, settings.iWarningAndGameTones );
+    if( aSetId )
+        {
+        iCenRep->Set( KProEngActiveProfile, profileName.Id() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::UpdateContactGroupsValueL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::UpdateContactGroupsValueL(
+    MProfile& /* aProfile */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::GetProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfileImpl* CProfileEngineImpl::GetProfileL(
+    TInt aId )
+    {
+    CProfileImpl* profile = CProfileImpl::NewLC( *iFs );
+    profile->InternalizeL( *iCenRep, aId );
+    CleanupStack::Pop(); // profile
+    return profile;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadProfilesNamesL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ReadProfilesNamesL(
+        CProfilesNamesArrayImpl* aProfilesNames )
+    {
+    __ASSERT_DEBUG( aProfilesNames,
+        ProfileEngPanic::Panic( EProfileEngPanicNullPointer ) );
+
+    TInt len( iProfileLocalisedNames->MdcaCount() );
+    CProfileNameImpl* profileName = CProfileNameImpl::NewL();
+    CleanupStack::PushL( profileName );
+
+    for( TInt i( 0 ); i < len; ++i )
+        {
+        TInt id( iProfileLocalisedNames->ProfileName( i )->Id() );
+        profileName->InternalizeL( *iCenRep, id );
+        if( !profileName->IsProfileNameChanged() )
+            {
+            profileName->SetLocalizedProfileNameL( *iProfileLocalisedNames );
+            }
+        CProfileNameImpl* nameImpl =
+            CProfileNameImpl::NewLC( *profileName );
+
+        User::LeaveIfError( aProfilesNames->InsertInOrder( nameImpl ) );
+        CleanupStack::Pop();    // nameImpl
+        }
+
+    ReadDynamicProfilesNamesL( aProfilesNames, *profileName );
+    CleanupStack::PopAndDestroy();  // profileName
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::DoSetActiveProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::DoSetActiveProfileL(
+    TInt aId, TTime* aTime )
+    {
+    MProfileExtended* profile = ProfileLC( aId );
+
+    User::LeaveIfError( iCenRep->StartTransaction(
+            CRepository::EReadWriteTransaction ) );
+    iCenRep->CleanupCancelTransactionPushL();
+    // Cancel first any pending timings (the logic is the same both in new
+    // timing and in plain activation):
+    TInt previousId( iProfileTiming->CancelTimedProfileL() );
+    if( aTime )
+        {
+        TInt activeId( ( previousId != KErrNotFound )
+                       ? previousId
+                       : User::LeaveIfError( ActiveProfileId() ) );
+        iProfileTiming->SetTimedProfileL( activeId, *aTime );
+        }
+
+    TRAPD( error, UpdateActiveProfileSettingsL( *profile, ETrue ) );
+    TUint32 ignore( 0 );
+    if( !error )
+        {
+        error = iCenRep->CommitTransaction( ignore );
+        }
+
+    if( error )
+        {
+        if( aTime )
+            {
+            iProfileTiming->RollbackTimedProfile();
+            }
+        User::Leave( error );
+        }
+
+    PublishChangeL( KProEngActiveProfileChanged );// send P&S event
+
+    CleanupStack::PopAndDestroy( 2 ); // profile, CleanupCancelTransactionPushL
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SetTempRingingVolumeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SetTempRingingVolumeL(
+        TProfileRingingVolume aVolume )
+    {
+    LeaveIfReadOnlyL( EProfileFlagRingingVolume );
+    CreatePubSubKeysIfNeededL(); 
+    iMutex.Wait();
+    TRAPD( error,
+           User::LeaveIfError( iCenRep->StartTransaction(
+                   CRepository::EReadWriteTransaction ) );
+           iCenRep->CleanupCancelTransactionPushL();
+           SetTempVolumeL( *iCenRep, KProEngActiveRingingVolume, aVolume );
+           TUint32 ignore( 0 );
+           User::LeaveIfError( iCenRep->CommitTransaction( ignore ) );
+           CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL()
+           PublishChangeL( KProEngActiveProfileModified );
+        );
+    iMutex.Signal();
+    User::LeaveIfError( error );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::TempRingingVolumeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfileRingingVolume CProfileEngineImpl::TempRingingVolumeL() const
+    {
+    return TempVolumeL( *iCenRep, KProEngActiveRingingVolume );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SetTempMediaVolumeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SetTempMediaVolumeL(
+        TProfileRingingVolume /* aVolume */ )
+    {
+    // Media volume is not used anymore
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::TempMediaVolumeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfileRingingVolume CProfileEngineImpl::TempMediaVolumeL() const
+    {
+    return TempRingingVolumeL();
+    // Media volume is not used anymore
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SetTempVolumeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SetTempVolumeL(
+        CRepository& aCenRep, TUint32 aCenRepKey,
+        TProfileRingingVolume aVolume )
+    {
+    // level 0 is only for CDMA version:
+    User::LeaveIfError( aCenRep.Set( aCenRepKey, aVolume ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::TempVolumeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfileRingingVolume CProfileEngineImpl::TempVolumeL(
+        CRepository& aCenRep, TUint32 aCenRepKey ) const
+    {
+    TInt volume( 0 );
+    User::LeaveIfError( aCenRep.Get( aCenRepKey, volume ) );
+    TProfileRingingVolume vol = TProfileRingingVolume( volume );
+    return vol;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::CheckProfileIdL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfileEngineImpl::CheckProfileIdL( TInt aId )
+    {
+    if( !IsDefaultProfile( aId ) && ProfileEngUtils::FindValueFromBinaryKeyL(
+            *iCenRep, KProEngUsedIds, aId ) == KErrNotFound )
+        {
+        return KErrNotFound;
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::CreatePubSubKeysIfNeededL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::CreatePubSubKeysIfNeededL()
+    {
+    if( iPubSubKeysCreated ) return;
+
+    _LIT_SECURITY_POLICY_PASS( KProfileEngReadPolicy );
+    const TSecurityPolicy KProfileEngWritePolicy( ECapabilityWriteDeviceData );
+
+    TInt error( RProperty::Define( KPSUidProfileEngine,
+                                   KProEngActiveProfileModified,
+                                   RProperty::EInt,
+                                   KProfileEngReadPolicy,
+                                   KProfileEngWritePolicy ) );
+    if( error && error != KErrAlreadyExists )
+        {
+        User::Leave( error );
+        }
+
+    error = RProperty::Define( KPSUidProfileEngine,
+                               KProEngActiveProfileChanged,
+                               RProperty::EInt,
+                               KProfileEngReadPolicy,
+                               KProfileEngWritePolicy );
+    if( error && error != KErrAlreadyExists )
+        {
+        User::Leave( error );
+        }
+
+    iPubSubKeysCreated = ETrue;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// CreateProfileEngineL create profiles engine and return public interface
+// of the profiles engine.
+// Returns: Profiles Engine public interface
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProfileEngine* CreateProfileEngineL()
+    {
+    return CProfileEngineImpl::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CreateProfileEngineExtendedL create profiles engine and
+// return internal interface of the profiles engine
+// Returns: Profiles Engine internal interface
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL()
+    {
+    return CProfileEngineImpl::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CreateProfileEngineL create profiles engine and return public interface
+// of the profiles engine.
+// Returns: Profiles Engine public interface
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProfileEngine* CreateProfileEngineL( RFs* aFs )
+    {
+    return CProfileEngineImpl::NewL( aFs );
+    }
+
+// -----------------------------------------------------------------------------
+// CreateProfileEngineExtendedL create profiles engine and
+// return internal interface of the profiles engine
+// Returns: Profiles Engine internal interface
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL( RFs* aFs )
+    {
+    return CProfileEngineImpl::NewL( aFs );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::PowerSaveMode
+//
+// -----------------------------------------------------------------------------
+//
+TBool CProfileEngineImpl::PowerSaveMode()
+    {
+    TBool psm = EFalse;
+    
+    TRAPD( err, psm = PowerSaveModeL() );
+    
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    return psm;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::PowerSaveModeL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CProfileEngineImpl::PowerSaveModeL()
+    {
+    if( !FeatureManager::FeatureSupported( KFeatureIdPowerSave ) )
+        {
+        return EFalse;
+        }
+
+    TInt psm = EPsmsrvModeNormal;
+    
+    // KProEngPsmChanged PubSub key is set by GSProfilesPlugin when power save
+    // mode changes. If the key cannot be read (doesn't exist), PSM hasn't
+    // changed since the last boot and the mode is read from PSM CenRep.
+    if( RProperty::Get( KPSUidProfileEngine, KProEngPsmChanged, psm ) != KErrNone )
+        {
+        CRepository* cenrep = CRepository::NewLC( KCRUidPowerSaveMode );
+        User::LeaveIfError( cenrep->Get( KPsmCurrentMode, psm ) );
+        CleanupStack::PopAndDestroy( cenrep );
+        }
+
+    if ( psm == EPsmsrvModePowerSave )
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,416 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile engine implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILEENGINEIMPL_H__
+#define __CPROFILEENGINEIMPL_H__
+
+//  INCLUDES
+#include <e32property.h>
+#include <f32file.h>            // RFs
+#include <Profile.hrh>          // TProfileRingingVolume 
+#include "MProfileEngineExtended.h" // MProfileEngineExtended
+#include "MProfileExtended.h" // MProfileExtended
+
+// FORWARD DECLARATIONS
+class CProfileNameImpl;
+class CProfileImpl;
+class CProfilesNamesArrayImpl;
+class DRMCommon;
+class MProfilesLocalFeatures;
+class CRepository;
+class TResourceReader;
+class CProfileTiming;
+
+// CLASS DECLARATION
+
+/**
+*  Profile engine implementation.
+*
+*  @lib ProfileEng
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfileEngineImpl) : public CBase,
+                           public MProfileEngineExtended
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileEngineImpl* NewL();
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileEngineImpl* NewLC();
+
+        /**
+        * Two-phased constructor.
+        * @param aFs An open file server session. Ownership is NOT transferred.
+        */
+        static CProfileEngineImpl* NewL( RFs* aFs );
+
+        /**
+        * Two-phased constructor.
+        * @param aFs An open file server session. Ownership is NOT transferred.
+        */
+        static CProfileEngineImpl* NewLC( RFs* aFs );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileEngineImpl();
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfileEngine.
+        */
+        virtual void Release();
+
+        /**
+        * From MProfileEngine.
+        */
+        virtual MProfile* ActiveProfileLC();
+
+        /**
+        * From MProfileEngine.
+        */
+        virtual MProfile* ActiveProfileL();
+
+        /**
+        * From MProfileEngine.
+        */
+        virtual TInt ActiveProfileId();
+
+        /**
+        * From MProfileEngine.
+        */
+        virtual void SetActiveProfileL( TInt aId );
+
+        /**
+        * From MProfileEngine.
+        */
+        virtual MProfilesNamesArray* ProfilesNamesArrayLC();
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        virtual MProfileExtended* ProfileLC( TInt aId );
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        virtual MProfileExtended* ProfileL( TInt aId );
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        virtual void CommitChangeL( MProfileExtended& aProfile );
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        virtual void SendPresenceSettingsL(
+            const MProfilePresence& aPresence );
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        virtual TInt DeleteProfileL( TInt aId );
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        virtual MProfileExtended* CreateProfileL();
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        virtual TBool IsDefaultProfile( TInt aId );
+
+        /**
+        * From MProfileEngine.
+        */
+        void SetTempRingingVolumeL( TProfileRingingVolume aVolume );
+
+        /**
+        * From MProfileEngine.
+        */
+        TProfileRingingVolume TempRingingVolumeL() const;
+
+        /**
+        * From MProfileEngine.
+        */
+        void SetTempMediaVolumeL( TProfileRingingVolume aVolume );
+
+        /**
+        * From MProfileEngine.
+        */
+        TProfileRingingVolume TempMediaVolumeL() const;
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        MProfilesLocalFeatures& LocalFeatures();
+
+        /**
+        * From MProfileEngine.
+        */
+        TBool IsFeatureSupported( TProfileFeatureId aFeatureId ) const;
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        void GetProfileUtilityObject( TProfileUtilityObjectType aType, TAny*& aImpl );
+
+        /**
+        * From MProfileEngine.
+        */
+        TBool IsActiveProfileTimedL();
+
+        /**
+        * From MProfileEngineExtended.
+        */
+        void SetActiveProfileTimedL( TInt aId, TTime aTime );
+
+    protected:  // New functions
+
+        /**
+        * Reads the resource with the given id from Profiles Engine resource
+        * file.
+        * @param aResourceId the id of the resource to be read
+        * @param aReader the resource reader object in which the buffer
+        * containing the resource is set
+        */
+        void ReadResourceInBufferLC( TInt aResourceId,
+                                     TResourceReader& aReader );
+
+        /**
+        * Read default profiles names from resource.
+        */
+        void ReadProfilesNamesFromResourceL();
+
+        /**
+        * Write profile settings to Central Repository.
+        * @since 2.8
+        * @param aProfile Profile
+        */
+        void WriteProfileL( MProfileExtended& aProfile );
+
+        /**
+        * Send an event indicating that a setting in the active profile was
+        * modified through Publish & Subscribe.
+        * @param aPSKey the P&S key which value should be changed
+        * @since 3.0
+        */
+        void PublishChangeL( TUint32 aPSKey );
+
+        /**
+        * Update Active Profile settings in Central Repository.
+        * @since 2.8
+        * @param aProfile Profile
+        * @param aSetId sets the id of the active profile to Central Repository
+        * only if this is ETrue
+        */
+        void UpdateActiveProfileSettingsL( MProfile& aProfile,
+                                           TBool aSetId = EFalse );
+
+        /**
+         * Updates the alert for groups shared data value.
+         * @since 2.6
+         * @param aProfile settings containing the new alert for groups.
+         */
+        void UpdateContactGroupsValueL( MProfile& aProfile );
+            
+        /**
+        * Get profile settings.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Profile instance
+        */
+        CProfileImpl* GetProfileL( TInt aId );
+
+        /**
+        * Read profiles names.
+        * @since 2.0
+        * @param aProfilePath Profile path where profiles readed
+        * @param aProfilesNames Profile names array
+        */
+        void ReadProfilesNamesL( CProfilesNamesArrayImpl* aProfilesNames );
+
+        /**
+        * Read new profile default name from resource.
+        * @param aResourceId resource id containing the profile name or
+        *        short name.
+        * @param aProfileName Buffer for default profile name.
+        * @since 2.1
+        */
+        void ReadNewProfileNameFromResourceL( TInt aResourceId,
+                                              TDes& aProfileName );
+
+        /**
+         * Helper function for setting the active profile. Wraps several
+         * leaving calls inside.
+         * @since 2.5
+         * @param aId the id of the profile to be set as active profile.
+         * @param aTime the time when the new profile should be deactivated
+         */
+        void DoSetActiveProfileL( TInt aId, TTime* aTime = NULL );
+
+        /**
+         * Helper method for SetTempRingingVolumeL() and SetTempMediaVolumeL()
+         * to set the needed volume value to Central Repository.
+         * @since 2.8
+         * @param aCenRep the central repository object to write the new
+         *        temporary volume
+         * @param aCenRepKey the key to the volume value in CentralRepository
+         * @param aVolume the new value to be set for the volume
+         */
+        void SetTempVolumeL( CRepository& aCenRep, TUint32 aCenRepKey,
+                             TProfileRingingVolume aVolume );
+
+        /**
+         * Helper method for TempRingingVolumeL() and TempMediaVolumeL() to
+         * get the needed volume value from Central Repository.
+         * @since 2.6
+         * @param aCenRep reference to the CenRep instance containing the data
+         * @param aCenRepKey the key to the volume value in Central Repository
+         */
+        TProfileRingingVolume TempVolumeL( CRepository& aCenRep,
+                                           TUint32 aCenRepKey ) const;
+
+        /**
+         * Helper method for SetTempMediaVolumeL() and SetTempRingingVolumeL()
+         * to check and leave with KErrAccessDenied if the corresponding
+         * setting item is read-only.
+         * @since 2.8
+         * @param aFlag the flag corresponding to the setting item to be
+         * checked for modifiability.
+         */
+        void LeaveIfReadOnlyL( TProfileFlags aFlag );
+
+        /**
+         * Helper method to check whether a client-given profile ID belongs to
+         * an existing profile.
+         * @since 3.0
+         * @param aId profile ID to check
+         * @return KErrNotFound if a profile with the given ID is not found,
+         *         KErrNone otherwise.
+         */
+
+        TInt CheckProfileIdL( TInt aId );
+
+        /**
+         * Creates the Publish & Subscribe keys needed for notifying about
+         * active profile changes if the keys aren't already created.
+         * @since 3.1
+         */
+        void CreatePubSubKeysIfNeededL();
+
+        /**
+         * Reads names of user-created profiles.
+         * @param aProfilesNames Profiles Names Array to be updated with the
+         *        user-created Profile Names.
+         * @param aNameTemplate CProfileNameImpl to be reused when reading name
+         *        data from Profiles Central Repository.
+         * @since 3.1
+         */
+        void ReadDynamicProfilesNamesL( CProfilesNamesArrayImpl* aProfilesNames,
+                                        CProfileNameImpl& aNameTemplate );
+
+        /**
+         * Reads both the normal and short versions of the name of a new profile
+         * from the resources.
+         * @return Pointer to CProfileNameImpl wrapping the normal and short
+         *         names of a new profile.
+         * @since 3.1
+         */
+        CProfileNameImpl* ReadNewProfileNameFromResourceLC();
+
+        /**
+         * Sets the localized name for a dynamic (= user-created) profile.
+         * @param aProfile the profile object into which the localized name
+         *        should be set.
+         * @since 3.1
+         */
+        void SetLocalizedNameForDynamicProfileL( CProfileImpl& aProfile );
+             
+    private:
+        TBool PowerSaveMode();
+        TBool PowerSaveModeL();
+        
+    private:
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( RFs* aFs );
+
+        /**
+        * Common part used by both ConstructL() methods above.
+        */
+        void CommonConstructL();
+
+    private:    // Data
+        // Own: resource file name is stored here (to avoid stack overflow)
+        TFileName iFileName;
+
+        // Own or Ref: File server session
+        RFs* iFs;
+
+        // Indicates whether the file server session is owned or not
+        TBool iFsOwned;
+
+        // Own: Central Repository handle for Profiles repository
+        CRepository* iCenRep;
+
+        // Own: Central Repository handle for VibraCntrl repository
+        CRepository* iVibraCenRep;
+
+        // Own: Publish & Subscribe client:
+        RProperty iProperty;
+
+        // Own: Localised profile names
+        CProfilesNamesArrayImpl* iProfileLocalisedNames;
+
+        // Own: Handle to a mutex
+        RMutex iMutex;
+
+        // Not owned: Locally variated features of Profiles:
+        MProfilesLocalFeatures* iFeatures;
+
+        // Indicates whether the Publish & Subscribe keys has been created:
+        TBool iPubSubKeysCreated;
+
+        // Own: functionality for timing of profiles
+        CProfileTiming* iProfileTiming;
+
+        // Supported features
+        TBool iSideVolumeKeys;
+    };
+
+#endif      //  __CPROFILEENGINEIMPL_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,626 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CProfileEngineImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileEngineImpl.h"
+#include <bautils.h>
+#include <barsc.h>
+#include <featmgr.h>
+#include <settingsinternalcrkeys.h>
+#include <sysutil.h>
+#include <accessoriescrkeys.h>
+
+#include <ProfileEng.rsg>
+#include <TProfileToneSettings.h>
+#include <MProfileTones.h>
+#include "CProfilesNamesArrayImpl.h"
+#include "CProfileImpl.h"
+#include "CProfileNameImpl.h"
+#include "ProfileEngUtils.h"
+#include "MProfileSetName.h"
+#include "ProfileEng.hrh"
+#include "ProfileEngPanic.h"
+#include "ProfileEngineConstants.h"
+#include "ProfileEnginePrivateCRKeys.h"
+
+namespace
+    {
+    const TInt KProfileGeneratedNameTailLength( 4 );
+    _LIT( KFirstParenthesis, "(" );
+    }
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+void GenerateProfileName( TDes& aProfileName, const MProfilesNamesArray& aProfileNames )
+    {
+    _LIT( KEndParenthesis, ")" );
+    _LIT( KZero, "0" );
+    TInt counter( 1 );
+    TBuf<KProfileMaxNameLength> rootName( aProfileName );
+    while( aProfileNames.FindByName( aProfileName ) != KErrNotFound &&
+           counter <= KProfilesMaxNumberOfDynamicProfiles )
+        {
+        aProfileName.Copy( rootName );
+        aProfileName.Append( KFirstParenthesis );
+        if( counter < 10 )
+            {
+            aProfileName.Append( KZero );
+            }
+        TBuf<KProfilesMaxTIntLength> number;
+        number.Num( counter );
+        aProfileName.Append( number );
+        aProfileName.Append( KEndParenthesis );
+        ++counter;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// HandleProfileRemoved
+//
+// Updates the given central repository value from the given file, when a
+// profile is removed. This is used for those central repository keys that
+// contain a profile id as a value, and if a deleted profile is
+// currently assigned to the central repository value, it is resetted to the
+// given default value.
+// -----------------------------------------------------------------------------
+//
+void HandleProfileRemoved( const TInt aRemovedProfileId,
+                            const TInt aValuePlusDelta,
+                            CRepository& aCenRep,
+                            const TUint aKey,
+                            const TInt aDefaultValue )
+    {
+    if ( ( aValuePlusDelta ) == aRemovedProfileId )
+        {
+        aCenRep.Set( aKey, aDefaultValue );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CreateIntSettingForNewProfileL
+//
+// Creates a new integer Central Repository key for the new profile and
+// initialises it by copying the default value to it.
+//
+// -----------------------------------------------------------------------------
+//
+void CreateIntSettingForNewProfileL( CRepository& aRepository, TInt aSettingId,
+                                     TInt aProfileId )
+    {
+    TInt val;
+    User::LeaveIfError(
+            aRepository.Get( 
+            ProfileEngUtils::ResolveKey( aSettingId,
+            KProEngDefaultProfileId ), val ) );
+    TInt err(
+            aRepository.Create( 
+            ProfileEngUtils::ResolveKey( aSettingId, aProfileId ),
+            val ) );
+    if( ( err != KErrNone ) && ( err != KErrAlreadyExists ) )
+        {
+        User::Leave( err );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CreateStringSettingForNewProfileL
+//
+// Creates a new string Central Repository key for the new profile and
+// initialises it by copying the default value to it.
+//
+// -----------------------------------------------------------------------------
+//
+void CreateStringSettingForNewProfileL( CRepository& aRepository,
+                                        TInt aSettingId, TInt aProfileId,
+                                        const TDesC& aNewProfileName,
+                                        TPtr& aStringPtr ) 
+    {
+    if( aSettingId != KProEngProfileName )
+        {
+        User::LeaveIfError(
+                aRepository.Get( 
+                ProfileEngUtils::ResolveKey( aSettingId,
+                KProEngDefaultProfileId ), aStringPtr ) );
+        }
+    else
+        {
+        aStringPtr = aNewProfileName;
+        }
+    TInt err(
+            aRepository.Create( 
+            ProfileEngUtils::ResolveKey( aSettingId, aProfileId ),
+            aStringPtr ) );
+    if( ( err != KErrNone ) && ( err != KErrAlreadyExists ) )
+        {
+        User::Leave( err );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CreateBinSettingForNewProfileL
+//
+// Creates a new binary Central Repository key for the new profile and
+// initialises it by copying the default value to it.
+//
+// -----------------------------------------------------------------------------
+//
+void CreateBinSettingForNewProfileL( CRepository& aRepository, TInt aSettingId,
+                                     TInt aProfileId, TPtr8& aBinPtr )
+    {
+    User::LeaveIfError(
+            aRepository.Get( 
+            ProfileEngUtils::ResolveKey( aSettingId,
+            KProEngDefaultProfileId ), aBinPtr ) );
+    TInt err(
+            aRepository.Create( 
+            ProfileEngUtils::ResolveKey( aSettingId, aProfileId ),
+            aBinPtr ) );
+    if( ( err != KErrNone ) && ( err != KErrAlreadyExists ) )
+        {
+        User::Leave( err );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// GetSettingsForProfile
+//
+// Gets all the settings of the profile with given id from Central Repository.
+// -----------------------------------------------------------------------------
+//
+TInt GetSettingsForProfile( CRepository& aRepository,
+                            RArray<TUint32>& aSettings,
+                            TInt aId )
+    {
+    const TUint32 KId( aId << 24 );
+    const TUint32 KMask( 0xFF000000 );
+    TInt error( 0 );
+    TRAP( error, error = aRepository.FindL( KId, KMask, aSettings ) );
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// DeleteSettingsForProfile
+//
+// Deletes all the settings of the profile with given id from Central Repository
+// Tries to delete all without checking if a deletion fails.
+// -----------------------------------------------------------------------------
+//
+void DeleteSettingsForProfile( CRepository& aRepository,
+                               RArray<TUint32>& aSettings )
+    {
+    for( TInt i( aSettings.Count() - 1 ); i >= 0; --i )
+        {
+        aRepository.Delete( aSettings[i] ); // ignore errors
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CreateSettingsForNewProfileL
+//
+// Creates new Central Repository keys for the new profile and initialises them
+// by copying the default values to them.
+//
+// -----------------------------------------------------------------------------
+//
+void CreateSettingsForNewProfileL( CRepository& aRepository, TInt aProfileId,
+                                   const TDesC& aNewProfileName,
+                                   TResourceReader& aReader )
+    {
+    User::LeaveIfError( aRepository.StartTransaction(
+                        CRepository::EReadWriteTransaction ) );
+
+    // This only be used after normal RFS(restore factory settings), If there was
+    // user created profile before normal RFS, and the normal RFS only restore
+    // KProEngUsedIds, the settings of user created profile are in CenRep still.
+    // So we should delete the remain settings and create new one.
+    RArray<TUint32> settings;
+    if ( !GetSettingsForProfile( aRepository, settings, aProfileId ) )
+    	{
+    	DeleteSettingsForProfile( aRepository, settings );
+    	}
+    settings.Close();
+
+    HBufC* stringVal = HBufC::NewL(
+            NCentralRepositoryConstants::KMaxUnicodeStringLength );
+    CleanupStack::PushL( stringVal );
+    TPtr stringValPtr = stringVal->Des();
+    HBufC8* binVal = HBufC8::NewL(
+            NCentralRepositoryConstants::KMaxBinaryLength );
+    CleanupStack::PushL( binVal );
+    TPtr8 binValPtr = binVal->Des();
+
+    TInt numOfElements( aReader.ReadInt16() );
+
+    for( TInt i( 0 ) ; i < numOfElements ; ++i )
+        {
+        TInt settingId( aReader.ReadInt32() );
+        TInt keyType( aReader.ReadInt32() );
+        switch( keyType )
+            {
+            case EProfileSettingKeyTypeInt:
+                {
+                CreateIntSettingForNewProfileL( aRepository, settingId,
+                                                aProfileId );
+                break;
+                }
+            case EProfileSettingKeyTypeString:
+                {
+                CreateStringSettingForNewProfileL( aRepository, settingId,
+                                                   aProfileId,
+                                                   aNewProfileName,
+                                                   stringValPtr );
+                break;
+                }
+            case EProfileSettingKeyTypeBin:
+                {
+                CreateBinSettingForNewProfileL( aRepository, settingId,
+                                                aProfileId, binValPtr );
+                                                
+                break;
+                }
+            case EProfileSettingKeyTypeReal: // no settings of this type
+            default:
+                {
+                break;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy( 2 ); // stringVal, binVal
+ 
+    // Update the used ids value (this is done last so that we can get the
+    // repository back in a legal state (by deleting the settings just 
+    // created)).
+    TBuf8< KProfilesMaxNumberOfDynamicProfiles > idBuf;
+    ProfileEngUtils::GetBinarySettingL( aRepository, KProEngUsedIds, idBuf );
+    idBuf.Append( aProfileId );
+    User::LeaveIfError( aRepository.Set( KProEngUsedIds, idBuf ) );
+
+    TUint32 ignore( 0 );
+    User::LeaveIfError( aRepository.CommitTransaction( ignore ) );
+    }
+
+// -----------------------------------------------------------------------------
+// DeleteProfileIdFromList
+//
+// -----------------------------------------------------------------------------
+//
+void DeleteProfileIdFromList( CRepository& aRepository, TInt aId, TDes8& aIdBuf )
+    {
+    TInt numOfIds = aIdBuf.Length();
+    for( TInt idx( 0 ); idx < numOfIds; ++idx )
+        {
+        if( aIdBuf[ idx ] == aId )
+            {
+            aIdBuf.Delete( idx, 1 );
+            aRepository.Set( KProEngUsedIds, aIdBuf );
+            break;
+            }
+        }
+    }
+
+void DoDeleteProfileL( CRepository& aCenRep, TInt aId )
+    {
+    RArray<TUint32> settings;
+    User::LeaveIfError( GetSettingsForProfile( aCenRep, settings, aId ) );
+
+    TBuf8< 4 * KProfilesMaxNumberOfDynamicProfiles > idBuf; // One id is 4-bytes long
+    ProfileEngUtils::GetBinarySettingL( aCenRep, KProEngUsedIds, idBuf );
+
+    User::LeaveIfError( aCenRep.StartTransaction(
+                        CRepository::EReadWriteTransaction ) );
+    DeleteSettingsForProfile( aCenRep, settings );
+    settings.Reset();
+    DeleteProfileIdFromList( aCenRep, aId, idBuf );
+
+    TInt headsetVal( 0 );
+    TInt loopsetVal( 0 );
+    TInt ttyVal( 0 );
+    TInt btVal( 0 );
+    TUint32 ignore( 0 );
+    TRAPD( error,
+          CRepository* cr = CRepository::NewL( KCRUidProfileSettings );
+          CleanupStack::PushL( cr );
+          User::LeaveIfError( cr->Get( KSettingsHeadsetDefaultProfile, headsetVal ) );
+          User::LeaveIfError( cr->Get( KSettingsLoopsetDefaultProfile, loopsetVal ) );
+          User::LeaveIfError( cr->Get( KSettingsTTYDefaultProfile, ttyVal ) );
+          User::LeaveIfError( cr->Get( KSettingsBTDefaultProfile, btVal ) );
+          User::LeaveIfError( cr->StartTransaction(
+                              CRepository::EReadWriteTransaction ) );
+          // -1 is a mystery, consult general settings team:
+          // 0 ( = general profile ) is the default profile used with all the
+          // accessories:
+          HandleProfileRemoved( aId, headsetVal-1, *cr,
+                                KSettingsHeadsetDefaultProfile, 0 );
+          HandleProfileRemoved( aId, loopsetVal-1, *cr,
+                                KSettingsLoopsetDefaultProfile, 0 );
+          HandleProfileRemoved( aId, ttyVal-1, *cr,
+                                KSettingsTTYDefaultProfile, 0 );
+          HandleProfileRemoved( aId, btVal-1, *cr,
+                                KSettingsBTDefaultProfile, 0 );
+          User::LeaveIfError( cr->CommitTransaction( ignore ) );
+
+          CleanupStack::PopAndDestroy(); // delete cr:
+        );
+
+    if( error )
+        {
+        aCenRep.RollbackTransaction(); // ignore error
+        User::Leave( error );
+        }
+
+    User::LeaveIfError( aCenRep.CommitTransaction( ignore ) );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::DeleteProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfileEngineImpl::DeleteProfileL( TInt aId )
+    {
+    iMutex.Wait();
+    TInt activeProfileId( ActiveProfileId() );
+
+    if( activeProfileId < 0 )
+        {
+        iMutex.Signal();
+        User::Leave( activeProfileId );
+        }
+
+    // Do not allow delete active profile
+    if( aId == activeProfileId )
+        {
+        iMutex.Signal();
+        return KErrAbort;
+        }
+    // Do not allow delete default profile
+    if( IsDefaultProfile( aId ) )
+        {
+        iMutex.Signal();
+        return KErrAbort;
+        }
+
+    TRAPD( error, DoDeleteProfileL( *iCenRep, aId ) );
+    iMutex.Signal();
+    User::LeaveIfError( error );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::CreateProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileExtended* CProfileEngineImpl::CreateProfileL()
+    {
+    if( SysUtil::FFSSpaceBelowCriticalLevelL( iFs ) )
+        {
+        User::Leave( KErrDiskFull );
+        }
+
+    // Create profile ID
+    CProfilesNamesArrayImpl* profileNameArray = CProfilesNamesArrayImpl::NewLC();
+
+    iMutex.Wait();
+    TRAPD( error, ReadProfilesNamesL( profileNameArray ) );
+    if( error )
+        {
+        iMutex.Signal();
+        User::Leave( error );
+        }
+
+    if( profileNameArray->MdcaCount() -         // current profile count
+        iProfileLocalisedNames->MdcaCount() >=  // default profile count
+        KProfilesMaxNumberOfDynamicProfiles )   // max dynamic profiles
+        {
+        // Max number of dynamic profiles
+        CleanupStack::PopAndDestroy();  // profileNameArray
+        iMutex.Signal();
+        return NULL;
+        }
+
+    TInt profileId( KErrNotFound );
+    // Find first free id
+    TInt lastDynamicProfileId( KProfileBaseDynamicProfileId + 
+                               KProfilesMaxNumberOfDynamicProfiles );
+
+    for( TInt i( KProfileBaseDynamicProfileId ); i < lastDynamicProfileId; ++i )
+        {
+        TInt index( profileNameArray->FindById( i ) );
+        if( index == KErrNotFound )
+            {
+            profileId = i;
+            break;
+            }
+        }
+
+    if( profileId == KErrNotFound )
+        {
+        CleanupStack::PopAndDestroy();  // profileNameArray
+        iMutex.Signal();
+        return NULL;
+        }
+
+    TBuf<KProfileMaxNameLength> profileName;
+    TRAP( error,
+          ReadNewProfileNameFromResourceL( R_NEW_PROFILE, profileName ) );
+    if( error )
+        {
+        iMutex.Signal();
+        User::Leave( error );
+        }
+
+    GenerateProfileName( profileName, *profileNameArray );
+    CleanupStack::PopAndDestroy();  // profileNameArray
+
+    TResourceReader rsReader;
+    CProfileImpl* newProfile = NULL;
+    TRAP( error,
+          ReadResourceInBufferLC( R_PROFILE_SETTINGS, rsReader );
+          CreateSettingsForNewProfileL( *iCenRep, profileId,
+                                        profileName, rsReader );
+          CleanupStack::PopAndDestroy();  // ReadResourceInBufferLC
+
+          // Create and store new profile
+          newProfile = CProfileImpl::NewLC( *iFs );
+          newProfile->InternalizeL( *iCenRep, profileId );
+                
+          CleanupStack::Pop();    // newProfile
+          );
+ 
+    iMutex.Signal();
+    User::LeaveIfError( error );
+
+    return newProfile;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadNewProfileNameFromResourceL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ReadNewProfileNameFromResourceL( TInt aResourceId,
+                                                          TDes& aProfileName )
+    {
+    TResourceReader rsReader;
+    ReadResourceInBufferLC( aResourceId, rsReader );
+
+    TPtrC profileName( rsReader.ReadTPtrC() );
+    aProfileName.Copy( profileName );
+
+    CleanupStack::PopAndDestroy(); // ReadResourceInBufferLC
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadNewProfileNameFromResourceL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfileNameImpl* CProfileEngineImpl::ReadNewProfileNameFromResourceLC()
+    {
+    TBuf<KProfileMaxNameLength> profileName;
+    ReadNewProfileNameFromResourceL( R_NEW_PROFILE, profileName ); 
+
+    TBuf<KProfileMaxNameLength> shortName;
+    ReadNewProfileNameFromResourceL( R_NEW_PROFILE_SHORT, shortName ); 
+
+    TBuf<KProfileMaxNameLength> naviName;
+    ReadNewProfileNameFromResourceL( R_NEW_PROFILE_NAVI, naviName ); 
+
+    TBuf<KProfileMaxNameLength> titleName;
+    ReadNewProfileNameFromResourceL( R_NEW_PROFILE_TITLE, titleName );
+
+    CProfileNameImpl* localizedName =
+        CProfileNameImpl::NewLC( 0, profileName, shortName,
+                                 naviName, titleName );
+
+    return localizedName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadDynamicProfilesNamesL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ReadDynamicProfilesNamesL(
+        CProfilesNamesArrayImpl* aProfilesNames,
+        CProfileNameImpl& aNameTemplate )
+    {
+    TBuf8< NCentralRepositoryConstants::KMaxBinaryLength > idBuf;
+    ProfileEngUtils::GetBinarySettingL( *iCenRep, KProEngUsedIds, idBuf );
+    TInt len = idBuf.Length();
+
+    if( len == 0 )
+        {
+        return; // No user-created profiles, just return
+        }
+
+    CProfileNameImpl* localizedName = ReadNewProfileNameFromResourceLC();
+
+    for( TInt i( 0 ); i < len; ++i )
+        {
+        aNameTemplate.InternalizeL( *iCenRep, idBuf[i] );
+        if( !aNameTemplate.IsProfileNameChanged() )
+            {
+            TInt idxOfParenthesis(
+                    aNameTemplate.Name().Find( KFirstParenthesis ) );
+            if( idxOfParenthesis != KErrNotFound )
+                {
+                TBuf<KProfileGeneratedNameTailLength> uniquePart =
+                        aNameTemplate.Name().Mid( idxOfParenthesis,
+                        KProfileGeneratedNameTailLength );
+                aNameTemplate.SetLocalizedProfileNameL( *localizedName,
+                                                        uniquePart );
+                }
+            else
+                {
+                aNameTemplate.SetLocalizedProfileNameL( *localizedName,
+                                                        KNullDesC() );
+                }
+            }
+
+        CProfileNameImpl* nameImpl =
+            CProfileNameImpl::NewLC( aNameTemplate );
+
+        User::LeaveIfError( aProfilesNames->InsertInOrder( nameImpl ) );
+        CleanupStack::Pop();    // nameImpl
+        }
+
+    CleanupStack::PopAndDestroy( localizedName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SetLocalizedNameForDynamicProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SetLocalizedNameForDynamicProfileL(
+        CProfileImpl& aProfile )
+    {
+    CProfileNameImpl* localizedName = ReadNewProfileNameFromResourceLC();
+
+    TInt idxOfParenthesis(
+            aProfile.ProfileName().Name().Find( KFirstParenthesis ) );
+    if( idxOfParenthesis != KErrNotFound )
+        {
+        TBuf<KProfileGeneratedNameTailLength> uniquePart =
+                aProfile.ProfileName().Name().Mid( idxOfParenthesis,
+                KProfileGeneratedNameTailLength );
+        aProfile.SetLocalizedProfileNameL( *localizedName, uniquePart );
+        }
+    else
+        {
+        aProfile.SetLocalizedProfileNameL( *localizedName,
+                                           KNullDesC() );
+        }
+
+    CleanupStack::PopAndDestroy( localizedName );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImplStaticProfiles.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileEngineImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileEngineImpl.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::DeleteProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfileEngineImpl::DeleteProfileL( TInt /*aId*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::CreateProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileExtended* CProfileEngineImpl::CreateProfileL()
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadNewProfileNameFromResourceL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ReadNewProfileNameFromResourceL( TDes& /*aProfileName*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadDynamicProfilesNamesL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::ReadDynamicProfilesNamesL(
+        CProfilesNamesArrayImpl* /* aProfilesNames */,
+        CProfileNameImpl& /* aNameTemplate */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::ReadNewProfileNameFromResourceLC
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfileNameImpl* CProfileEngineImpl::ReadNewProfileNameFromResourceLC()
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineImpl::SetLocalizedNameForDynamicProfileL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineImpl::SetLocalizedNameForDynamicProfileL(
+        CProfileImpl& aProfile )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraSettingsImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile extra tones implementation.
+*
+*/
+
+
+
+//  INCLUDES
+#include "CProfileExtraSettingsImpl.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfileEngUtils.h"
+#include "CProfilePttSettingsImpl.h"
+#include "CProfileFeedbackSettingsImpl.h"
+#include "CProfile3DToneSettingsImpl.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+CProfileExtraSettingsImpl* CProfileExtraSettingsImpl::NewL()
+    {
+    CProfileExtraSettingsImpl* self = new( ELeave ) CProfileExtraSettingsImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+CProfileExtraSettingsImpl::~CProfileExtraSettingsImpl()
+    {
+    delete iPttSettings;
+    delete iFeedbackSettings;    
+    delete i3DToneSettings;
+    }
+
+void CProfileExtraSettingsImpl::InternalizeL( CRepository& aCenRep,
+                                              TInt aProfileId )
+    {
+    iPttSettings->InternalizeL( aCenRep, aProfileId );
+    iFeedbackSettings->InternalizeL( aCenRep, aProfileId );    
+    i3DToneSettings->InternalizeL( aCenRep, aProfileId );
+    }
+
+void CProfileExtraSettingsImpl::ExternalizeL( CRepository& aCenRep,
+                                              TInt aProfileId ) const
+    {
+    iPttSettings->ExternalizeL( aCenRep, aProfileId );
+    iFeedbackSettings->ExternalizeL( aCenRep, aProfileId );    
+    i3DToneSettings->ExternalizeL( aCenRep, aProfileId );
+    }
+
+const MProfilePttSettings& CProfileExtraSettingsImpl::ProfilePttSettings() const
+    {
+    return *iPttSettings;
+    }
+
+MProfileSetPttSettings& CProfileExtraSettingsImpl::ProfileSetPttSettings() const
+    {
+    return *iPttSettings;
+    }
+
+const MProfileFeedbackSettings&
+CProfileExtraSettingsImpl::ProfileFeedbackSettings() const
+    {
+    return *iFeedbackSettings;
+    }
+
+MProfileSetFeedbackSettings&
+CProfileExtraSettingsImpl::ProfileSetFeedbackSettings() const
+    {
+    return *iFeedbackSettings;
+    }
+
+const MProfile3DToneSettings&
+CProfileExtraSettingsImpl::Profile3DToneSettings() const
+    {
+    return *i3DToneSettings;
+    }
+
+MProfileSet3DToneSettings&
+CProfileExtraSettingsImpl::ProfileSet3DToneSettings() const
+    {
+    return *i3DToneSettings;
+    }
+
+void CProfileExtraSettingsImpl::ConstructL()
+    {
+    iPttSettings = CProfilePttSettingsImpl::NewL();
+    iFeedbackSettings = CProfileFeedbackSettingsImpl::NewL();    
+    i3DToneSettings = CProfile3DToneSettingsImpl::NewL();
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraSettingsImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile extra tones implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILEEXTRASETTINGSIMPL_H
+#define __CPROFILEEXTRASETTINGSIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MProfileExtraSettings.h>
+#include "MProfileSetExtraSettings.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+class CProfilePttSettingsImpl;
+class CProfileFeedbackSettingsImpl;
+class CProfile3DToneSettingsImpl;
+
+// CLASS DECLARATION
+
+/**
+*  Profile extra tones implementation.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfileExtraSettingsImpl) : public CBase,
+                               public MProfileExtraSettings,
+                               public MProfileSetExtraSettings
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileExtraSettingsImpl* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileExtraSettingsImpl();
+
+    public: // New functions
+
+        /**
+        * Internalize data from the central repository.
+        * @since 3.0
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 3.0
+        * @param aCenRep Central Repository object to write the settings
+        */
+        void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfileExtraSettings.
+         */
+        virtual const MProfilePttSettings& ProfilePttSettings() const;
+
+        /**
+        * From MProfileExtraSettings.
+        */
+        virtual const MProfileFeedbackSettings& ProfileFeedbackSettings() const;
+
+        /**
+        * From MProfileExtraSettings.
+        */
+        virtual const MProfile3DToneSettings& Profile3DToneSettings() const;
+
+        /**
+        * From MProfileSetExtraSettings.
+        */
+        virtual MProfileSetPttSettings& ProfileSetPttSettings() const;
+
+        /**
+        * From MProfileSetExtraSettings.
+        */
+        virtual MProfileSetFeedbackSettings& ProfileSetFeedbackSettings() const;
+
+        /**
+        * From MProfileSetExtraSettings.
+        */
+        virtual MProfileSet3DToneSettings& ProfileSet3DToneSettings() const;
+
+    private:
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        // Own: Push to talk settings
+        CProfilePttSettingsImpl* iPttSettings;
+
+        // Own: feedback settings
+        CProfileFeedbackSettingsImpl* iFeedbackSettings;
+
+        // Own: 3D tone settings
+        CProfile3DToneSettingsImpl* i3DToneSettings;
+
+    };
+
+#endif      // __CPROFILEEXTRASETTINGSIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileExtraTonesImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileExtraTonesImpl.h"
+#include "ProfilesVariant.hrh"
+#include <s32strm.h>
+#include <centralrepository.h>
+#include "ProfileEngUtils.h"
+#include "ProfileEnginePrivateCRKeys.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileExtraTonesImpl::ConstructL()
+    {
+    iIMMessageAlertTone = KNullDesC().AllocL();
+    iEmailAlertTone = KNullDesC().AllocL();
+    iVideoCallRingingTone = KNullDesC().AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileExtraTonesImpl::ConstructL(
+    const MProfileExtraTones& aProfileExtraTones )
+    {
+    iIMMessageAlertTone = aProfileExtraTones.IMMessageAlertTone().AllocL();
+    iEmailAlertTone = aProfileExtraTones.EmailAlertTone().AllocL();
+    iVideoCallRingingTone =
+        aProfileExtraTones.VideoCallRingingTone().AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileExtraTonesImpl* CProfileExtraTonesImpl::NewL()
+    {
+    CProfileExtraTonesImpl* self = new( ELeave ) CProfileExtraTonesImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileExtraTonesImpl* CProfileExtraTonesImpl::NewL(
+    const MProfileExtraTones& aProfileExtraTones )
+    {
+    CProfileExtraTonesImpl* self = new( ELeave ) CProfileExtraTonesImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfileExtraTones );
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+// Destructor
+CProfileExtraTonesImpl::~CProfileExtraTonesImpl()
+    {
+    delete iIMMessageAlertTone;
+    delete iEmailAlertTone;
+    delete iVideoCallRingingTone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::InternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileExtraTonesImpl::InternalizeL( CRepository& aCenRep,
+                                           TInt aProfileId )
+    {
+    delete iIMMessageAlertTone;
+    iIMMessageAlertTone = NULL;
+
+    TFileName toneFile;
+
+    // IM Message alert tone
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngImTone,
+            aProfileId ), toneFile ) );
+    iIMMessageAlertTone = toneFile.AllocL();
+
+    delete iEmailAlertTone;
+    iEmailAlertTone = NULL;
+
+    // E-mail alert tone
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngEmailTone,
+            aProfileId ), toneFile ) );
+    iEmailAlertTone = toneFile.AllocL();
+
+    delete iVideoCallRingingTone;
+    iVideoCallRingingTone = NULL;
+
+    // Video call ringing tone
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngVideoCallTone,
+            aProfileId ), toneFile ) );
+    iVideoCallRingingTone = toneFile.AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::ExternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileExtraTonesImpl::ExternalizeL( CRepository& aCenRep,
+                                           TInt aProfileId ) const
+    {
+    // IM Message Alert Tone
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngImTone,
+            aProfileId ), *iIMMessageAlertTone ) );
+
+    // E-mail Alert Tone
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngEmailTone,
+            aProfileId ), *iEmailAlertTone ) );
+
+    // Video call ringing tone
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngVideoCallTone,
+            aProfileId ), *iVideoCallRingingTone ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::IMMessageAlertTone
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileExtraTonesImpl::IMMessageAlertTone() const
+    {
+    return *iIMMessageAlertTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::SetIMMessageAlertToneL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileExtraTonesImpl::SetIMMessageAlertToneL(
+    const TDesC& aIMMessageAlertTone )
+    {
+    HBufC* tmp = aIMMessageAlertTone.Left( KMaxFileName ).AllocL();
+    delete iIMMessageAlertTone;
+    iIMMessageAlertTone = tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::EmailAlertTone
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileExtraTonesImpl::EmailAlertTone() const
+    {
+    return *iEmailAlertTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::SetEmailAlertToneL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileExtraTonesImpl::SetEmailAlertToneL(
+    const TDesC& aEmailAlertTone )
+    {
+    HBufC* tmp = aEmailAlertTone.Left( KMaxFileName ).AllocL();
+    delete iEmailAlertTone;
+    iEmailAlertTone = tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::VideoCallRingingTone
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileExtraTonesImpl::VideoCallRingingTone() const
+    {
+    return *iVideoCallRingingTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileExtraTonesImpl::SetVideoCallRingingToneL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileExtraTonesImpl::SetVideoCallRingingToneL(
+    const TDesC& aRingingTone )
+    {
+    HBufC* tmp = aRingingTone.Left( KMaxFileName ).AllocL();
+    delete iVideoCallRingingTone;
+    iVideoCallRingingTone = tmp;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile extra tones implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILEEXTRATONESIMPL_H
+#define __CPROFILEEXTRATONESIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MProfileExtraTones.h>
+#include "MProfileSetExtraTones.h"
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Profile extra tones implementation.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfileExtraTonesImpl) : public CBase,
+                               public MProfileExtraTones,
+                               public MProfileSetExtraTones
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileExtraTonesImpl* NewL();
+
+        /**
+        * Two-phased constructor. Copy constructor.
+        * @param aProfileExtraTones Profile extra tones
+        */
+        static CProfileExtraTonesImpl* NewL(
+            const MProfileExtraTones& aProfileExtraTones );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileExtraTonesImpl();
+
+    public: // New functions
+
+        /**
+        * Internalize data from the central repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to write the settings
+        */
+        void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfileExtraTones.
+        */
+        virtual const TDesC& IMMessageAlertTone() const;
+
+        /**
+        * From MProfileSetExtraTones.
+        */
+        virtual void SetIMMessageAlertToneL(
+            const TDesC& aIMMessageAlertTone );
+
+        /**
+        * From MProfileExtraTones.
+        */
+        virtual const TDesC& EmailAlertTone() const;
+
+        /**
+        * From MProfileSetExtraTones.
+        */
+        virtual void SetEmailAlertToneL(
+            const TDesC& aEmailAlertTone );
+
+        /**
+        * From MProfileExtraTones.
+        */
+        virtual const TDesC& VideoCallRingingTone() const;
+
+        /**
+        * From MProfileSetExtraTones.
+        */
+        virtual void SetVideoCallRingingToneL(
+            const TDesC& aRingingTone );
+
+    private:
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aProfileExtraTones Profile extra tones
+        */
+        void ConstructL( const MProfileExtraTones& aProfileExtraTones );
+
+    private:    // Data
+
+        // Own: IM Message Alert tone file name
+        HBufC* iIMMessageAlertTone;
+
+        // Own: Email Alert tone file name
+        HBufC* iEmailAlertTone;
+
+        // Own: Video call ringing tone file name
+        HBufC* iVideoCallRingingTone;
+    };
+
+#endif      // __CPROFILEEXTRATONESIMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileFeedbackSettingsImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileFeedbackSettingsImpl.h"
+#include <centralrepository.h>
+#include "ProfileEngUtils.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfilesDebug.h"
+
+#include <hwrmvibrasdkcrkeys.h>
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileFeedbackSettingsImpl* CProfileFeedbackSettingsImpl::NewL()
+    {
+    CProfileFeedbackSettingsImpl* self = new( ELeave ) CProfileFeedbackSettingsImpl;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileFeedbackSettingsImpl* CProfileFeedbackSettingsImpl::NewL(
+    const MProfileFeedbackSettings& aProfileFeedbackSettings )
+    {
+    CProfileFeedbackSettingsImpl* self = new( ELeave ) CProfileFeedbackSettingsImpl;
+
+    self->iTactileFeedback = aProfileFeedbackSettings.TactileFeedback();
+    self->iAudioFeedback = aProfileFeedbackSettings.AudioFeedback();
+
+    return self;
+    }
+
+
+// Destructor
+CProfileFeedbackSettingsImpl::~CProfileFeedbackSettingsImpl()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::InternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingsImpl::InternalizeL( CRepository& aCenRep,
+                                               TInt aProfileId )
+    {
+    PRODEBUG( "CProfileFeedbackSettings::InternalizeL begin" );
+    
+    InitPowerSaveMode();
+
+    if ( iPowerSaveMode )
+        {
+        iTactileFeedback = TProfileTactileFeedback( iPsmConfigTactileFeedback );
+        iAudioFeedback =  TProfileAudioFeedback( iPsmConfigAudioFeedback );
+        return;
+        }
+        
+    TInt tmp( 0 );
+    // Tactile feedback
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngTactileFeedback,
+            aProfileId ), tmp ) );
+    iTactileFeedback = TProfileTactileFeedback( tmp );
+
+    // Audio feedback
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngAudioFeedback,
+            aProfileId ), tmp ) );
+    iAudioFeedback = TProfileAudioFeedback( tmp );
+    PRODEBUG( "CProfileFeedbackSettings::InternalizeL return" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::ExternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingsImpl::ExternalizeL( CRepository& aCenRep,
+                                               TInt aProfileId ) const
+    {
+    if ( ProfileEngUtils::PowerSaveMode() )
+        {
+        return;
+        }
+        
+    // Tactile feedback
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngTactileFeedback,
+            aProfileId ), iTactileFeedback ) );
+
+    // Audio feedback
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngAudioFeedback,
+            aProfileId ), iAudioFeedback ) );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::TactileFeedback
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfileTactileFeedback CProfileFeedbackSettingsImpl::TactileFeedback() const
+    {
+    return iTactileFeedback;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::SetTactileFeedback
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingsImpl::SetTactileFeedback( TProfileTactileFeedback aTactileFeedback )
+    {
+    iTactileFeedback = aTactileFeedback;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::AudioFeedback
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfileAudioFeedback CProfileFeedbackSettingsImpl::AudioFeedback() const
+    {
+    return iAudioFeedback;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::SetAudioFeedback
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingsImpl::SetAudioFeedback( TProfileAudioFeedback aAudioFeedback )
+    {
+    iAudioFeedback = aAudioFeedback;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::InitPowerSaveMode
+//
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingsImpl::InitPowerSaveMode()
+    {
+    const TInt KTactileFeedbackOff = 0;
+    const TInt KAudioFeedbackOff = 0;
+
+    iPsmConfigTactileFeedback = KTactileFeedbackOff;
+    iPsmConfigAudioFeedback = KAudioFeedbackOff;
+
+    iPowerSaveMode = ProfileEngUtils::PowerSaveMode();
+    
+    if ( iPowerSaveMode )
+        {
+        TRAP_IGNORE( ReadPowerSaveConfigL() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingsImpl::ReadPowerSaveConfigL
+//
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingsImpl::ReadPowerSaveConfigL()
+    {
+    CRepository* cenrep = CRepository::NewLC( KCRUidVibraCtrl );
+    User::LeaveIfError( cenrep->Get( KVibraCtrlProfileFeedbackEnabled,
+                                     iPsmConfigTactileFeedback ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    
+    
+    cenrep = CRepository::NewLC( KCRUidProfileEngine );
+    User::LeaveIfError( cenrep->Get( KProEngActiveAudioFeedback,
+                                     iPsmConfigAudioFeedback ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    }
+
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile Feedback settings implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILEFEEDBACKSETTINGSIMPL_H
+#define __CPROFILEFEEDBACKSETTINGSIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MProfileFeedbackSettings.h>
+#include "MProfileSetFeedbackSettings.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Profile feedback settings implementation.
+*
+*  @lib ProfileEng.lib
+*  @since 5.0
+*/
+NONSHARABLE_CLASS(CProfileFeedbackSettingsImpl) : public CBase,
+                               public MProfileFeedbackSettings,
+                               public MProfileSetFeedbackSettings
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileFeedbackSettingsImpl* NewL();
+        static CProfileFeedbackSettingsImpl* NewL(
+                const MProfileFeedbackSettings& aProfileFeedbackSettings );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileFeedbackSettingsImpl();
+
+    public: // New functions
+
+        /**
+        * Internalize data from the central repository.
+        * @since 5.0
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 5.0
+        * @param aCenRep Central Repository object to write the settings
+        */
+        void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfileFeedbackSettings.
+        */
+        TProfileTactileFeedback TactileFeedback() const;
+
+        /**
+        * From MProfileFeedbackSettings.
+        */
+        TProfileAudioFeedback AudioFeedback() const;
+
+        /**
+        * From MProfileSetFeedbackSettings.
+        */
+        void SetTactileFeedback( TProfileTactileFeedback aTactileFeedback );
+
+        /**
+        * From MProfileSetFeedbackSettings.
+        */
+        void SetAudioFeedback( TProfileAudioFeedback aAudioFeedback );
+
+    private:
+        void InitPowerSaveMode();
+        void ReadPowerSaveConfigL();
+
+    private:    // Data
+
+        // Tactile feedback
+        TProfileTactileFeedback iTactileFeedback;
+
+        // Audio feedback
+        TProfileAudioFeedback iAudioFeedback;
+        
+        TInt iPsmConfigTactileFeedback;
+        TInt iPsmConfigAudioFeedback;
+        TBool iPowerSaveMode;
+    };
+
+#endif      // __CPROFILEFEEDBACKSETTINGSIMPL_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,601 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileImpl.h"
+#include <e32svr.h>
+#include <cntitem.h>
+#include <CPbkContactEngine.h>
+#include <cntdb.h>
+#include <cntdef.h>
+#include <TProfileToneSettings.h>
+#include <MProfilePttSettings.h>
+#include <featmgr.h>
+#include <bldvariant.hrh>
+#include <RSSSettings.h>
+#include <pathinfo.h>
+#include "CProfileNameImpl.h"
+#include "CProfileTonesImpl.h"
+#include "CProfileExtraTonesImpl.h"
+#include "CProfileExtraSettingsImpl.h"
+#include "CProfilePresenceImpl.h"
+#include "MProfilesLocalFeatures.h"
+#include "MProfileUtilitySingleton.h"
+#include "ProfilesVariant.hrh"
+#include "ProfileEngUtils.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include <ProfileEngineDomainConstants.h>
+
+// CONSTANTS
+// Max. number of Alert for groups:
+const TInt KProfilesMaxAlertForGroups = 512;
+const TInt KProfilesMaxFlagsLength = 4;
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::CProfileImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileImpl::CProfileImpl( RFs& aFs )
+    : iFs( aFs )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileImpl::ConstructL()
+    {
+    CommonConstructL();
+    iProfileName = CProfileNameImpl::NewL();
+    iProfileTones = CProfileTonesImpl::NewL();
+    iProfileExtraTones = CProfileExtraTonesImpl::NewL();
+    iProfilePresence = CProfilePresenceImpl::NewL();
+    // ProfileUtility must be released in destructor:
+    iFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() );
+    iProfileExtraSettings = CProfileExtraSettingsImpl::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileImpl::ConstructL(
+    const MProfileExtended& aProfile,
+    TInt aId )
+    {
+    iProfileName = CProfileNameImpl::NewLC( aId, KNullDesC );
+    CleanupStack::Pop();    // iProfileName
+    CommonConstructL();
+    iProfileTones = CProfileTonesImpl::NewL( aProfile.ProfileTones() );
+    iProfileExtraTones = CProfileExtraTonesImpl::NewL(
+        aProfile.ProfileExtraTones() );
+
+    iFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() );
+
+    iProfileExtraSettings = CProfileExtraSettingsImpl::NewL();
+    iProfilePresence = CProfilePresenceImpl::NewL(
+        aProfile.ProfilePresence() );
+    iVisibleFlags = aProfile.VisibleFlags();
+    iModifiableFlags = aProfile.ModifiableFlags();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileImpl* CProfileImpl::NewL(
+    RFs& aFs )
+    {
+    CProfileImpl* self = NewLC( aFs );
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileImpl* CProfileImpl::NewLC(
+    RFs& aFs )
+    {
+    CProfileImpl* self = new( ELeave ) CProfileImpl( aFs );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileImpl* CProfileImpl::NewLC(
+    RFs& aFs,
+    const MProfileExtended& aProfile,
+    TInt aId )
+    {
+    CProfileImpl* self = new( ELeave ) CProfileImpl( aFs );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfile, aId );
+
+    return self;
+    }
+
+// Destructor
+CProfileImpl::~CProfileImpl()
+    {
+    delete iSilentTone;
+    iAlertFor.Close();
+
+    delete iProfileExtraSettings;
+    
+    if ( iFeatures )
+        {
+        ReleaseProfileUtility();  
+        }
+        
+    delete iProfileName;
+    delete iProfileTones;
+    delete iProfileExtraTones;
+    delete iProfilePresence;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::IsProfileNameChanged
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileImpl::IsProfileNameChanged() const
+    {
+    return iProfileName->IsProfileNameChanged();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::SetLocalizedProfileNameL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileImpl::SetLocalizedProfileNameL(
+    const MProfilesNamesArray& aNameArray )
+    {
+    iProfileName->SetLocalizedProfileNameL( aNameArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::SetLocalizedProfileNameL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileImpl::SetLocalizedProfileNameL( const CProfileNameImpl& aNameImpl,
+                                             const TDesC& aUniquePart )
+    {
+    iProfileName->SetLocalizedProfileNameL( aNameImpl, aUniquePart );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::AlertForL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TArray<TContactItemId> CProfileImpl::AlertForL()
+    {
+    TInt contactIdListCount( iAlertFor.Count() );
+    if( contactIdListCount > 0 )
+        {
+        // create CPbkContactEngine
+        CPbkContactEngine* contactEngine = CPbkContactEngine::NewL( &iFs );
+        CleanupStack::PushL( contactEngine );
+        CContactIdArray* groupIds = contactEngine->Database().GetGroupIdListL();
+
+        if( !groupIds )
+            { // There are no groups in Contacts db -> clear the alert for IDs:
+            iAlertFor.Reset();
+            }
+        else
+            {
+            CleanupStack::PushL( groupIds );
+            TInt err;
+            for( TInt i( 0 ) ; i < contactIdListCount ; ++i )
+                {
+                err = groupIds->Find( iAlertFor[i] );
+
+                if( err == KErrNotFound )
+                    {
+                    // remove this
+                    iAlertFor.Remove( i );
+                    --contactIdListCount;
+                    --i;
+                    err = KErrNone;
+                    }
+                User::LeaveIfError( err );
+                }
+            CleanupStack::PopAndDestroy();  // groupIds
+            }
+        CleanupStack::PopAndDestroy();  // contactEngine
+        }
+
+    return iAlertFor.Array();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::IsSilent
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileImpl::IsSilent() const
+    {
+    TProfileRingingType ringType( iProfileTones->ToneSettings().iRingingType );
+    if ( ringType == EProfileRingingTypeSilent )
+        {
+        // If ringing type is silent, the whole profile is considered as silent:
+        return ETrue;
+        }
+
+    if ( ringType == EProfileRingingTypeBeepOnce )
+        {
+        // If ringing type is beep once, the profile can not be silent:
+        return EFalse;
+        }
+
+    TBool isSilent( EFalse );
+    TInt als( ESSSettingsAlsNotSupported );
+    ProfileEngUtils::GetAlternateLineService( als );
+
+    switch( als )
+        {
+        case ESSSettingsAlsAlternate:
+            {
+            const TDesC& ringingTone2 = iProfileTones->RingingTone2();
+            isSilent = ( ( ringingTone2.CompareF( KNullDesC ) == 0 ) ||
+                         ( ringingTone2.CompareF( *iSilentTone ) == 0 ) );
+                         
+            break;
+            }
+        case ESSSettingsAlsPrimary:  // Fall through
+        default: // = ESSSettingsAlsNotSupported
+            {
+            const TDesC& ringingTone1 = iProfileTones->RingingTone1();
+            isSilent = ( ( ringingTone1.CompareF( KNullDesC ) == 0 ) ||
+                         ( ringingTone1.CompareF( *iSilentTone ) == 0 ) );
+                         
+            break;
+            }
+        }
+
+    isSilent &= ( iProfileTones->MessageAlertTone().CompareF
+                        ( *iSilentTone ) == 0 );
+
+    if( iAlwaysOnLineEmail )
+        {
+        // Email is supported
+        const TDesC& emailTone = iProfileExtraTones->EmailAlertTone();
+        isSilent &= ( ( emailTone.CompareF( KNullDesC ) == 0 ) ||
+                      ( emailTone.CompareF( *iSilentTone ) == 0 ) );
+        }
+    if( iFeatures->IsFeatureSupported( KProEngFeatureIdVTRingingTone ) )
+        {
+        // VT ringing tone is supported
+        const TDesC& vtTone = iProfileExtraTones->VideoCallRingingTone();
+        isSilent &= ( ( vtTone.CompareF( KNullDesC ) == 0 ) ||
+                     ( vtTone.CompareF( *iSilentTone ) == 0 ) );
+        }
+    if( iOmaPoc )
+        {
+        // POC ringing tone is supported
+        const TDesC& pocTone = iProfileExtraSettings->ProfilePttSettings()
+            .PttRingingTone();
+        isSilent &= ( ( pocTone.CompareF( KNullDesC ) == 0 ) ||
+                     ( pocTone.CompareF( *iSilentTone ) == 0 ) );
+        }
+    return isSilent;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileSetName
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileSetName& CProfileImpl::ProfileSetName() const
+    {
+    return *iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileSetTones
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileSetTones& CProfileImpl::ProfileSetTones() const
+    {
+    return *iProfileTones;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfilePresence
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const MProfilePresence& CProfileImpl::ProfilePresence() const
+    {
+    return *iProfilePresence;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileSetPresence
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileSetPresence& CProfileImpl::ProfileSetPresence() const
+    {
+    return *iProfilePresence;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileSetExtraTones
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileSetExtraTones& CProfileImpl::ProfileSetExtraTones() const
+    {
+    return *iProfileExtraTones;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileSetExtraSettings
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfileSetExtraSettings& CProfileImpl::ProfileSetExtraSettings() const
+    {
+    return *iProfileExtraSettings;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileName
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const MProfileName& CProfileImpl::ProfileName() const
+    {
+    return *iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileTones
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const MProfileTones& CProfileImpl::ProfileTones() const
+    {
+    return *iProfileTones;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileExtraTones
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const MProfileExtraTones& CProfileImpl::ProfileExtraTones() const
+    {
+    return *iProfileExtraTones;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ProfileExtraSettings
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const MProfileExtraSettings& CProfileImpl::ProfileExtraSettings() const
+    {
+    return *iProfileExtraSettings;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::Release
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileImpl::Release()
+    {
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::ModifiableFlags
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TUint32 CProfileImpl::ModifiableFlags() const
+    {
+    return iModifiableFlags;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::VisibleFlags
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TUint32 CProfileImpl::VisibleFlags() const
+    {
+    return iVisibleFlags;
+    }
+
+void CProfileImpl::InternalizeL( CRepository& aCenRep, TInt aProfileId )
+    {
+    TBuf8< KProfilesMaxFlagsLength > flags;
+    // Flags
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngModifiableFlags,
+            aProfileId ), flags ) );
+    ProfileEngUtils::GetUint32Presentation( iModifiableFlags, flags, 0 );
+
+    flags.Zero();
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey(
+            KProEngVisibleFlags, aProfileId ), flags ) );
+    ProfileEngUtils::GetUint32Presentation( iVisibleFlags, flags, 0 );
+
+    // Profile name and id
+    iProfileName->InternalizeL( aCenRep, aProfileId );
+
+    // Alert for
+    ProfileEngUtils::GetBinarySettingL( aCenRep, ProfileEngUtils::ResolveKey(
+            KProEngAlertForGroups, aProfileId ), iAlertForBuf );
+            
+    TInt count( iAlertForBuf.Length() );
+    const TInt KProEngContactIdLength( 4 );
+    const TInt KProEngThreeByteShift( 24 );
+    const TInt KProEngTwoByteShift( 16 );
+    const TInt KProEngOneByteShift( 8 );
+
+    for( TInt i( 0 ); i < count ; i+=KProEngContactIdLength )
+        {
+        TUint32 id( ( iAlertForBuf[i] << KProEngThreeByteShift ) |
+                    ( iAlertForBuf[i+1] << KProEngTwoByteShift ) |
+                    ( iAlertForBuf[i+2] << KProEngOneByteShift ) |
+                    ( iAlertForBuf[i+3] ) );
+        User::LeaveIfError( iAlertFor.Append( TContactItemId( id ) ) );
+        }
+    iAlertFor.Compress();
+    iAlertForBuf.Zero();
+
+    // Profile tones and presence
+    iProfileTones->InternalizeL( aCenRep, aProfileId );
+    iProfileExtraTones->InternalizeL( aCenRep, aProfileId );
+
+    iProfilePresence->InternalizeL( aCenRep, aProfileId );
+    iProfileExtraSettings->InternalizeL( aCenRep, aProfileId );
+    }
+
+void CProfileImpl::ExternalizeL( CRepository& aCenRep )
+    {
+    TInt profileId = iProfileName->Id();
+
+    // Flags aren't externalized because they should not be modified in runtime
+
+    // Profile name and id
+    iProfileName->ExternalizeL( aCenRep );
+
+    // Alert for
+    iAlertForBuf.Zero();
+    TInt count( iAlertFor.Count() );
+    for( TInt i( 0 ) ; i < count ; ++i )
+        {
+        TContactItemId id( iAlertFor[i] );
+        TUint8 pieceOfId( ( iAlertFor[i] >> 24 ) & 0x000000FF );
+        iAlertForBuf.Append( pieceOfId );
+        pieceOfId = ( iAlertFor[i] >> 16 & 0x000000FF );
+        iAlertForBuf.Append( pieceOfId );
+        pieceOfId = ( iAlertFor[i] >> 8 & 0x000000FF );
+        iAlertForBuf.Append( pieceOfId );
+        pieceOfId = ( iAlertFor[i] & 0x000000FF );
+        iAlertForBuf.Append( pieceOfId );
+        }
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngAlertForGroups,
+            profileId ), iAlertForBuf ) );
+    iAlertForBuf.Zero();
+
+    // Tones and presence
+    iProfileTones->ExternalizeL( aCenRep, profileId );
+    iProfileExtraTones->ExternalizeL( aCenRep, profileId );
+    iProfilePresence->ExternalizeL( aCenRep, profileId );
+    iProfileExtraSettings->ExternalizeL( aCenRep, profileId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::SetAlertForL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileImpl::SetAlertForL( const TArray<TContactItemId>& aAlertFor )
+    {
+    TInt count( aAlertFor.Count() );
+    if( count > KProfilesMaxAlertForGroups )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    iAlertFor.Reset();
+
+    for( TInt i( 0 ) ; i < count ; ++i )
+        {
+        User::LeaveIfError( iAlertFor.Append( aAlertFor[i] ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::CommonConstructL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileImpl::CommonConstructL()
+    {
+    RBuf toneBuf;
+    toneBuf.CreateL( KMaxFileName );
+    CleanupClosePushL( toneBuf );
+    toneBuf.Copy( TParsePtrC( PathInfo::RomRootPath() ).Drive() );
+    toneBuf.Append( KProfileNoSoundPath );
+
+    iSilentTone = toneBuf.AllocL();
+    CleanupStack::PopAndDestroy(); // toneBuf
+
+    FeatureManager::InitializeLibL();
+    iAlwaysOnLineEmail = FeatureManager::FeatureSupported( KFeatureIdAlwaysOnLineEmail );
+    iOmaPoc = FeatureManager::FeatureSupported( KFeatureIdOmaPoc );
+    FeatureManager::UnInitializeLib();
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,278 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILEIMPL_H__
+#define __CPROFILEIMPL_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include "MProfileExtended.h"
+#include <centralrepository.h> // NCentralRepositoryConstants::KMaxBinaryLength
+
+// CONSTANTS
+// MACROS
+// DATA TYPES
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CProfileNameImpl;
+class CProfileTonesImpl;
+class CProfilePresenceImpl;
+class CProfileExtraTonesImpl;
+class CProfileExtraSettingsImpl;
+class CPGFileGenerator;
+class MProfilesNamesArray;
+class MProfilesLocalFeatures;
+struct TProfilePresenceSettings;
+
+// CLASS DECLARATION
+
+/**
+*  Profile implementation.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfileImpl) : public CBase,
+                     public MProfileExtended
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aFs Ref. to file server session.
+        */
+        static CProfileImpl* NewL( RFs& aFs );
+
+        /**
+        * Two-phased constructor.
+        * @param aFs Ref. to file server session.
+        */
+        static CProfileImpl* NewLC( RFs& aFs );
+
+        /**
+        * Two-phased constructor. Copy constructor.
+        * @param aFs Ref. to file server session
+        * @param aProfile Profile settings
+        * @param aId Profile ID
+        */
+        static CProfileImpl* NewLC(
+            RFs& aFs, const MProfileExtended& aProfile, TInt aId );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileImpl();
+
+    public: // New functions
+
+        /**
+        * Is profile names changed.
+        * @since 2.0
+        * @return ETrue if profile name is changed
+        */
+        TBool IsProfileNameChanged() const;
+
+        /**
+        * Set profile localized name.
+        * @since 2.0
+        * @param aNameArray Profiles names array
+        */
+        void SetLocalizedProfileNameL( const MProfilesNamesArray& aNameArray );
+
+        /**
+        * Set localised profile name.
+        * @since 3.1
+        * @param aNameImpl Profiles name impl from which the name and short name
+        *        are copied into this Profile.
+        * @param aUniquePart contains the part which is used to differentiate
+        *        the automatically generated names from each other. This is
+        *        merged in the name.
+        */
+        void SetLocalizedProfileNameL( const CProfileNameImpl& aNameImpl,
+                                       const TDesC& aUniquePart );
+
+        /**
+        * Internalize data from the central repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfile.
+        */
+        virtual void Release();
+
+        /**
+        * From MProfile.
+        */
+        virtual const TArray<TContactItemId> AlertForL();
+
+        /**
+        * From MProfile.
+        */
+        virtual TBool IsSilent() const;
+
+        /**
+        * From MProfile.
+        */
+        virtual const MProfileName& ProfileName() const;
+
+        /**
+        * From MProfile.
+        */
+        virtual const MProfileTones& ProfileTones() const;
+
+        /**
+        * From MProfile.
+        */
+        virtual const MProfileExtraTones& ProfileExtraTones() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual void SetAlertForL( const TArray<TContactItemId>& aAlertFor );
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual MProfileSetName& ProfileSetName() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual MProfileSetTones& ProfileSetTones() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual const MProfilePresence& ProfilePresence() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual MProfileSetPresence& ProfileSetPresence() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual MProfileSetExtraTones& ProfileSetExtraTones() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual TUint32 ModifiableFlags() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual TUint32 VisibleFlags() const;
+
+        /**
+        * From MProfile.
+        */
+        virtual const MProfileExtraSettings& ProfileExtraSettings() const;
+
+        /**
+        * From MProfileExtended.
+        */
+        virtual MProfileSetExtraSettings& ProfileSetExtraSettings() const;
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to write the settings
+        */
+        void ExternalizeL( CRepository& aCenRep );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        * aParam aFs Ref. to file server session
+        */
+        CProfileImpl( RFs& aFs );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aProfile Profile settings
+        * @param aId Profile ID
+        */
+        void ConstructL( const MProfileExtended& aProfile, TInt aId );
+
+        /**
+         * This method does the common part of the construction.
+         */
+        void CommonConstructL();
+
+    private:    // Data
+
+        // Own: Contact item array for alert for settings.
+        RArray<TContactItemId> iAlertFor;
+
+        // Own: Profile name implementation
+        CProfileNameImpl* iProfileName;
+
+        // Own: Profile tone settings implementation
+        CProfileTonesImpl* iProfileTones;
+
+        // Own: Profile extra tones settings implementation
+        CProfileExtraTonesImpl* iProfileExtraTones;
+
+        // Own: Profile extra settings implementation
+        CProfileExtraSettingsImpl* iProfileExtraSettings;
+
+        // Own: Profile presence settings implementation
+        CProfilePresenceImpl* iProfilePresence;
+
+        // Own: Profile modifiable flags
+        TUint32 iModifiableFlags;
+
+        // Own: Profile visible flags
+        TUint32 iVisibleFlags;
+
+        // Ref: File Server session
+        RFs& iFs;
+
+        // Not owned: Locally variated features of Profiles:
+        MProfilesLocalFeatures* iFeatures;
+
+        // Own: Contains the path to the empty sound file:
+        HBufC* iSilentTone;
+
+        // Buffer for storing/reading alert for groups in/from CenRep:
+        TBuf8< NCentralRepositoryConstants::KMaxBinaryLength > iAlertForBuf;
+
+        // Supported features
+        TBool iAlwaysOnLineEmail;
+        TBool iOmaPoc;
+    };
+
+#endif      // __CPROFILEIMPL_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,394 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileNameImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileNameImpl.h"
+#include <s32strm.h>
+#include <MProfilesNamesArray.h>
+#include "ProfileEngineConstants.h"
+#include <centralrepository.h>
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfileEngUtils.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::CProfileNameImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileNameImpl::CProfileNameImpl(
+    TInt aProfileId )
+    : iId( aProfileId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::ConstructL(
+    const TDesC& aProfileName )
+    {
+    iProfileName = aProfileName.AllocL();
+    iShortName = NULL;
+    iNaviName = NULL;
+    iTitleName = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::ConstructL(
+    const CProfileNameImpl& aProfileNameImpl )
+    {
+    iId = aProfileNameImpl.iId;
+    iProfileName = aProfileNameImpl.iProfileName->AllocL();
+    if( aProfileNameImpl.iShortName &&
+        aProfileNameImpl.iNaviName &&
+        aProfileNameImpl.iTitleName )
+        {
+        iShortName = aProfileNameImpl.iShortName->AllocL(); 
+        iNaviName = aProfileNameImpl.iNaviName->AllocL(); 
+        iTitleName = aProfileNameImpl.iTitleName->AllocL(); 
+        }
+    else
+        {
+        iShortName = NULL;
+        iNaviName = NULL;
+        iTitleName = NULL;
+        iNameChanged = ETrue;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::ConstructL(
+    const TDesC& aProfileName,
+    const TDesC& aShortName,
+    const TDesC& aNaviName,
+    const TDesC& aTitleName )
+    {
+    iProfileName = aProfileName.AllocL();
+    iShortName = aShortName.AllocL();
+    iNaviName = aNaviName.AllocL();
+    iTitleName = aTitleName.AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileNameImpl* CProfileNameImpl::NewL()
+    {
+    CProfileNameImpl* self = NewLC( 0, KNullDesC );
+
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileNameImpl* CProfileNameImpl::NewLC(
+    TInt aProfileId,
+    const TDesC& aProfileName )
+    {
+    CProfileNameImpl* self = new ( ELeave ) CProfileNameImpl( aProfileId );
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfileName );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileNameImpl* CProfileNameImpl::NewLC(
+    TInt aProfileId,
+    const TDesC& aProfileName,
+    const TDesC& aShortName,
+    const TDesC& aNaviName,
+    const TDesC& aTitleName )
+    {
+    CProfileNameImpl* self = new ( ELeave ) CProfileNameImpl( aProfileId );
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfileName, aShortName, aNaviName, aTitleName );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileNameImpl* CProfileNameImpl::NewLC(
+    const CProfileNameImpl& aProfileNameImpl )
+    {
+    CProfileNameImpl* self = 
+        new ( ELeave ) CProfileNameImpl( aProfileNameImpl.iId );
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfileNameImpl );
+    return self;
+    }
+
+// Destructor
+CProfileNameImpl::~CProfileNameImpl()
+    {
+    delete iTitleName;
+    delete iNaviName;
+    delete iShortName;
+    delete iProfileName;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::IsProfileNameChanged
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileNameImpl::IsProfileNameChanged() const
+    {
+    return iNameChanged;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::SetLocalizedProfileNameL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::SetLocalizedProfileNameL(
+    const MProfilesNamesArray& aNameArray )
+    {
+    SetNameInternalL( iProfileName,
+                      aNameArray.MdcaPoint( aNameArray.FindById( iId ) ) );
+    SetNameInternalL( iShortName,
+            aNameArray.ProfileName( aNameArray.FindById( iId ) )->ShortName() );
+    SetNameInternalL( iNaviName,
+            aNameArray.ProfileName( aNameArray.FindById( iId ) )->NaviName() );
+    SetNameInternalL( iTitleName,
+            aNameArray.ProfileName( aNameArray.FindById( iId ) )->TitleName() );
+    iNameChanged = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileImpl::SetLocalizedProfileNameL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::SetLocalizedProfileNameL(
+    const CProfileNameImpl& aNameImpl, const TDesC& aUniquePart )
+    {
+    TBuf<KProfileMaxNameLength> nameBuf;
+
+    nameBuf.Copy( aNameImpl.Name() );
+    nameBuf.Append( aUniquePart );
+    SetNameInternalL( iProfileName, nameBuf );
+
+    nameBuf.Copy( aNameImpl.ShortName() );
+    nameBuf.Append( aUniquePart );
+    SetNameInternalL( iShortName, nameBuf );
+
+    nameBuf.Copy( aNameImpl.NaviName() );
+    nameBuf.Append( aUniquePart );
+    SetNameInternalL( iNaviName, nameBuf );
+
+    nameBuf.Copy( aNameImpl.TitleName() );
+    nameBuf.Append( aUniquePart );
+    SetNameInternalL( iTitleName, nameBuf );
+
+    iNameChanged = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::InternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::InternalizeL( CRepository& aCenRep, TInt aProfileId )
+    {
+    delete iShortName;
+    iShortName = NULL;
+
+    delete iNaviName;
+    iNaviName = NULL;
+
+    delete iTitleName;
+    iTitleName = NULL;
+
+    TInt tmp( 0 );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey(
+            KProEngNameChanged, aProfileId ), tmp ) );
+
+    TBuf< KProfileMaxNameLength > nameBuf;
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey(
+            KProEngProfileName, aProfileId ), nameBuf ) );
+    HBufC* tmpName = nameBuf.AllocL();
+    delete iProfileName;
+
+    iId = aProfileId;
+    iProfileName = tmpName;
+    iNameChanged = tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::ExternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::ExternalizeL( CRepository& aCenRep ) const
+    {
+    if( iNameChanged )
+        {
+        User::LeaveIfError(
+                aCenRep.Set( ProfileEngUtils::ResolveKey(
+                        KProEngNameChanged, iId ),
+                        iNameChanged ) );
+        User::LeaveIfError(
+                aCenRep.Set( ProfileEngUtils::ResolveKey(
+                        KProEngProfileName, iId ),
+                        *iProfileName ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::SetNameL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::SetNameL(
+    const TDesC& aName )
+    {
+    SetNameInternalL( iProfileName, aName );
+    // User changed the name, iShortName,iNaviName,iTitleName are not needed
+    // anymore:
+    delete iShortName;
+    iShortName = NULL;
+
+    delete iNaviName;
+    iNaviName = NULL;
+
+    delete iTitleName;
+    iTitleName = NULL;
+
+    iNameChanged = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::Name
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileNameImpl::Name() const
+    {
+    return *iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::Id
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfileNameImpl::Id() const
+    {
+    return iId;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::ShortName
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileNameImpl::ShortName() const
+    {
+    if( iShortName )
+        {
+        return *iShortName;
+        }
+    return *iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::NaviName
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileNameImpl::NaviName() const
+    {
+    if( iNaviName )
+        {
+        return *iNaviName;
+        }
+    return *iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::TitleName
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileNameImpl::TitleName() const
+    {
+    if( iTitleName )
+        {
+        return *iTitleName;
+        }
+    return *iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::SetNameInternalL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileNameImpl::SetNameInternalL( HBufC*& aNameFieldRef,
+    const TDesC& aName )
+    {
+    HBufC* tmp = aName.Left( KProfileMaxNameLength ).AllocL();
+    delete aNameFieldRef;
+    aNameFieldRef = tmp;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,223 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile name implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILENAMEIMPL_H
+#define __CPROFILENAMEIMPL_H
+
+//  INCLUDES
+#include <MProfileName.h>
+#include <e32base.h>
+#include "MProfileSetName.h"
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class MProfilesNamesArray;
+class CRepository;
+// CLASS DECLARATION
+
+/**
+*  Profile name implementation.
+*  This class implements MProfileName and MProfileSetName interfaces.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfileNameImpl) : public CBase,
+                         public MProfileName,
+                         public MProfileSetName
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileNameImpl* NewL();
+
+        /**
+        * Two-phased constructor.
+        * @param aProfileId Profile ID
+        * @param aProfileName Profile name
+        */
+        static CProfileNameImpl* NewLC(
+            TInt aProfileId, const TDesC& aProfileName );
+
+        /**
+        * Two-phased constructor.
+        * @param aProfileId Profile ID
+        * @param aProfileName Profile name
+        * @param aShortName Profile short name
+        * @param aNaviName Profile short name
+        */
+        static CProfileNameImpl* NewLC(
+            TInt aProfileId,
+            const TDesC& aProfileName,
+            const TDesC& aShortName,
+            const TDesC& aNaviName,
+            const TDesC& aTitleName );
+
+        /**
+        * Two-phased copy-constructor.
+        * @param aProfileNameImpl profile name implementation to be copied.
+        */
+        static CProfileNameImpl* NewLC(
+                const CProfileNameImpl& aProfileNameImpl );
+            
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileNameImpl();
+
+    public: // New functions
+
+        /**
+        * Is profile names changed.
+        * @since 2.0
+        * @return ETrue if names is changed
+        */
+        TBool IsProfileNameChanged() const;
+
+        /**
+        * Set localised profile name.
+        * @since 2.0
+        * @param aNameArray Profiles names array
+        */
+        void SetLocalizedProfileNameL( const MProfilesNamesArray& aNameArray );
+
+        /**
+        * Set localised profile name.
+        * @since 3.1
+        * @param aNameImpl Profiles name impl from which the name and short name
+        *        are copied into this Profile Name.
+        * @param aUniquePart contains the part which is used to differentiate
+        *        the automatically generated names from each other. This is
+        *        merged in the name.
+        */
+        void SetLocalizedProfileNameL( const CProfileNameImpl& aNameImpl,
+                                       const TDesC& aUniquePart );
+    
+        /**
+        * Internalize data from the central repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to the stream.
+        * @since 2.0
+        * @param aStream Write stream
+        */
+        void ExternalizeL( CRepository& aCenRep ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfileName.
+        */
+        virtual const TDesC& Name() const;
+
+        /**
+        * From MProfileName.
+        */
+        virtual TInt Id() const;
+
+        /**
+        * From MProfileSetName.
+        */
+        virtual void SetNameL( const TDesC& aName );
+
+        /**
+        * From MProfileName.
+        */
+        virtual const TDesC& ShortName() const;
+
+        /**
+        * From MProfileName.
+        */
+        virtual const TDesC& NaviName() const;
+
+        /**
+        * From MProfileName.
+        */
+        virtual const TDesC& TitleName() const;
+
+    protected: // New functions
+
+        /**
+        * Set profile name, do not set iNameChanged.
+        * @since 3.2
+        * @param aName Profile name
+        */
+        void SetNameInternalL( HBufC*& aNameFieldRef, const TDesC& aName );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        * @param aProfileId Profile ID
+        */
+        CProfileNameImpl( TInt aProfileId );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aProfileName Profile name
+        */
+        void ConstructL( const TDesC& aProfileName );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aProfileName Profile name
+        * @param aShortName Profile short name
+        * @param aNaviName Profile navi name
+        */
+        void ConstructL( const TDesC& aProfileName, const TDesC& aShortName,
+                         const TDesC& aNaviName, const TDesC& aTitleName );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aProfileNameImpl a profile name implementation to be copied.
+        */
+        void ConstructL( const CProfileNameImpl& aProfileNameImpl );
+            
+    private:    // Data
+
+        // Own: Is name changed
+        TBool iNameChanged;
+
+        // Own: Profile ID
+        TInt iId;
+
+        // Own: Profile Name
+        HBufC* iProfileName;
+
+        // Own: Profile Name for navi pane with tabs
+        HBufC* iShortName;
+
+        // Own: Profile Name for navi pane
+        HBufC* iNaviName;
+
+        // Own: Profile Name for title pane
+        HBufC* iTitleName;
+
+    };
+
+#endif      // __CPROFILENAMEIMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfilePresenceImpl.
+*                This implementation is used when presence is supported.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfilePresenceImpl.h"
+#include <centralrepository.h>
+#include <bautils.h>
+#include <barsc.h>
+#include <ProfileEng.rsg>
+#include "ProfileEng.hrh"
+#include "ProfileEngineConstants.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfileEngUtils.h"
+
+// EXTERNAL DATA STRUCTURES
+// EXTERNAL FUNCTION PROTOTYPES
+// CONSTANTS
+const TInt KProfileMaxStatusMessageLength( PROFILES_MAX_STATUS_MSG_LENGTH );
+
+// MACROS
+// LOCAL CONSTANTS AND MACROS
+// MODULE DATA STRUCTURES
+// LOCAL FUNCTION PROTOTYPES
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CProfileNameImpl::CProfilePresenceImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilePresenceImpl::CProfilePresenceImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfilePresenceImpl::ConstructL()
+    {
+    iStatusMessage = KNullDesC().AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfilePresenceImpl::ConstructL(
+    const MProfilePresence& aPresence )
+    {
+    iStatusMessage = aPresence.StatusMessage().AllocL();
+    iAvailabilityAttribute = aPresence.AvailabilityAttribute();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfilePresenceImpl* CProfilePresenceImpl::NewL()
+    {
+    CProfilePresenceImpl* self = new( ELeave ) CProfilePresenceImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfilePresenceImpl* CProfilePresenceImpl::NewL(
+    const MProfilePresence& aPresence )
+    {
+    CProfilePresenceImpl* self = new( ELeave ) CProfilePresenceImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aPresence );
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// Destructor
+CProfilePresenceImpl::~CProfilePresenceImpl()
+    {
+    delete iStatusMessage;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::InternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePresenceImpl::InternalizeL( CRepository& aCenRep,
+                                           TInt aProfileId )
+    {
+    delete iStatusMessage;
+    iStatusMessage = NULL;
+
+    // Status message
+    TBuf< KProfileMaxStatusMessageLength > buf;
+    aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngStatusMsg,
+                 aProfileId ), buf );
+    iStatusMessage = buf.AllocL();
+
+    // AvailabilityAttribute
+    TInt tmpAttr( 0 );
+    aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngAvailAttribute,
+                 aProfileId ), tmpAttr );
+    iAvailabilityAttribute = tmpAttr;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::ExternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePresenceImpl::ExternalizeL( CRepository& aCenRep,
+                                           TInt aProfileId ) const
+    {
+    aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngStatusMsg,
+                 aProfileId ), *iStatusMessage );
+    aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngAvailAttribute,
+                 aProfileId ), ( TInt ) iAvailabilityAttribute );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::AvailabilityAttribute
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TUint32 CProfilePresenceImpl::AvailabilityAttribute() const
+    {
+    return iAvailabilityAttribute;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::SetAvailabilityAttribute
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePresenceImpl::SetAvailabilityAttribute(
+    const TUint32 aAvailabilityAttribute )
+    {
+    iAvailabilityAttribute = aAvailabilityAttribute;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::StatusMessage
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfilePresenceImpl::StatusMessage() const
+    {
+    return *iStatusMessage;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePresenceImpl::SetStatusMessageL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePresenceImpl::SetStatusMessageL(
+    const TDesC& aStatusMessage )
+    {
+    HBufC* tmp = aStatusMessage.Left( KProfileMaxStatusMessageLength ).AllocL();
+    delete iStatusMessage;
+    iStatusMessage = tmp;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile presence settings implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILEPRESENCEIMPL_H
+#define __CPROFILEPRESENCEIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "MProfilePresence.h"
+#include "MProfileSetPresence.h"
+
+// CONSTANTS
+// MACROS
+// DATA TYPES
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Profile presence settings implementation.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfilePresenceImpl) : public CBase,
+                             public MProfilePresence,
+                             public MProfileSetPresence
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aFs Ref. to file server session.
+        */
+        static CProfilePresenceImpl* NewL();
+
+        /**
+        * Two-phased constructor. Copy constructor.
+        * @param aFs Ref. to file server session.
+        * @param aPresence Profile presence settings.
+        */
+        static CProfilePresenceImpl* NewL(
+            const MProfilePresence& aPresence );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfilePresenceImpl();
+
+    public: // New functions
+
+        /**
+        * Internalize data from the Central Repository.
+        * @since 2.0
+        * @param aCenRep profiles central repository
+        * @param aProfileId id of the profile which is read
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to the Central Repository.
+        * @since 2.0
+        * @param aCenRep profiles central repository
+        * @param aProfileId id of the profile which is written
+        */
+        void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfilePresence.
+        */
+        virtual TUint32 AvailabilityAttribute() const;
+
+        /**
+        * From MProfilePresence.
+        */
+        virtual const TDesC& StatusMessage() const;
+
+        /**
+        * From MProfileSetPresence.
+        */
+        virtual void SetAvailabilityAttribute(
+            const TUint32 aAvailabilityAttribute );
+
+        /**
+        * From MProfileSetPresence.
+        */
+        virtual void SetStatusMessageL( const TDesC& aStatusMessage );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        * @param aFs Ref. to file server session.
+        */
+        CProfilePresenceImpl();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aPresence Presence settings.
+        */
+        void ConstructL( const MProfilePresence& aPresence );
+
+    private:    // Data
+
+        // Own: Availability attribute
+        TUint32 iAvailabilityAttribute;
+
+        // Own: Status message
+        HBufC* iStatusMessage;
+
+    };
+
+#endif      //  __CPROFILEPRESENCEIMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfilePttSettingsImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfilePttSettingsImpl.h"
+#include <centralrepository.h>
+#include "ProfileEngUtils.h"
+#include "ProfileEnginePrivateCRKeys.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfilePttSettingsImpl::ConstructL()
+    {
+    iPttRingingTone = KNullDesC().AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfilePttSettingsImpl::ConstructL(
+    const MProfilePttSettings& aProfilePttSettings )
+    {
+    iPttRingingTone = aProfilePttSettings.PttRingingTone().AllocL();
+    iPttStatus = aProfilePttSettings.PttStatus();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfilePttSettingsImpl* CProfilePttSettingsImpl::NewL()
+    {
+    CProfilePttSettingsImpl* self = new( ELeave ) CProfilePttSettingsImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfilePttSettingsImpl* CProfilePttSettingsImpl::NewL(
+    const MProfilePttSettings& aProfilePttSettings )
+    {
+    CProfilePttSettingsImpl* self = new( ELeave ) CProfilePttSettingsImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfilePttSettings );
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+// Destructor
+CProfilePttSettingsImpl::~CProfilePttSettingsImpl()
+    {
+    delete iPttRingingTone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::InternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePttSettingsImpl::InternalizeL( CRepository& aCenRep,
+                                            TInt aProfileId )
+    {
+    delete iPttRingingTone;
+    iPttRingingTone = NULL;
+
+    TFileName toneFile;
+
+    // PTT ringing tone
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngPttTone,
+            aProfileId ), toneFile ) );
+    iPttRingingTone = toneFile.AllocL();
+
+    // PTT status
+    TInt status( 0 );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngPttStatus,
+            aProfileId ), status ) );
+    iPttStatus = TProfilePttStatus( status );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::ExternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePttSettingsImpl::ExternalizeL( CRepository& aCenRep,
+                                            TInt aProfileId ) const
+    {
+    // PTT Ringing tone
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngPttTone,
+            aProfileId ), *iPttRingingTone ) );
+
+    // PTT status
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngPttStatus,
+            aProfileId ), iPttStatus ) );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::PttRingingTone
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfilePttSettingsImpl::PttRingingTone() const
+    {
+    return *iPttRingingTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::SetPttRingingToneL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePttSettingsImpl::SetPttRingingToneL( const TDesC& aPttRingingTone )
+    {
+    HBufC* tmp = aPttRingingTone.Left( KMaxFileName ).AllocL();
+    delete iPttRingingTone;
+    iPttRingingTone = tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::PttStatus
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfilePttStatus CProfilePttSettingsImpl::PttStatus() const
+    {
+    return iPttStatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePttSettingsImpl::PttStatus
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilePttSettingsImpl::SetPttStatus( TProfilePttStatus aPttStatus )
+    {
+    iPttStatus = aPttStatus;
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile PTT settings implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILEPTTSETTINGSIMPL_H
+#define __CPROFILEPTTSETTINGSIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MProfilePttSettings.h>
+#include "MProfileSetPttSettings.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Profile extra tones implementation.
+*
+*  @lib ProfileEng.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS(CProfilePttSettingsImpl) : public CBase,
+                               public MProfilePttSettings,
+                               public MProfileSetPttSettings
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfilePttSettingsImpl* NewL();
+        static CProfilePttSettingsImpl* NewL(
+                const MProfilePttSettings& aProfilePttSettings );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfilePttSettingsImpl();
+
+    public: // New functions
+
+        /**
+        * Internalize data from the central repository.
+        * @since 3.1
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 3.1
+        * @param aCenRep Central Repository object to write the settings
+        */
+        void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfilePttSettings.
+        */
+        const TDesC& PttRingingTone() const;
+
+        /**
+        * From MProfilePttSettings.
+        */
+        TProfilePttStatus PttStatus() const;
+
+        /**
+        * From MProfileSetPttSettings.
+        */
+        void SetPttRingingToneL( const TDesC& aPttRingingTone );
+
+        /**
+        * From MProfileSetPttSettings.
+        */
+        void SetPttStatus( TProfilePttStatus aPttStatus );
+
+    private:
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aProfileExtraTones Profile extra tones
+        */
+        void ConstructL( const MProfilePttSettings& aProfilePttSettings );
+
+    private:    // Data
+
+        // Own: PTT ringing tone
+        HBufC* iPttRingingTone;
+
+        // Own: PTT status
+        TProfilePttStatus iPttStatus;
+    };
+
+#endif      // __CPROFILEPTTSETTINGSIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,304 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProfileTiming.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProfileTiming.h"
+#include <ProfilesVariant.hrh>
+#include <f32file.h> // TParse
+#include <data_caging_path_literals.hrh>
+#include "MProfilesLocalFeatures.h"
+#include "ProfileEngineConstants.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfilesDebug.h"
+
+// LOCAL CONSTANTS AND MACROS
+namespace
+    {
+    _LIT( KProfileScheduledTask, "z:PROFILESCHEDULEEVENT.exe" );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::CProfileTiming
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileTiming::CProfileTiming( CRepository& aProfileRepository,
+                                MProfilesLocalFeatures& aFeatures )
+    : iRepository( aProfileRepository ), iFeatures( aFeatures )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileTiming::ConstructL()
+    {
+    if( iFeatures.IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        iEntryList = new ( ELeave ) CArrayFixFlat<TScheduleEntryInfo2>( 1 );
+
+        iTaskData = KNullDesC().AllocL();
+
+        TParse* tp = new ( ELeave ) TParse();
+        tp->Set( KProfileScheduledTask, &KDC_SHARED_LIB_DIR, NULL );
+        iTaskDllPath.Copy( tp->FullName() );
+        delete tp;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileTiming* CProfileTiming::NewL( CRepository& aProfileRepository,
+                                      MProfilesLocalFeatures& aFeatures )
+    {
+    CProfileTiming* self = 
+        new( ELeave ) CProfileTiming( aProfileRepository, aFeatures );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+// Destructor
+CProfileTiming::~CProfileTiming()
+    {
+    if( iFeatures.IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        iScheduler.Close();
+
+        if( iEntryList )
+            {
+            iEntryList->Reset();
+            }
+        delete iEntryList;
+        delete iTaskData;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::SetTimedProfileL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTiming::SetTimedProfileL( TInt aPreviousId, TTime aTime )
+    {
+    PRODEBUG1( "CProfileTiming:SetTimedProfile( %d )", aPreviousId );
+    if( !iFeatures.IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        return;
+        }
+
+    ConnectToSchedulerL();
+
+    const TTimeIntervalMinutes KProfileMaxTiming( 1440 );
+    const TInt KProfileOnce( 1 );
+    const TInt KProfileDontCare( 0 );
+    _LIT( KProfileTaskName, "TimedProfileTask" );
+    _LIT( KProfileSchedulerItemRefName, "ProfileItemRef" );
+    iEntryList->Reset();
+
+    // iStartTime contains the time when the timed profile deactivates and the
+    // validity period makes sure that the timing will go off in the nearest
+    // 24 hours.
+    TTsTime ttsTime;
+    ttsTime.SetLocalTime( aTime );
+    TScheduleEntryInfo2 entryInfo( ttsTime, EHourly, KProfileOnce, KProfileMaxTiming );
+    iEntryList->AppendL( entryInfo );
+
+    TName name( KProfileTaskName() );
+    TTaskInfo taskInfo( KProfileDontCare, name, CActive::EPriorityStandard,
+                        KProfileOnce ) ;
+
+    TName name2( KProfileSchedulerItemRefName() );
+    iSchedulerItemRef.iName = name2;
+
+    PRODEBUG( "CProfileTiming:SetTimedProfile before CreatePers" );
+    TInt error( iScheduler.CreatePersistentSchedule( iSchedulerItemRef,
+                                                     *iEntryList ) );
+    PRODEBUG1( "CProfileTiming:SetTimedProfile after CreatePers, err=%d )", error );
+    if( !error )
+        {
+        error = iScheduler.ScheduleTask( taskInfo, *iTaskData,
+                                         iSchedulerItemRef.iHandle );
+        PRODEBUG1( "CProfileTiming:SetTimedProfile after ScheduleTask, err=%d )", error );
+        if( error )
+            {
+            iScheduler.DeleteSchedule( iSchedulerItemRef.iHandle );
+            }
+        else
+            {
+            iTaskId = taskInfo.iTaskId;
+            PRODEBUG( "CProfileTiming:SetTimedProfile before SaveSchedulingData" );
+            SaveSchedulingData( aPreviousId, iSchedulerItemRef.iHandle,
+                                iTaskId );
+            PRODEBUG( "CProfileTiming:SetTimedProfile after SaveSchedulingData" );
+            }
+        }
+
+    PRODEBUG1( "CProfileTiming:SetTimedProfile before return:%d", error );
+    User::LeaveIfError( error );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::RollbackTimedProfile
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTiming::RollbackTimedProfile()
+    {
+    PRODEBUG( "CProfileTiming:RollbackTimedProfile" );
+    if( !iFeatures.IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        return;
+        }
+
+    // Ignore errors here, there's already an error occurred because  this
+    // method is called
+    iScheduler.DeleteTask( iTaskId );
+    iScheduler.DeleteSchedule( iSchedulerItemRef.iHandle );
+    PRODEBUG( "CProfileTiming:RollbackTimedProfile end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::CancelTimedProfile
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfileTiming::CancelTimedProfileL()
+    {
+    PRODEBUG( "CProfileTiming:CancelTimedProfileL" );
+    if( !iFeatures.IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        return KErrNone;
+        }
+
+    TInt previousId( KErrNotFound );
+    TInt taskId( KErrNotFound );
+    GetSchedulingDataL( previousId, iSchedulerItemRef.iHandle, taskId );
+    PRODEBUG1( "CProfileTiming:CancelTimedProfileL previousid=%d", previousId );
+    if( previousId != KErrNotFound )
+        {
+        ConnectToSchedulerL();
+        TInt error( iScheduler.DeleteTask( taskId ) );
+        PRODEBUG1( "CProfileTiming:CancelTimedProfileL after deletetask err=%d", error );
+        if( ( error != KErrNone ) && ( error != KErrNotFound ) )
+            {
+            User::Leave( error );
+            }
+
+        error = iScheduler.DeleteSchedule( iSchedulerItemRef.iHandle );
+        PRODEBUG1( "CProfileTiming:CancelTimedProfileL after deletesched err=%d", error );
+        if( ( error != KErrNone ) && ( error != KErrNotFound ) )
+            {
+            User::Leave( error );
+            }
+                            
+        SaveSchedulingData(); // resets timing data in cenrep
+        PRODEBUG( "CProfileTiming:CancelTimedProfileL after SaveSchedulingData" );
+        }
+    PRODEBUG( "CProfileTiming:CancelTimedProfileL end" );
+    return previousId;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::IsTimingActiveL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileTiming::IsTimingActiveL()
+    {
+    PRODEBUG( "CProfileTiming:IsTimingActiveL" );
+    TBool result( EFalse );
+
+    if( iFeatures.IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        User::LeaveIfError( iRepository.Get( KProEngSchedulerHandleId,
+                            iSchedulerItemRef.iHandle ) );
+        result = ( iSchedulerItemRef.iHandle != KErrNotFound );
+        }
+
+    PRODEBUG1( "CProfileTiming:IsTimingActiveL returning:%d", result );
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::SaveSchedulingData
+// The errors are ignored inside this method, because this class is used only
+// inside CentralRepository transactions.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTiming::SaveSchedulingData( TInt aPreviousId, TInt aHandleId,
+                                         TInt aTaskId )
+    {
+    iRepository.Set( KProEngSchedulerHandleId, aHandleId );
+    iRepository.Set( KProEngPreviousActiveId, aPreviousId );
+    iRepository.Set( KProEngSchedulerTaskId, aTaskId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::GetSchedulingData
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTiming::GetSchedulingDataL( TInt& aPreviousId, TInt& aHandleId,
+                                         TInt& aTaskId )
+    {
+    PRODEBUG( "CProfileTiming:GetSchedulingDataL" );
+    User::LeaveIfError(
+            iRepository.Get( KProEngPreviousActiveId, aPreviousId ) );
+    User::LeaveIfError(
+            iRepository.Get( KProEngSchedulerHandleId, aHandleId ) );
+    User::LeaveIfError( iRepository.Get( KProEngSchedulerTaskId, aTaskId ) );
+    PRODEBUG( "CProfileTiming:GetSchedulingDataL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTiming::ConnectToSchedulerL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTiming::ConnectToSchedulerL()
+    {
+    // Feature support is not tested here because it must have been done already
+    // in the calling method.
+    if( !iConnected )
+        {
+        User::LeaveIfError( iScheduler.Connect() );
+
+        User::LeaveIfError( iScheduler.Register( iTaskDllPath,
+                                                 CActive::EPriorityStandard ) );
+        iConnected = ETrue;
+        }
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileTiming.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class handles the interaction with the scheduler and
+*                updates the data needed by timed profiles to Central
+*                Repository.
+*
+*/
+
+
+
+#ifndef CPROFILETIMING_H
+#define CPROFILETIMING_H
+
+//  INCLUDES
+#include <csch_cli.h>
+#include <centralrepository.h>
+
+// FORWARD DECLARATIONS
+class MProfilesLocalFeatures;
+
+// CLASS DECLARATION
+
+/**
+*  The interface to the timed profile.
+*  This class handles the interaction with the scheduler and updates the data
+*  needed by timed profiles to Central Repository.
+*
+*  @lib profileeng.lib
+*  @since S60 3.2
+*/
+NONSHARABLE_CLASS( CProfileTiming ) : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileTiming* NewL( CRepository& aProfileRepository,
+                                     MProfilesLocalFeatures& aFeatures );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileTiming();
+
+    public: // New functions
+
+        /**
+         * Times the profile with the given ID.
+         * @param aPreviousId the ID of the profile to be activated after the
+         *        timer expires. This is the profile which was active before
+         *        the current profile was timed.
+         * @param aTime the time when the timer expires.
+         */
+        void SetTimedProfileL( TInt aPreviousId, TTime aTime );
+
+        /**
+         * Deletes the newly-scheduled task for timed profile. This is used
+         * only when update to Central Repository has failed. Does not return
+         * any error codes or leave because this will be called only in error
+         * situation and there isn't much that could do if this fails also.
+         */
+        void RollbackTimedProfile();
+
+        /**
+         * Cancels the current timed profile if one is active.
+         * @returns the ID of the profile which was active before the
+         *          cancelled timed profile or KErrNotFound.
+         */
+        TInt CancelTimedProfileL();
+
+        /**
+         * Returns boolean value indicating whether there is currently an
+         * active timing.
+         * @return ETrue if the current active profile is timed, EFalse
+         *         otherwise.
+         */
+        TBool IsTimingActiveL();
+
+    private: // New functions
+
+        /**
+         * Saves the data needed by timer task DLL and for cancelling the task
+         * in Central Repository.
+         * @param aPreviousId the ID of the profile which was active before the
+         *        timed profile. This is the profile which should be reactivated
+         *        when the timer goes off.
+         * @param aHandleId the scheduling handle ID of the timed profile task.
+         * @param aTaskId the task ID of the timed profile task.
+         */
+        void SaveSchedulingData( TInt aPreviousId = -1,
+                                 TInt aHandleId = -1,
+                                 TInt aTaskId = -1 );
+
+        /**
+         * Gets the information about current timed profile from Central
+         * Repository.
+         * @param aPreviousId contains the ID of the profile which should be
+         *        re-activated when the timer goes off on return.
+         * @param aHandleId contains the ID of the scheduling handle of the
+         *        timed profile on return.
+         * @param aTaskId contains the ID assigned for the task of the timed
+         *        profile on return.
+         */
+        void GetSchedulingDataL( TInt& aPreviousId, TInt& aHandleId,
+                                 TInt& aTaskId );
+
+        /**
+         * Creates connection to the task scheduler. This method is not called
+         * before the connection to the server is really needed.
+         */
+        void ConnectToSchedulerL();
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CProfileTiming( CRepository& aProfileRepository,
+                        MProfilesLocalFeatures& aFeatures );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+        // Profiles Central Repository reference
+        CRepository& iRepository;
+        
+        // Profiles local features reference
+        MProfilesLocalFeatures& iFeatures;
+        
+        // Own: Scheduler for scheduling profile timing tasks
+        RScheduler iScheduler;
+
+        // Own: Array used as container for the schedule of a timed profile
+        CArrayFixFlat<TScheduleEntryInfo2>* iEntryList;
+
+        // this is needed by ScheduleTask(), doesn't really contain anything
+        TSchedulerItemRef iSchedulerItemRef;
+
+        // Own: task data needed by ScheduleTask(), in practise this is empty
+        HBufC* iTaskData;
+
+        // Path to the DLL to be run by the scheduler when the timer goes off
+        TFileName iTaskDllPath;
+
+        // Task ID for rollback in case of errors
+        TInt iTaskId;
+
+        // Flag indicating whether the connection to the scheduler is open
+        TBool iConnected;
+    };
+
+#endif      // CPROFILETIMING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,376 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileTonesImpl
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileTonesImpl.h"
+#include <s32strm.h>
+#include <centralrepository.h>
+#include "ProfileEngUtils.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include <hwrmvibrasdkcrkeys.h>
+
+#include <psmsettings.h>
+#include <psmsrvdomaincrkeys.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::ConstructL()
+    {
+    const TDesC& des = KNullDesC();
+    iRingingTone1 = des.AllocL();
+    iRingingTone2 = des.AllocL();
+    iMessageAlertTone = des.AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::ConstructL(
+    const MProfileTones& aProfileTones )
+    {
+    iRingingTone1 = aProfileTones.RingingTone1().AllocL();
+    iRingingTone2 = aProfileTones.RingingTone1().AllocL();
+    iMessageAlertTone = aProfileTones.MessageAlertTone().AllocL();
+    iProfileToneSettings = aProfileTones.ToneSettings();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileTonesImpl* CProfileTonesImpl::NewL()
+    {
+    CProfileTonesImpl* self = new( ELeave ) CProfileTonesImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileTonesImpl* CProfileTonesImpl::NewL(
+    const MProfileTones& aProfileTones )
+    {
+    CProfileTonesImpl* self = new( ELeave ) CProfileTonesImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfileTones );
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// Destructor
+CProfileTonesImpl::~CProfileTonesImpl()
+    {
+    delete iRingingTone1;
+    delete iRingingTone2;
+    delete iMessageAlertTone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::InternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::InternalizeL( CRepository& aCenRep, TInt aProfileId )
+    {
+    delete iRingingTone1;
+    iRingingTone1 = NULL;
+    delete iRingingTone2;
+    iRingingTone2 = NULL;
+    delete iMessageAlertTone;
+    iMessageAlertTone = NULL;
+    TFileName toneFile;
+
+    // Ringing tone 1
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngRingingTone,
+            aProfileId ), toneFile ) );
+    iRingingTone1 = toneFile.AllocL();
+
+    // Ringing tone 2
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngRingingTone2,
+            aProfileId ), toneFile ) );
+    iRingingTone2 = toneFile.AllocL();
+
+    // Message alert tone
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngMsgTone,
+            aProfileId ), toneFile ) );
+    iMessageAlertTone = toneFile.AllocL();
+
+    // Settings
+    TInt value( 0 );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngRingingType,
+            aProfileId ), value ) );
+    iProfileToneSettings.iRingingType = TProfileRingingType( value );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngKeypadVolume,
+            aProfileId ), value ) );
+    iProfileToneSettings.iKeypadVolume = TProfileKeypadVolume( value );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngRingingVolume,
+            aProfileId ), iProfileToneSettings.iRingingVolume ) );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngVibra,
+            aProfileId ), iProfileToneSettings.iVibratingAlert ) );
+    User::LeaveIfError(
+          aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngEmailVibra,
+           aProfileId ), iProfileToneSettings.iEmailVibratingAlert ) );   
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngWarnAndGameTones,
+            aProfileId ), iProfileToneSettings.iWarningAndGameTones ) );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngMediaVolume,
+            aProfileId ), iProfileToneSettings.iMediaVolume ) );
+    User::LeaveIfError(
+            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngTextToSpeechTone,
+            aProfileId ), iProfileToneSettings.iTextToSpeech ) );
+            
+    InitPowerSaveMode();
+
+    if ( iPowerSaveMode )
+        {
+        iProfileToneSettings.iVibratingAlert = iPsmConfigVibra;
+        iProfileToneSettings.iEmailVibratingAlert = iPsmConfigVibra;
+        iProfileToneSettings.iKeypadVolume = 
+                             TProfileKeypadVolume( iPsmConfigKeypadVolume );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::ExternalizeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const
+    {
+    // Ringing tone 1
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngRingingTone,
+            aProfileId ), *iRingingTone1 ) );
+
+    // Ringing tone 2
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngRingingTone2,
+            aProfileId ), *iRingingTone2 ) );
+
+    // Message alert tone
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngMsgTone,
+            aProfileId ), *iMessageAlertTone ) );
+
+    // Tone Settings
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngRingingType,
+            aProfileId ), iProfileToneSettings.iRingingType ) );
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngKeypadVolume,
+            aProfileId ), iProfileToneSettings.iKeypadVolume ) );
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngRingingVolume,
+            aProfileId ), iProfileToneSettings.iRingingVolume ) );
+    
+    if ( !ProfileEngUtils::PowerSaveMode() )
+        {
+        User::LeaveIfError(
+                aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngKeypadVolume,
+                aProfileId ), iProfileToneSettings.iKeypadVolume ) );
+        User::LeaveIfError(
+                aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngVibra,
+                aProfileId ), iProfileToneSettings.iVibratingAlert ) );        
+        
+   User::LeaveIfError(
+             aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngEmailVibra,
+             aProfileId ), iProfileToneSettings.iEmailVibratingAlert ) );   
+     }
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngWarnAndGameTones,
+            aProfileId ), iProfileToneSettings.iWarningAndGameTones ) );
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngMediaVolume,
+            aProfileId ), iProfileToneSettings.iMediaVolume ) );
+    User::LeaveIfError(
+            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngTextToSpeechTone,
+            aProfileId ), iProfileToneSettings.iTextToSpeech ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::SetRingingTone2L
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::SetRingingTone2L(
+    const TDesC& aRingingTone )
+    {
+    HBufC* tmp = aRingingTone.Left( KMaxFileName ).AllocL();
+    delete iRingingTone2;
+    iRingingTone2 = tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::SetRingingTone1L
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::SetRingingTone1L(
+    const TDesC& aRingingTone )
+    {
+    HBufC* tmp = aRingingTone.Left( KMaxFileName ).AllocL();
+    delete iRingingTone1;
+    iRingingTone1 = tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::MessageAlertTone
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileTonesImpl::MessageAlertTone() const
+    {
+    return *iMessageAlertTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::RingingTone1
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileTonesImpl::RingingTone1() const
+    {
+    return *iRingingTone1;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::RingingTone2
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileTonesImpl::RingingTone2() const
+    {
+    return *iRingingTone2;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::SetMessageAlertToneL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::SetMessageAlertToneL(
+    const TDesC& aMessageAlertTone )
+    {
+    HBufC* tmp = aMessageAlertTone.Left( KMaxFileName ).AllocL();
+    delete iMessageAlertTone;
+    iMessageAlertTone = tmp;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::ToneSettings
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TProfileToneSettings& CProfileTonesImpl::ToneSettings() const
+    {
+    return iProfileToneSettings;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::SetToneSettings
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfileToneSettings& CProfileTonesImpl::SetToneSettings()
+    {
+    return iProfileToneSettings;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::InitPowerSaveMode
+//
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::InitPowerSaveMode()
+    {
+    const TInt KVibraOff = 0;
+    const TInt KMinVolume = 0;
+
+    iPsmConfigVibra = KVibraOff;
+    iPsmConfigKeypadVolume = KMinVolume;
+
+    iPowerSaveMode = ProfileEngUtils::PowerSaveMode();
+    
+    if ( iPowerSaveMode )
+        {
+        TRAP_IGNORE( ReadPowerSaveConfigL() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileTonesImpl::ReadPowerSaveConfigL
+//
+// -----------------------------------------------------------------------------
+//
+void CProfileTonesImpl::ReadPowerSaveConfigL()
+    {
+
+    //
+    // Read psm specific vibra and keypad volume from profiles public cenrep.
+    // Psm plugin updates those when psm mode changes.
+    //
+    
+    CRepository* cenrep = CRepository::NewLC( KCRUidVibraCtrl );
+    User::LeaveIfError( cenrep->Get( KVibraCtrlProfileVibraEnabled, iPsmConfigVibra ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    
+    cenrep = CRepository::NewLC( KCRUidProfileEngine );
+    User::LeaveIfError( cenrep->Get( KProEngActiveKeypadVolume, iPsmConfigKeypadVolume ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    }
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile tones implementation.
+*
+*/
+
+
+
+#ifndef __CPROFILETONESIMPL_H
+#define __CPROFILETONESIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MProfileTones.h>
+#include <TProfileToneSettings.h>
+#include "MProfileSetTones.h"
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Profile tones implementation.
+*  This class implements MProfileTones and MProfileSetTones interfaces.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfileTonesImpl) : public CBase,
+                          public MProfileTones,
+                          public MProfileSetTones
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileTonesImpl* NewL();
+
+        /**
+        * Two-phased constructor. Copy constructor.
+        * @param aProfileTones Profile tones
+        */
+        static CProfileTonesImpl* NewL( const MProfileTones& aProfileTones );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileTonesImpl();
+
+    public: // New functions
+
+        /**
+        * Internalize data from the central repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to read the settings
+        * @param aProfileId the id of the profile to be internalized
+        */
+        void InternalizeL( CRepository& aCenRep, TInt aProfileId );
+
+        /**
+        * Externalize data to Central Repository.
+        * @since 2.8
+        * @param aCenRep Central Repository object to write the settings
+        */
+        void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfileTones.
+        */
+        virtual const TDesC& RingingTone1() const;
+
+        /**
+        * From MProfileTones.
+        */
+        virtual const TDesC& RingingTone2() const;
+
+        /**
+        * From MProfileTones.
+        */
+        virtual const TDesC& MessageAlertTone() const;
+
+        /**
+        * From MProfileTones.
+        */
+        virtual const TProfileToneSettings& ToneSettings() const;
+
+        /**
+        * From MProfileSetTones.
+        */
+        virtual void SetRingingTone1L( const TDesC& aRingingTone );
+
+        /**
+        * From MProfileSetTones.
+        */
+        virtual void SetRingingTone2L( const TDesC& aRingingTone );
+
+        /**
+        * From MProfileSetTones.
+        */
+        virtual void SetMessageAlertToneL( const TDesC& aMessageAlertTone );
+
+        /**
+        * From MProfileSetTones.
+        */
+        virtual TProfileToneSettings& SetToneSettings();
+
+    private:
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aProfileTones Profile tones
+        */
+        void ConstructL( const MProfileTones& aProfileTones );
+
+    private:
+        void InitPowerSaveMode();
+        void ReadPowerSaveConfigL();
+        
+    private:    // Data
+
+        // Own: Line 1 Ringing tone file name
+        HBufC* iRingingTone1;
+
+        // Own: Line 2 Ringing tone file name
+        HBufC* iRingingTone2;
+
+        // Own: Message alert tone file name
+        HBufC* iMessageAlertTone;
+
+        // Own: Tone settings
+        TProfileToneSettings iProfileToneSettings;
+        
+        TInt iPsmConfigVibra;
+        TInt iPsmConfigKeypadVolume;
+        TBool iPowerSaveMode;
+    };
+
+#endif      // __CPROFILETONESIMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfileUtilitySingletonImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileUtilitySingletonImpl.h"
+#include "MProfilesLocalFeatures.h"
+#include "CProfilesLocalFeatures.h"
+#include "ProfilesDebug.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileUtilitySingletonImpl::CProfileUtilitySingletonImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileUtilitySingletonImpl::CProfileUtilitySingletonImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileUtilitySingletonImpl::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileUtilitySingletonImpl::ConstructL()
+    {
+    iLocalFeatures = CProfilesLocalFeatures::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileUtilitySingletonImpl::NewL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfileUtilitySingletonImpl* CProfileUtilitySingletonImpl::NewL()
+    {
+    CProfileUtilitySingletonImpl* self
+        = new ( ELeave ) CProfileUtilitySingletonImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(); // self
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileUtilitySingletonImpl::ProfilesLocalFeatures
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MProfilesLocalFeatures& CProfileUtilitySingletonImpl::ProfilesLocalFeatures()
+    {
+    return *iLocalFeatures;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileUtilitySingletonImpl::IncrementReferences
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileUtilitySingletonImpl::IncrementReferences()
+    {
+    ++iReferences;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileUtilitySingletonImpl::DecrementReferences
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileUtilitySingletonImpl::DecrementReferences()
+    {
+    return ( --iReferences <= 0 );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileUtilitySingletonImpl::~CProfileUtilitySingletonImpl
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfileUtilitySingletonImpl::~CProfileUtilitySingletonImpl()
+    {
+    delete iLocalFeatures;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ProfileUtilityInstanceL creates an implementation of MProfileUtilitySingleton
+// if needed, increments the reference count and returns a reference to the only
+// instance of it.
+// Returns a reference to the only instance of MProfileUtilitySingleton.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProfileUtilitySingleton& ProfileUtilityInstanceL()
+    {
+    CProfileUtilitySingletonImpl* instance =
+        static_cast<CProfileUtilitySingletonImpl*>( Dll::Tls() );
+    if( instance == NULL )
+        {
+        instance = CProfileUtilitySingletonImpl::NewL();
+        TInt err( Dll::SetTls( instance ) );
+        if( err )
+            {
+            delete instance;
+            //delete static_cast<CProfileUtilitySingletonImpl*>( instance );
+            User::Leave( err );
+            }
+        }
+    instance->IncrementReferences();
+    //return static_cast<MProfileUtilitySingleton&>( instance );
+    return *instance;
+    }
+
+// -----------------------------------------------------------------------------
+// ReleaseProfileUtility decrements the count of references to the only instance
+// of MProfileUtilitySingleton implementation and releases the resources if
+// there are no more references to it.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void ReleaseProfileUtility()
+    {
+    TAny* instance = Dll::Tls();
+    if( instance != NULL )
+        {
+        CProfileUtilitySingletonImpl* singleton =
+            static_cast<CProfileUtilitySingletonImpl*>( instance );
+        if( singleton->DecrementReferences() )
+            {
+            delete singleton;
+            Dll::SetTls( NULL );
+            }
+        }
+    }
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class encapsulates the implementation of MProfile-
+*                UtilitySingleton.
+*
+*/
+
+
+
+#ifndef __CPROFILEUTILITYSINGLETONIMPL_H__
+#define __CPROFILEUTILITYSINGLETONIMPL_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include "MProfileUtilitySingleton.h"
+
+// FORWARD DECLARATIONS
+class MProfilesLocalFeatures;
+class CProfilesLocalFeatures;
+
+// CLASS DECLARATION
+
+/**
+* Implementation of MProfileUtility.
+*/
+NONSHARABLE_CLASS( CProfileUtilitySingletonImpl ) : public CBase,
+                                     public MProfileUtilitySingleton
+    {
+    public: // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProfileUtilitySingletonImpl* NewL();
+
+        /**
+         * Destructor.
+         */
+        ~CProfileUtilitySingletonImpl();
+
+    public: // From base classes
+
+        /**
+        * From MProfileUtility
+        */
+        MProfilesLocalFeatures& ProfilesLocalFeatures();
+
+    public: // New functions
+
+        /**
+         * Increments the counter of users of this singleton object.
+         */
+        void IncrementReferences();
+
+        /**
+         * Decrements the counter of users of this singleton object.
+         * @return ETrue, when there are no users of this singleton anymore.
+         */
+        TBool DecrementReferences();
+
+    private: // Constructors
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+        CProfileUtilitySingletonImpl();
+
+    private: // data
+
+        /// Profiles local features owned by this class.
+        CProfilesLocalFeatures* iLocalFeatures;
+
+        /// References to this CProfileUtilitySingletonImpl instance.
+        TInt iReferences;
+    };
+
+#endif      //  __CPROFILEUTILITYSINGLETONIMPL_H__
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilesLocalFeatures.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfilesLocalFeatures.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfilesLocalFeatures.h"
+#include "ProfileEnginePrivateCRKeys.h"
+#include "ProfilesDebug.h"
+#include <centralrepository.h>
+#include <apmstd.h>
+
+namespace
+    {
+    _LIT( KProfilesSpace, " " );
+    }
+     
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::CProfilesLocalFeatures
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilesLocalFeatures::CProfilesLocalFeatures()
+    : iFeatureBitMask( 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::CProfilesLocalFeatures
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilesLocalFeatures::CProfilesLocalFeatures( TInt aFeatureBitMask )
+    : iFeatureBitMask( aFeatureBitMask )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfilesLocalFeatures::ConstructL()
+    {
+    CRepository* cenrep = CRepository::NewL( KCRUidProfilesLV );
+    CleanupStack::PushL( cenrep );
+    User::LeaveIfError( cenrep->Get( KProfilesLVFlags, iFeatureBitMask ) );
+    ReadListKeyL( *cenrep, KProEngBlockedTones, iBlockedTones );
+    ReadListKeyL( *cenrep, KProEngBlockedUnprotectedTones,
+                  iBlockedUnprotectedTones );
+    ReadListKeyL( *cenrep, KProEngBlockedProtectedTones,
+                  iBlockedProtectedTones );
+    ReadListKeyL( *cenrep, KProEngBlockedDemoPlayTones,
+                  iBlockedDemoPlayTones );
+    ReadListKeyL( *cenrep, KProEngExcludedTones,
+                  iExcludedTones );
+    CleanupStack::PopAndDestroy(); // cenrep
+    if( ( iBlockedTones.Length() > 0 ) ||
+        ( iBlockedUnprotectedTones.Length() > 0 ) ||
+        ( iBlockedProtectedTones.Length() > 0 ) )
+        {
+        iMimeBuf.CreateL( KMaxDataTypeLength + KProfilesSpace().Length() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::NewL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfilesLocalFeatures* CProfilesLocalFeatures::NewL()
+    {
+    CProfilesLocalFeatures* self = new ( ELeave ) CProfilesLocalFeatures();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(); // self
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::NewL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CProfilesLocalFeatures* CProfilesLocalFeatures::NewL(
+        CProfilesLocalFeatures& aLocalFeatures )
+    {
+    return new ( ELeave )
+        CProfilesLocalFeatures( aLocalFeatures.iFeatureBitMask );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::IsFeatureSupported
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesLocalFeatures::IsFeatureSupported( TInt aLocalFeatureId ) const
+    {
+    return iFeatureBitMask & aLocalFeatureId;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::IsBlockedType
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesLocalFeatures::IsBlockedType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedTones, aMimeType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::IsBlockedUnprotectedType
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesLocalFeatures::IsBlockedUnprotectedType(
+        const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedUnprotectedTones, aMimeType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::IsBlockedProtectedType
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesLocalFeatures::IsBlockedProtectedType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedProtectedTones, aMimeType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::IsBlockedDemoPlayType
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesLocalFeatures::IsBlockedDemoPlayType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iBlockedDemoPlayTones, aMimeType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::IsExcludedType
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesLocalFeatures::IsExcludedType( const TDesC& aMimeType )
+    {
+    return ContainsMimeType( iExcludedTones, aMimeType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::ReadListKeyL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfilesLocalFeatures::ReadListKeyL( CRepository& aCenRep,
+                                           TUint32 aKey,
+                                           RBuf& aValue )
+    {
+    TBuf<1> tmp; // Magic: 1 char to get length of actual value
+    TInt realLen = 0;
+    TInt err = aCenRep.Get( aKey, tmp, realLen );
+    if ( err == KErrOverflow )
+        {
+        // Prepare list of blocked MIME types
+        aValue.CreateL( realLen + KProfilesSpace().Length() );
+        User::LeaveIfError( aCenRep.Get( aKey, aValue ) );
+        aValue.Append( KProfilesSpace );
+        }
+    else
+        {
+        User::LeaveIfError( err );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesLocalFeatures::ContainsMimeTypeL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesLocalFeatures::ContainsMimeType( const TDesC& aList,
+                                                const TDesC& aMimeType )
+    {
+    if( aList.Length() == 0 )
+        {
+        PRODEBUG(
+                "CProfilesLocalFeatures::ContainsMimeTypeL(), return false" );
+        return EFalse;
+        }
+
+    TBool ret( EFalse );
+    iMimeBuf.Copy( aMimeType );
+    // FindF() would find "audio/3gpp" in "audio/3gpp2" without
+    // the added space.
+    iMimeBuf.Append( KProfilesSpace );
+
+    // If result is not KErrNotFound, this MIME-type is indeed blocked
+    ret = ( aList.FindF( iMimeBuf ) >= 0 );
+
+    PRODEBUG3( "CProfilesLocalFeatures::ContainsMimeTypeL(%S,%S), returning %d",
+               &aList, &aMimeType, ret );
+    return ret;
+    }
+
+CProfilesLocalFeatures::~CProfilesLocalFeatures()
+    {
+    iBlockedTones.Close();
+    iBlockedUnprotectedTones.Close();
+    iBlockedProtectedTones.Close();
+    iBlockedDemoPlayTones.Close();
+    iExcludedTones.Close();
+    iMimeBuf.Close();
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilesLocalFeatures.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class encapsulates the locally variated settings of
+*                Profiles.
+*
+*/
+
+
+
+#ifndef __CPROFILESLOCALFEATURES_H__
+#define __CPROFILESLOCALFEATURES_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include "MProfilesLocalFeatures.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+* Implementation of MProfilesLocalFeatures.
+*/
+NONSHARABLE_CLASS(CProfilesLocalFeatures) : public CBase, public MProfilesLocalFeatures
+    {
+    public: // Constructors and destructor
+
+        static CProfilesLocalFeatures* NewL();
+
+        static CProfilesLocalFeatures* NewL(
+                CProfilesLocalFeatures& aLocalFeatures );
+
+        ~CProfilesLocalFeatures();
+
+    public: // Functions from base classes
+
+        /**
+         * From MProfilesLocalFeatures
+         */
+        TBool IsFeatureSupported( TInt aLocalFeatureId ) const;
+
+        /**
+         * From MProfilesLocalFeatures
+         */
+        TBool IsBlockedType( const TDesC& aMimeType );
+
+        /**
+         * From MProfilesLocalFeatures
+         */
+        TBool IsBlockedUnprotectedType( const TDesC& aMimeType );
+
+        /**
+         * From MProfilesLocalFeatures
+         */
+        TBool IsBlockedProtectedType( const TDesC& aMimeType );
+
+        /**
+         * From MProfilesLocalFeatures
+         */
+        TBool IsBlockedDemoPlayType( const TDesC& aMimeType );
+
+        /**
+         * From MProfilesLocalFeatures
+         */
+        TBool IsExcludedType( const TDesC& aMimeType );
+
+    private: // New methods:
+
+        void ReadListKeyL( CRepository& aCenRep,
+                           TUint32 aKey,
+                           RBuf& aValue );
+
+        TBool ContainsMimeType( const TDesC& aList,
+                                const TDesC& aMimeType );
+
+    private: // By default symbian default constructor is private:
+
+        void ConstructL();
+
+    private: // Constructors:
+
+        CProfilesLocalFeatures();
+
+        CProfilesLocalFeatures( TInt aFeatureBitMask );
+
+    private: // data
+
+        // the key containing boolean type features
+        TInt iFeatureBitMask;
+
+        // Own: contains space separated list of blocked MIME-types
+        RBuf iBlockedTones;
+
+        // Own: contains space separated list of blocked unprotected MIME-types
+        RBuf iBlockedUnprotectedTones;
+
+        // Own: contains space separated list of blocked protected MIME-types
+        RBuf iBlockedProtectedTones;
+
+        // Own: contains space separated list of blocked demo-play MIME-types
+        RBuf iBlockedDemoPlayTones;
+
+        // Own: contains space separated list of excluded MIME-types
+        RBuf iExcludedTones;
+
+        // Own: helper buffer for mime-type matching
+        RBuf iMimeBuf;
+    };
+
+#endif      //  __CPROFILESLOCALFEATURES_H__
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProfilesNamesArrayImpl
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfilesNamesArrayImpl.h"
+#include <collate.h>
+#include <MProfilesNamesArray.h>
+#include "CProfileNameImpl.h"
+#include "ProfileEng.hrh"
+#include "ProfileEngPanic.h"
+#include "ProfileEngineConstants.h"
+
+// LOCAL CONSTANTS AND MACROS
+const TInt KProfileNamesGranularity( 5 );
+const TInt KMaxCollationLevel( 3 );
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// SortOrder sort profile names.
+// Returns: zero: if the two objects are equal
+//          negative value: if the first object is less than the second.
+//          positive value: if the first object is greater than the second.
+// -----------------------------------------------------------------------------
+//
+TInt SortOrder(
+    const CProfileNameImpl& aFirst,
+    const CProfileNameImpl& aSecond )
+    {
+    TInt firstId( aFirst.Id() );
+    TInt secondId( aSecond.Id() );
+    if( firstId < KProfileBaseDynamicProfileId || 
+        secondId < KProfileBaseDynamicProfileId ) 
+        {
+        return firstId - secondId;
+        }
+    else
+        {
+        TCollationMethod m = *Mem::CollationMethodByIndex( 0 ); // get the standard method
+        m.iFlags |= TCollationMethod::EIgnoreNone;
+        return aFirst.Name().CompareC( aSecond.Name(), KMaxCollationLevel, &m  );
+        }
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::CProfilesNamesArrayImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilesNamesArrayImpl::CProfilesNamesArrayImpl()
+    : iProfilesNames( KProfileNamesGranularity ), iNullName( KNullDesC )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfilesNamesArrayImpl* CProfilesNamesArrayImpl::NewL()
+    {
+    return new( ELeave ) CProfilesNamesArrayImpl;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfilesNamesArrayImpl* CProfilesNamesArrayImpl::NewLC()
+    {
+    CProfilesNamesArrayImpl* self = new( ELeave ) CProfilesNamesArrayImpl;
+
+    CleanupStack::PushL( self );
+
+    return self;
+    }
+
+
+// Destructor
+CProfilesNamesArrayImpl::~CProfilesNamesArrayImpl()
+    {
+    iProfilesNames.ResetAndDestroy();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::InsertInOrder
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfilesNamesArrayImpl::InsertInOrder(
+    const CProfileNameImpl* aProfileName )
+    {
+    __ASSERT_DEBUG( aProfileName, 
+        ProfileEngPanic::Panic( EProfileEngPanicNullPointer ) );
+    
+    return iProfilesNames.InsertInOrder(
+            aProfileName, TLinearOrder<CProfileNameImpl>( SortOrder ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::Append
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfilesNamesArrayImpl::Append(
+    const CProfileNameImpl* aProfileName )
+    {
+    __ASSERT_DEBUG( aProfileName,
+        ProfileEngPanic::Panic( EProfileEngPanicNullPointer ) );
+
+    return iProfilesNames.Append( aProfileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::FindNameById
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfilesNamesArrayImpl::FindNameById(
+    TInt aId )
+    {
+    const MProfileName* profileName = ProfileName( FindById( aId ) );
+    if( profileName )
+        {
+        return profileName->Name();
+        }
+    return iNullName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::ProfileName
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const MProfileName* CProfilesNamesArrayImpl::ProfileName(
+    TInt aIndex ) const
+    {
+    TInt count( iProfilesNames.Count() );
+    if( aIndex < 0 ||
+        aIndex >= count )
+        {
+        return NULL;
+        }
+    return iProfilesNames[aIndex];
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::FindById
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfilesNamesArrayImpl::FindById(
+    TInt aId ) const
+    {
+    TInt count( iProfilesNames.Count() );
+    for( TInt i( 0 ) ; i < count ; ++i )
+        {
+        if( iProfilesNames[i]->Id() == aId )
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::FindByName
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfilesNamesArrayImpl::FindByName(
+    const TDesC& aProfileName ) const
+    {
+    TInt count( iProfilesNames.Count() );
+    for( TInt i( 0 ) ; i < count ; ++i )
+        {
+        if( aProfileName.Compare( iProfilesNames[i]->Name() ) == 0 )
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::MdcaCount
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CProfilesNamesArrayImpl::MdcaCount() const
+    {
+    return iProfilesNames.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesNamesArrayImpl::MdcaPoint
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TPtrC CProfilesNamesArrayImpl::MdcaPoint(
+    TInt aIndex ) const
+    {
+    TInt count( iProfilesNames.Count() );
+    if( aIndex < 0 ||
+        aIndex >= count )
+        {
+        return iNullName;
+        }
+    return iProfilesNames[aIndex]->Name();
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile names array implementation.
+*
+*/
+
+
+
+#ifndef CPROFILESNAMESARRAYIMPL_H
+#define CPROFILESNAMESARRAYIMPL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <MProfilesNamesArray.h>
+
+// FORWARD DECLARATIONS
+class CProfileNameImpl;
+
+// CLASS DECLARATION
+
+/**
+*  Profile names array implementation.
+*  This class implements MProfilesNamesArray interface.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+NONSHARABLE_CLASS(CProfilesNamesArrayImpl) : public CBase,
+                                public MProfilesNamesArray
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfilesNamesArrayImpl* NewL();
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfilesNamesArrayImpl* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfilesNamesArrayImpl();
+
+    public: // New functions
+
+        /**
+        * Insert profile name in array, sort by ID.
+        * @since 2.0
+        * @param aProfileName Profile name instance
+        * @return System error code
+        */
+        TInt InsertInOrder( const CProfileNameImpl* aProfileName );
+
+        /**
+        * Append profile names in array.
+        * @since 2.0
+        * @param aProfileName Profile name instance
+        * @return System error code
+        */
+        TInt Append( const CProfileNameImpl* aProfileName );
+
+        /**
+        * Find profile name by ID.
+        * @since 2.0
+        * @param aId Profile ID
+        * @return Profile name
+        */
+        const TDesC& FindNameById( TInt aId );
+
+    public: // Functions from base classes
+
+        /**
+        * From MProfilesNamesArray.
+        */
+        virtual const MProfileName* ProfileName( TInt aIndex ) const;
+
+        /**
+        * From MProfilesNamesArray.
+        */
+        virtual TInt FindById( TInt aId ) const;
+
+        /**
+        * From MProfilesNamesArray.
+        */
+        virtual TInt FindByName( const TDesC& aProfileName ) const;
+
+        /**
+        * From MDesCArray.
+        */
+        virtual TInt MdcaCount() const;
+
+        /**
+        * From MDesCArray.
+        */
+        virtual TPtrC MdcaPoint( TInt aIndex ) const;
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CProfilesNamesArrayImpl();
+
+    private:    // Data
+
+        // Own: Profiles names array
+        RPointerArray<CProfileNameImpl> iProfilesNames;
+
+        // Own: Empty name
+        TBuf<1> iNullName;
+
+    };
+
+#endif      // CPROFILESNAMESARRAYIMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/ProfileEngPanic.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the ProfileEngPanic.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "ProfileEngPanic.h"
+
+// CONSTANTS
+_LIT( KProfileEngPanicText, "ProfileEng");
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ProfileEngPanic::Panic
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void ProfileEngPanic::Panic( TInt aReason )
+    {
+    User::Panic( KProfileEngPanicText, aReason );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/ProfileEngPanic.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Panic the current thread.
+*
+*/
+
+
+
+#ifndef __PROFILEENGPANIC_H__
+#define __PROFILEENGPANIC_H__
+
+//  INCLUDES
+#include <e32std.h>
+
+// DATA TYPES
+enum TProfileEngPanics
+    {
+    EProfileEngPanicNullPointer     = 1,    // Null pointer exception
+    EProfileEngPanicBadParameter    = 2     // Incorrect parameter
+    };
+
+// CLASS DECLARATION
+
+/**
+*  This class used to panic the current thread.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+class ProfileEngPanic
+    {
+    public: // New functions
+
+        /**
+        * Panics the current thread,
+        * specifying a category name and panic number.
+        * @since 2.0
+        * @param aReason The panic number.
+        */
+        static void Panic( TInt aReason );
+    };
+
+#endif      //  __PROFILEENGPANIC_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implemention of the ProfileEngUtils.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "ProfileEngUtils.h"
+#include "CProfileEngineImpl.h"
+#include "ProfileEngineConstants.h"
+#include <RSSSettings.h>
+#include <centralrepository.h>
+#include <bldvariant.hrh>
+
+#include <psmsrvdomaincrkeys.h>
+#include <psmsettings.h>
+#include <e32property.h>
+#include <ProfileEnginePrivatePSKeys.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::GetAlternateService
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void ProfileEngUtils::GetAlternateLineService( TInt& aValue )
+    {
+    aValue = ESSSettingsAlsNotSupported;
+    RSSSettings settings;
+
+    if( settings.Open() == KErrNone )
+        {
+        // Get Alternate Line Service setting. Ignore errors because
+        // iAlternateLineService value ESSSettingsAlsNotSupported is also valid.
+        settings.Get( ESSSettingsAls, aValue );
+        settings.Close();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::IsAlternateLineSelected
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool ProfileEngUtils::IsAlternateLineSelected()
+    {
+    TInt als( ESSSettingsAlsNotSupported );
+    GetAlternateLineService( als );
+    return ( als == ESSSettingsAlsAlternate );
+    }
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::ResolveKey
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TUint32 ProfileEngUtils::ResolveKey( TUint aPartialKey, TInt aProfileId )
+    {
+    return ( ( aProfileId << KProfileIdShift ) | aPartialKey );
+    }
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::GetBinarySettingL
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void ProfileEngUtils::GetBinarySettingL( CRepository& aCenRep,
+                                         TUint32 aId,
+                                         TDes8& aDes )
+    {
+    aDes.Zero();
+    User::LeaveIfError( aCenRep.Get( aId, aDes ) );
+    const TInt KProEngEmptyBinSettingLength( 2 );
+    const TInt KProEngZero( 0 );
+
+    if( ( aDes.Length() == KProEngEmptyBinSettingLength ) &&
+        ( aDes[0] == KProEngZero && aDes[1] == KProEngZero ) )
+        {
+            aDes.Zero();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::FindValueFromBinaryKey
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt ProfileEngUtils::FindValueFromBinaryKeyL( CRepository& aCenRep,
+        TUint32 aCenRepKey,
+        TUint8 aValue )
+    {
+    HBufC8* buf = HBufC8::NewLC(
+            NCentralRepositoryConstants::KMaxBinaryLength );
+    TPtr8 ptr = buf->Des();
+    ProfileEngUtils::GetBinarySettingL( aCenRep, aCenRepKey, ptr );
+
+    TInt result( KErrNotFound );
+    TInt len( buf->Length() );
+    for( TInt i( 0 ); i<len; ++i )
+        {
+        if( ptr[ i ] == aValue )
+            {
+            result = i;
+            }
+        }
+    CleanupStack::PopAndDestroy(); // buf
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::GetUint32Presentation
+//
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void ProfileEngUtils::GetUint32Presentation( TUint32& aResult,
+                                             const TDesC8& aBuf,
+                                             TInt aOffset )
+    {
+    aResult = 0;
+    const TInt KProEngByteLength( 8 );
+    const TInt length( aBuf.Length() );
+    const TInt maxBitShift( KProEngByteLength * ( length - 1 ) );
+
+    for( TInt i( 0 ); i<length; ++i )
+        {
+        aResult |= ( aBuf[aOffset + i] <<
+                   ( maxBitShift - ( KProEngByteLength * i ) ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::PowerSaveMode
+//
+// -----------------------------------------------------------------------------
+//
+TBool ProfileEngUtils::PowerSaveMode()
+    {
+    TBool psm = EFalse;
+    
+    TRAPD( err, psm = PowerSaveModeL() );
+    
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    return psm;
+    }
+
+
+// -----------------------------------------------------------------------------
+// ProfileEngUtils::PowerSaveModeL
+//
+// -----------------------------------------------------------------------------
+//
+TBool ProfileEngUtils::PowerSaveModeL()
+    {
+
+#ifdef FF_POWER_SAVE
+    TInt psm = EPsmsrvModeNormal;
+    
+    // KProEngPsmChanged PubSub key is set by GSProfilesPlugin when power save
+    // mode changes. If the key cannot be read (doesn't exist), PSM hasn't
+    // changed since the last boot and the mode is read from PSM CenRep.
+    if( RProperty::Get( KPSUidProfileEngine, KProEngPsmChanged, psm ) != KErrNone )
+        {
+        CRepository* cenrep = CRepository::NewLC( KCRUidPowerSaveMode );
+        User::LeaveIfError( cenrep->Get( KPsmCurrentMode, psm ) );
+        CleanupStack::PopAndDestroy( cenrep );
+        }
+
+    if ( psm == EPsmsrvModePowerSave )
+        {
+        return ETrue;
+        }
+#endif
+
+    return EFalse;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine utils.
+*
+*/
+
+
+
+#ifndef __PROFILEENGUTILS_H
+#define __PROFILEENGUTILS_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class RFs;
+class RWriteStream;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+*  Profiles Engine utils.
+*
+*  @lib ?library
+*  @since 2.0
+*/
+class ProfileEngUtils
+    {
+    public: // New functions
+
+        /**
+         * Reads alternate service setting value from RSSSettings.
+         * @param aValue on return contains the value of the alternate line
+         * service setting.
+         */
+        static void GetAlternateLineService( TInt& aValue );
+
+        /**
+         * Checks if the alternate line has been selected.
+         * @return ETrue if als is supported and the alternate line has been
+         * selected, EFalse otherwise.
+         */
+        static TBool IsAlternateLineSelected();
+
+        /**
+        * Resolves the Central Repository key for the given setting of the
+        * given profile.
+        * @since 2.8
+        * @param aPartialKey is the part of the key which identifies the
+        * setting in Central Repository (these keys are defined in Profiles-
+        * PrivateCRKeys.h)
+        * @param aProfileId is the id of the profile the setting of which
+        * the caller is interested in
+        * @return the real key to be used with Central Repository
+        */
+        static TUint32 ResolveKey( TUint aPartialKey, TInt aProfileId );
+
+        /**
+        * Gets the binary setting with the given id from Central Repository.
+        * This can be used to only read settings that contain strings of
+        * elements which length must be != 2 bytes.
+        * @since 2.8
+        * @param aCenRep reference to a repository containing the needed key
+        * @param aId the key of the value to be fetched
+        * @param aDes 8-bit buffer which contains the value read from Central
+        * Repository on return. If the read value is 2 zero bytes, the
+        * buffer will be empty on return.
+        */
+        static void GetBinarySettingL( CRepository& aCenRep, TUint32 aId,
+                                       TDes8& aDes );
+        /**
+        * Converts 4 bytes from a binary buffer to TUint32.
+        * @since 2.8
+        * @param aResult is a reference to the integer which will contain the
+        * value on return
+        * @param aBuf is the buffer from which the 32 bits are read
+        * @param aOffset is the offset from which the reading from aBuf should
+        * start
+        */
+        static void GetUint32Presentation( TUint32& aResult,
+                                           const TDesC8& aBuf,
+                                           TInt aOffset );
+
+        /**
+         * Searches for given 8-bit value from a binary value stored in
+         * Central Repository.
+         * @since 3.0
+         * @param aCenRep Central Repository containing the key
+         * @param aCenRepKey the key from which the value should be searched
+         * @param aValue the 8-bit value to be searched
+         * @return the index of the 8-bit value if found, otherwise
+         * KErrNotFound.
+         */
+        static TInt FindValueFromBinaryKeyL( CRepository& aCenRep,
+                                             TUint32 aCenRepKey,
+                                             TUint8 aValue );
+
+        /**
+         * Returns power save mode.
+         * @return Power save mode.
+         */
+        static TBool PowerSaveModeL();
+
+        /**
+         * Returns power save mode.
+         * @return Power save mode.
+         */
+        static TBool PowerSaveMode();
+    };
+
+#endif      // __PROFILEENGUTILS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,255 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Handles reactivation of the previous profile when the scheduler
+*                runs.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "CProfileChangeEvent.h"
+
+#include    <e32svr.h>
+#include    <MProfileEngine.h>
+#include    <AknGlobalNote.h>
+#include    <data_caging_path_literals.hrh>
+#include    <centralrepository.h>
+#include    <barsc.h>
+#include    <bautils.h>
+
+#include	<SecondaryDisplay/SecondaryDisplayProfilesAPI.h>
+#include	<aknSDData.h>
+#include	<featmgr.h>
+
+#include    <ProfileScheduleEvent.rsg>
+#include    "ProfileEnginePrivateCRKeys.h"
+#include    "ProfileEngineConstants.h"
+#include    "ProfilesDebug.h"
+
+
+// CONSTANTS
+namespace
+    {
+    _LIT( KProfileScheduleEventResourceDriveAndDir, "Z:ProfileScheduleEvent.rsc" );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::CProfileChangeEvent
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileChangeEvent::CProfileChangeEvent()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeEvent::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    iCoverDisplay = FeatureManager::FeatureSupported( KFeatureIdCoverDisplay );
+    
+    
+    User::LeaveIfError( iFs.Connect() );
+    // Open/Create mutex
+    TInt error( KErrNotFound );
+    while( error == KErrNotFound )
+        {
+        error = iMutex.CreateGlobal( KProfileMutexName );
+        if( error != KErrAlreadyExists )
+            {
+            break;
+            }
+        error = iMutex.OpenGlobal( KProfileMutexName );
+        }
+    User::LeaveIfError( error );
+    iProfileEngine = CreateProfileEngineL( &iFs );
+    iGlobalNote = CAknGlobalNote::NewL();
+    ReadResourcesL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileChangeEvent* CProfileChangeEvent::NewL()
+    {
+    CProfileChangeEvent* self = CProfileChangeEvent::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileChangeEvent* CProfileChangeEvent::NewLC()
+    {
+    CProfileChangeEvent* self = new( ELeave ) CProfileChangeEvent;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+
+// Destructor
+CProfileChangeEvent::~CProfileChangeEvent()
+    {
+    delete iNoteText;
+    delete iGlobalNote;
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    iFs.Close();
+    iMutex.Close();
+    
+    FeatureManager::UnInitializeLib();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::ExecuteL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeEvent::ExecuteL()
+    {
+	PRODEBUG( " CProfileChangeEvent:ExecuteL" );
+    CProfileChangeEvent* profileChangeEvent = CProfileChangeEvent::NewLC();
+	PRODEBUG( " CProfileChangeEvent:ExecuteL 2" );
+
+    profileChangeEvent->DoProfileExpirationL();
+
+    CleanupStack::PopAndDestroy(); // profileChangeEvent
+	PRODEBUG( " CProfileChangeEvent:ExecuteL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::DoProfileExpirationL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeEvent::DoProfileExpirationL()
+    {
+    iMutex.Wait();
+    TRAPD( err,
+        if( ReadProfileIdL() )
+            {
+            ShowNoteL();
+            ChangeProfileL();
+            }
+         );
+    iMutex.Signal();
+    User::LeaveIfError( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::ChangeProfileL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeEvent::ChangeProfileL()
+    {
+	PRODEBUG( " CProfileChangeEvent:ChangeProfileL" );
+
+    iProfileEngine->SetActiveProfileL( iPreviousId );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::ReadProfileIdL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileChangeEvent::ReadProfileIdL()
+    {
+	PRODEBUG( " CProfileChangeEvent:ReadProfileIdL" );
+    CRepository* cenrep = CRepository::NewLC( KCRUidProfileEngine );
+    User::LeaveIfError( cenrep->Get( KProEngPreviousActiveId, iPreviousId ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    // If someone called SetActiveProfileL() right after scheduler started the
+    // execution of this dll, the previous id would be resetted to KErrNotFound
+    return ( iPreviousId > KErrNotFound );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::ShowNoteL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeEvent::ShowNoteL()
+    {
+	PRODEBUG1( " CProfileChangeEvent:ShowNoteL(%S)", iNoteText );
+	// Set secondary display data if cover ui is supported
+	if ( iCoverDisplay )
+		{
+		CAknSDData* sd = CAknSDData::NewL(KCatProfiles,
+							ECmdShowTimedProfileExpiryNote, KNullDesC8);
+		iGlobalNote->SetSecondaryDisplayData( sd ); // ownership transferred
+		}
+    iGlobalNote->ShowNoteL( EAknGlobalConfirmationNote, *iNoteText );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileChangeEvent::ReadResourcesL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileChangeEvent::ReadResourcesL()
+    {
+	PRODEBUG( " CProfileChangeEvent:ReadResourcesL" );
+    TParse* fp = new ( ELeave ) TParse();
+    fp->Set( KProfileScheduleEventResourceDriveAndDir,
+             &KDC_RESOURCE_FILES_DIR, NULL );
+    iResourceFile.Copy( fp->FullName() );
+    delete fp;
+
+	PRODEBUG( " CProfileChangeEvent:ReadResourcesL 2" );
+    BaflUtils::NearestLanguageFile( iFs, iResourceFile );
+	PRODEBUG1( " CProfileChangeEvent:ReadResourcesL 3 iResourceFile=%S", &iResourceFile );
+
+    RResourceFile resourceFile;
+    resourceFile.OpenL( iFs, iResourceFile );
+    CleanupClosePushL( resourceFile );
+
+	PRODEBUG( " CProfileChangeEvent:ReadResourcesL 4" );
+    resourceFile.ConfirmSignatureL();
+	PRODEBUG( " CProfileChangeEvent:ReadResourcesL 5" );
+
+    HBufC8* dataBuffer = resourceFile.AllocReadLC( R_PROFILES_CONFIRM_TIMED_EXPIRED );
+
+	PRODEBUG( " CProfileChangeEvent:ReadResourcesL 6" );
+    TResourceReader rsReader;
+    rsReader.SetBuffer( dataBuffer );
+    iNoteText = rsReader.ReadHBufCL();
+	PRODEBUG( " CProfileChangeEvent:ReadResourcesL 7" );
+
+    CleanupStack::PopAndDestroy( 2 ); // dataBuffer, resourceFile
+	PRODEBUG( " CProfileChangeEvent:ReadResourcesL 8" );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Handles reactivation of the previous profile when the scheduler
+*                runs.
+*
+*/
+
+
+
+#ifndef CPROFILECHANGEEVENT_H
+#define CPROFILECHANGEEVENT_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+
+// FORWARD DECLARATIONS
+class MProfileEngine;
+class CAknGlobalNote;
+
+// CLASS DECLARATION
+
+/**
+* Profile Change event run by the scheduler when the timer expires.
+*
+*  @lib ProfileChangeEvent.lib
+*  @since S60 3.2
+*/
+class CProfileChangeEvent : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileChangeEvent* NewL();
+
+        static CProfileChangeEvent* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileChangeEvent();
+
+    public: // New functions
+
+        /**
+         * Creates an instance of CProfileChangeEvent and calls ChangeProfileL
+         * from it.
+         */
+        static void ExecuteL();
+
+    protected:  // New functions
+
+        /**
+         * Reads the ID of the profile to be activated after expiration, shows
+         * the note about expiration and activates the new profile. Everything
+         * as an atomic operation. If the ID of the profile to be activated is
+         * invalid (means: someone just called SetActiveProfileL() after the
+         * scheduler started running this dll) does nothing.
+         */
+        void DoProfileExpirationL();
+
+        /**
+        * Reads the ID of the profile which was active before current timed
+        * profile.
+        * @return ETrue if a valid ID was found.
+        */
+        TBool ReadProfileIdL();
+
+        /**
+         * Activates the profile which was active before timed profile.
+         */
+        void ChangeProfileL();
+
+        /**
+         * Shows the confirmation note about the expiration of the timed
+         * profile.
+         */
+        void ShowNoteL();
+
+        /**
+         * Reads the resource for the confirmation note.
+         */
+        void ReadResourcesL();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CProfileChangeEvent();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+        // Own: Profiles Engine for profile activation
+        MProfileEngine* iProfileEngine;
+
+        // Own: Global note to show the expiration conf. note to the user
+        CAknGlobalNote* iGlobalNote;
+
+        // Own: buffer for the confirmation note text
+        HBufC* iNoteText;
+
+        // File server session needed for resource reading:
+        RFs iFs;
+
+        // Used to store the resource file name
+        TFileName iResourceFile;
+
+        // Mutex controlling access to profiles data
+        RMutex iMutex;
+
+        // The ID of the profile which should be reactivated
+        TInt iPreviousId;
+        
+        // Supported features
+        TBool iCoverDisplay;
+    };
+
+#endif      // CPROFILECHANGEEVENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/Main.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The application gets instantiated starting from this class.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32svr.h>
+#include    <e32base.h>
+#include    <e32std.h>
+#include    "CProfileChangeEvent.h"
+#include    "ProfilesDebug.h"
+
+// CONSTANTS
+_LIT( KProfileScheduleEvent, "ProfileScheduleEvent" );
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+LOCAL_D TInt Execute( TFileName& /* aFileName */ )
+    {
+    __UHEAP_MARK;
+    CTrapCleanup* tc = CTrapCleanup::New();
+    if( !tc )
+        {
+        User::Panic( KProfileScheduleEvent, KErrNoMemory );
+        }
+
+    CActiveScheduler* scheduler = new CActiveScheduler; // CSI: 62 # scheduler tested for NULL below
+    if (!scheduler)
+        {
+        PRODEBUG( "ERROR: couldn't create active scheduler!" );
+        User::Panic( KProfileScheduleEvent, KErrNoMemory );
+        }
+    CActiveScheduler::Install(scheduler);
+    
+	PRODEBUG( " ProfileSchedEvent:Execute before ExecuteL " );
+    TRAPD( err, CProfileChangeEvent::ExecuteL( ) );
+	PRODEBUG( " ProfileSchedEvent:Execute after ExecuteL " );
+
+    CActiveScheduler::Install( NULL );
+    delete scheduler;
+
+    delete tc;
+    __UHEAP_MARKEND;
+    return err;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+	PRODEBUG( "ProfileSchedEvent:E32Main()" );
+    TBuf< 0x100 > cmd;
+    User::CommandLine( cmd );
+    return Execute( cmd );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/ProfileScheduleEvent.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is a resource file for Profiles Schedule Event.
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    PSE9
+
+
+//  INCLUDES
+#include <eikon.rh>
+#include <profile.loc>
+
+//  CONSTANTS
+//  MACROS
+
+//  RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// signature
+// resource signature
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE {}
+
+
+// -----------------------------------------------------------------------------
+//
+// r_proeng_text_drm_prev_rights_set 
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LBUF r_profiles_confirm_timed_expired
+    { txt = qtn_profiles_confirm_timed_expired ; }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngActiveProfileDelegate.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngActiveProfileDelegate
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngActiveProfileDelegate.h"
+#include    "ProfileEnginePrivatePSKeys.h" // KProEngActiveProfileModified 
+#include    <MProEngActiveProfileObserver.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngActiveProfileDelegate::CProEngActiveProfileDelegate
+// -----------------------------------------------------------------------------
+//
+CProEngActiveProfileDelegate::CProEngActiveProfileDelegate(
+        MProEngActiveProfileObserver& aObserver )
+    : CProEngPubSubObserverBase( KProEngActiveProfileModified ),
+      iObserver( aObserver )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngActiveProfileDelegate::NotifyObserverL
+// -----------------------------------------------------------------------------
+//
+void CProEngActiveProfileDelegate::NotifyObserverL()
+    {
+    iObserver.HandleActiveProfileModifiedL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngActiveProfileDelegate::NotifyError
+// -----------------------------------------------------------------------------
+//
+void CProEngActiveProfileDelegate::NotifyError( TInt aError )
+    {
+    iObserver.HandleActiveProfileNotificationError( aError );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngActiveProfileDelegate.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Listen the changes in the Publish & Subscribe key
+*
+*/
+
+
+
+#ifndef CPROENGACTIVEPROFILEDELEGATE_H
+#define CPROENGACTIVEPROFILEDELEGATE_H
+
+// INCLUDES
+#include "CProEngPubSubObserverBase.h"
+
+// FORWARD DECLARATIONS
+class MProEngActiveProfileObserver;
+
+// CLASS DECLARATION
+
+/**
+* This class listens to the changes in the Publish & Subscribe key that is used
+* by Profiles Engine to notify that the active profile has been modified.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngActiveProfileDelegate )
+    : public CProEngPubSubObserverBase
+    {
+    public:  // constructor and destructor
+        CProEngActiveProfileDelegate(
+                MProEngActiveProfileObserver& aObserver );
+
+        ~CProEngActiveProfileDelegate() {};
+
+    private: // Functions from base classes
+
+        /**
+         * From CProEngActiveProfileDelegateBase.
+         */
+        void NotifyObserverL();
+
+        void NotifyError( TInt aError );
+
+    public: // Data:
+
+        // Profile Activation Observer reference
+        MProEngActiveProfileObserver& iObserver;
+
+    };
+
+#endif      //  CPROENGACTIVEPROFILEDELEGATE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,274 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngAlertToneSeekerImpl
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngAlertToneSeekerImpl.h"
+#include    <MCLFItemListModel.h>
+#include    <MCLFContentListingEngine.h>
+#include    <MCLFItem.h>
+#include    <ContentListingFactory.h>
+#include    <f32file.h>  // RFs, TParse
+#include    <pathinfo.h>
+#include    <MProEngAlertToneSeekerObserver.h>
+#include    "CProEngPostFilter.h"
+
+namespace
+    {
+    // Constants
+    const TInt KProEngRomFileArrayGranularity( 40 );
+    const TInt KProEngToneListGranularity( 80 );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::CProEngAlertToneSeekerImpl
+// -----------------------------------------------------------------------------
+//
+CProEngAlertToneSeekerImpl::CProEngAlertToneSeekerImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngAlertToneSeekerImpl::ConstructL()
+    {
+    iContentListingEngine = ContentListingFactory::NewContentListingEngineLC(); // CSI: 49 # iContentLisingEngine is popped out of the stack immediately
+    CleanupStack::Pop(); // iContentListingEngine
+    iPostFilter = CProEngPostFilter::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngAlertToneSeekerImpl* CProEngAlertToneSeekerImpl::NewL()
+    {
+    CProEngAlertToneSeekerImpl* self =
+        new ( ELeave ) CProEngAlertToneSeekerImpl();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CProEngAlertToneSeekerImpl::~CProEngAlertToneSeekerImpl()
+    {
+    delete iPostFilter;
+    delete iRomFiles;
+    delete iModel;
+    delete iContentListingEngine;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::FetchAlertToneListL
+// -----------------------------------------------------------------------------
+//
+void CProEngAlertToneSeekerImpl::FetchAlertToneListL(
+        MProEngAlertToneSeekerObserver& aObserver )
+    {
+    iObserver = &aObserver;
+
+    if( !iRomFiles )
+        {
+        CreateRomFileListL();
+        }
+
+    CreateListModelL();
+
+    iModel->RefreshL(); // asynchronous
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::CancelFetch
+// -----------------------------------------------------------------------------
+//
+void CProEngAlertToneSeekerImpl::CancelFetch()
+    {
+    if( iModel )
+        {
+        iModel->CancelRefresh();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::FetchAlertToneListL
+// -----------------------------------------------------------------------------
+//
+void CProEngAlertToneSeekerImpl::HandleOperationEventL(
+        TCLFOperationEvent aOperationEvent,
+        TInt aError )
+    {
+    // We are only interested of refresh complete, ignore other events:
+    if( aOperationEvent != ECLFRefreshComplete )
+        {
+        return;
+        }
+
+    if( aError != KErrNone )
+        {
+        iObserver->HandleError( aError );
+        return;
+        }
+
+    CDesCArray* toneList =
+        new ( ELeave ) CDesCArraySeg( KProEngToneListGranularity );
+    CleanupStack::PushL( toneList );
+
+    // copy the files in ROM
+    TInt count( iRomFiles->Count() );
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        toneList->AppendL( ( *iRomFiles )[i] );
+        }
+
+    // copy the files found by Content Listing Framework
+    count = iModel->ItemCount();
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        TPtrC fileNameAndPath;
+        aError = iModel->Item( i ).GetField( ECLFFieldIdFileNameAndPath,
+                                             fileNameAndPath );
+        if( aError )
+            {
+            break;
+            }
+
+        toneList->AppendL( fileNameAndPath );
+        }
+
+    if( aError != KErrNone )
+        {
+        CleanupStack::PopAndDestroy( toneList );
+        iObserver->HandleError( aError );
+        return;
+        }
+
+    CleanupStack::Pop( toneList );
+
+    TRAP( aError,
+          iObserver->HandleAlertToneListCompletedL( toneList ) );
+    if( aError != KErrNone )
+        {
+        iObserver->HandleError( aError );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::CreateListModelL
+// -----------------------------------------------------------------------------
+//
+void CProEngAlertToneSeekerImpl::CreateListModelL()
+    {
+    if( iModel )
+        {
+        delete iModel;
+        iModel = NULL;
+        }
+
+    iModel = iContentListingEngine->CreateListModelLC( *this );
+    CleanupStack::Pop(); // iModel
+
+    // array for wanted media types
+    RArray<TInt> array;
+    CleanupClosePushL( array );
+
+    array.AppendL( ECLFMediaTypeMusic );
+    array.AppendL( ECLFMediaTypeSound );
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    array.AppendL( ECLFMediaTypeVideo );
+#endif  // RD_VIDEO_AS_RINGING_TONE
+
+    iModel->SetWantedMediaTypesL( array.Array() );
+    iModel->SetPostFilter( iPostFilter );
+
+    CleanupStack::PopAndDestroy( &array );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::CreateRomFileListL
+// -----------------------------------------------------------------------------
+//
+void CProEngAlertToneSeekerImpl::CreateRomFileListL()
+    {
+    iRomFiles = new ( ELeave ) CDesCArraySeg( KProEngRomFileArrayGranularity );
+
+    RFs fs;
+    User::LeaveIfError( fs.Connect() );
+    CleanupClosePushL( fs );
+
+    RBuf pathBuf;
+    CleanupClosePushL( pathBuf );
+    pathBuf.CreateL( KMaxFileName );
+    pathBuf.Append( PathInfo::RomRootPath() );
+    TInt rootPathLength( pathBuf.Length() );
+
+    TParse* parse = new ( ELeave ) TParse;
+    CleanupStack::PushL( parse );
+
+    pathBuf.Append( PathInfo::DigitalSoundsPath() );
+    AppendRomFilesL( fs, pathBuf, *parse );
+
+    pathBuf.SetLength( rootPathLength );
+    pathBuf.Append( PathInfo::SimpleSoundsPath() );
+    AppendRomFilesL( fs, pathBuf, *parse );
+    
+    CleanupStack::PopAndDestroy( 3, &fs );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngAlertToneSeekerImpl::AppendRomFilesL
+// -----------------------------------------------------------------------------
+//
+void CProEngAlertToneSeekerImpl::AppendRomFilesL( RFs& aFs, const TDesC& aPath,
+                                                  TParse& aParse )
+    {
+    CDir* dir;
+    TInt err( aFs.GetDir( aPath, KEntryAttNormal, ESortNone, dir ) );
+
+    if( ( err != KErrNone ) && ( err != KErrPathNotFound ) )
+        {
+        User::Leave( err );
+        }
+
+    if( err == KErrNone )
+        {
+        CleanupStack::PushL( dir );
+
+        TInt count( dir->Count() );
+        for( TInt i( 0 ); i<count; ++i )
+            {
+            // concatenate the directory path and the file name
+            aParse.Set( aPath, &( ( *dir )[i].iName ), NULL );
+
+            iRomFiles->AppendL( aParse.FullName() );
+            }
+
+        CleanupStack::PopAndDestroy( dir );
+        }
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class implements MProEngAlertToneSeeker interface.
+*
+*/
+
+
+
+#ifndef CPROENGALERTTONESEEKERIMPL_H
+#define CPROENGALERTTONESEEKERIMPL_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MProEngAlertToneSeeker.h>
+#include <MCLFOperationObserver.h>
+#include    <badesca.h>  // CDesCArray
+
+// FORWARD DECLARATIONS
+class MCLFItemListModel;
+class MCLFContentListingEngine;
+class CProEngPostFilter;
+class RFs;
+class TParse;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngAlertToneSeeker interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngAlertToneSeekerImpl ) : public CBase,
+                                                  public MProEngAlertToneSeeker,
+                                                  public MCLFOperationObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngAlertToneSeekerImpl* NewL();
+
+        /**
+         * Destructor.
+         */
+         virtual ~CProEngAlertToneSeekerImpl();
+
+    public:  // Functions from base classes
+
+        /**
+         * From MProEngAlertToneSeeker
+         */
+        void FetchAlertToneListL( MProEngAlertToneSeekerObserver& aObserver );
+
+        /**
+         * From MProEngAlertToneSeeker
+         */
+        void CancelFetch();
+
+        /**
+         * From MCLFOperationObserver
+         */
+        void HandleOperationEventL( TCLFOperationEvent aOperationEvent,
+                                    TInt aError );
+
+    private:  // New functions
+
+        /**
+         * Creates the list model to fetch files through CLF.
+         */
+        void CreateListModelL();
+
+        /**
+         * Read the files in ROM and save them in iRomFiles.
+         */
+        void CreateRomFileListL();
+
+        /**
+         * Helper method for CreateRomFileListL() to handle reading of the
+         * contents of one directory and adding the files found in ROM file
+         * array.
+         */
+        void AppendRomFilesL( RFs& aFs, const TDesC& aPath, TParse& aParse );
+                                                         
+    private:
+
+        /**
+         * C++ default constructor.
+         */
+        CProEngAlertToneSeekerImpl();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Own: Array holding the tones/videos in ROM
+        CDesCArray* iRomFiles;
+
+        // Own: Model for files not in ROM
+        MCLFItemListModel* iModel;
+
+        // Own: Content listing engine
+        MCLFContentListingEngine* iContentListingEngine;
+
+        // Ref: client-implemented observer
+        MProEngAlertToneSeekerObserver* iObserver;
+
+        // Own: Post filter for the list model
+        CProEngPostFilter* iPostFilter;
+    };
+
+#endif      //  CPROENGALERTTONESEEKERIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngCenRepObserverBase.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngCenRepObserverBase.h"
+#include    <centralrepository.h>
+#include    "ProfileEnginePrivatePSKeys.h"
+#include    "ProfileEngineSDKCRKeys.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngCenRepObserverBase::CProEngCenRepObserverBase
+// -----------------------------------------------------------------------------
+//
+CProEngCenRepObserverBase::CProEngCenRepObserverBase( TUint32 aPartialCenRepKey,
+                                                      TUint32 aKeyMask )
+    : CProEngObserverBase( aPartialCenRepKey ), iKeyMask( aKeyMask )
+    {
+    }
+
+// Destructor
+CProEngCenRepObserverBase::~CProEngCenRepObserverBase()
+    {
+    Cancel();
+    delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngCenRepObserverBase::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngCenRepObserverBase::ConstructL()
+    {
+    iRepository = CRepository::NewL( KCRUidProfileEngine );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngCenRepObserverBase::RequestNotification
+// -----------------------------------------------------------------------------
+//
+TInt CProEngCenRepObserverBase::RequestNotification()
+    {
+    TInt result( iRepository->NotifyRequest( iKey, iKeyMask, iStatus ) );
+    if( result == KErrNone )
+        {
+        SetActive();
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngCenRepObserverBase::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CProEngCenRepObserverBase::DoCancel()
+    {
+    iRepository->NotifyCancel( iKey, iKeyMask );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Listening the events in Central Repository.
+*
+*/
+
+
+
+#ifndef CPROENGCENREPOBSERVERBASE_H
+#define CPROENGCENREPOBSERVERBASE_H
+
+// INCLUDES
+#include "CProEngObserverBase.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+* The base class for listening to events in Central Repository. This is
+* a helper class for CProEngNotifyHandlerImpl.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngCenRepObserverBase ) : public CProEngObserverBase
+    {
+    protected:  // constructor and destructor
+
+        CProEngCenRepObserverBase( TUint32 aPartialCenRepKey,
+                                   TUint32 aKeyMask );
+
+        virtual ~CProEngCenRepObserverBase(); 
+
+        virtual void ConstructL();
+
+    public: // Functions from base classes
+
+        /**
+         * From CProEngObserverBase.
+         */
+        TInt RequestNotification();
+
+        /**
+         * From CActive.
+         */
+        void DoCancel();
+
+    protected: // Data:
+
+        // The mask to request notifications about several keys from CenRep
+        TUint32 iKeyMask;
+
+        // Own: Profiles Engine Central Repository
+        CRepository* iRepository;
+
+    };
+
+#endif      //  CPROENGCENREPOBSERVERBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngDrmCommonWrapper.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The wrapper of DRMCommon class.
+*
+*/
+
+
+#ifndef CPROENGDRMCOMMONWRAPPER_H
+#define CPROENGDRMCOMMONWRAPPER_H
+
+
+// INCLUDE FILES
+#include    <e32base.h>
+
+// FORWARD DECLARATIONS
+class DRMCommon;
+
+// CLASS DECLARATION
+
+/**
+* This class is a wrapper around the DRMCommon class.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngDrmCommonWrapper ) : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngDrmCommonWrapper* NewL();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngDrmCommonWrapper();
+
+    public:  // New functions
+
+        /**
+         * Checks if the given file is protected.
+         * @param aFileName the file to be checked.
+         * @return ETrue if protected, EFalse otherwise.
+         */
+        TBool IsProtected( const TDesC& aFileName );
+        
+        /**
+         * Checks if the given file is protected.
+         * @param aFileName the file to be checked.
+         * @return ETrue if protected, EFalse otherwise.
+         */
+        TBool IsProtectedL( const TDesC& aFileName );
+
+    private:
+
+        /**
+         * C++ default constructor.
+         */
+        CProEngDrmCommonWrapper();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        /// Own: The real DRMCommon 
+        DRMCommon* iDrmCommon;
+
+    };
+
+#endif      //  CPROENGDRMCOMMONWRAPPER_H
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngDrmCommonWrapperEmpty.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngDrmCommonWrapper.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngDrmCommonWrapper.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::CProEngDrmCommonWrapper
+// -----------------------------------------------------------------------------
+//
+CProEngDrmCommonWrapper::CProEngDrmCommonWrapper()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngDrmCommonWrapper::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngDrmCommonWrapper* CProEngDrmCommonWrapper::NewL()
+    {
+    CProEngDrmCommonWrapper* self =
+        new ( ELeave ) CProEngDrmCommonWrapper();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CProEngDrmCommonWrapper::~CProEngDrmCommonWrapper()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::IsProtectedFile
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TInt CProEngDrmCommonWrapper::IsProtected(
+    const TDesC& /* aFileName */ )
+    {
+    return KErrNone;
+    }
+    
+//  End of File
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngDrmCommonWrapperFull.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngDrmCommonWrapper.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngDrmCommonWrapper.h"
+#include    <DRMCommon.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::CProEngDrmCommonWrapper
+// -----------------------------------------------------------------------------
+//
+CProEngDrmCommonWrapper::CProEngDrmCommonWrapper()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngDrmCommonWrapper::ConstructL()
+    {
+    iDrmCommon = DRMCommon::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngDrmCommonWrapper* CProEngDrmCommonWrapper::NewL()
+    {
+    CProEngDrmCommonWrapper* self =
+        new ( ELeave ) CProEngDrmCommonWrapper();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CProEngDrmCommonWrapper::~CProEngDrmCommonWrapper()
+    {
+    delete iDrmCommon;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::IsProtected
+// -----------------------------------------------------------------------------
+//
+TInt CProEngDrmCommonWrapper::IsProtected( const TDesC& aFileName )
+    {
+    TBool result = EFalse;
+    TRAP_IGNORE( result = IsProtectedL( aFileName ) );
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngDrmCommonWrapper::IsProtectedL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngDrmCommonWrapper::IsProtectedL( const TDesC& aFileName )
+    {
+    // ignore error, default is "unprotected":
+    TInt isProtected( EFalse );
+   	ContentAccess::TVirtualPathPtr path( aFileName,
+   						ContentAccess::KDefaultContentObject );
+   	CData* data = CData::NewLC( path, EContentShareReadWrite );
+   	TInt result = data->GetAttribute( EIsProtected, isProtected );
+   	CleanupStack::PopAndDestroy(); // data
+
+    return( ( result == DRMCommon::EOk ) && isProtected );
+    }
+    
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,274 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngEngineImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngEngineImpl.h"
+#include    <f32file.h>
+#include    <MProEngProfile.h>
+#include    <MProEngProfileNameArray.h>
+#include    "MProfileEngineExtended.h"
+#include    "ProfileEngineConstants.h"
+#include    "CProEngProfileImpl.h"
+#include    "CProEngToneHandler.h"
+#include    "CProEngProfileNameArrayImpl.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::CProEngEngineImpl
+// -----------------------------------------------------------------------------
+//
+CProEngEngineImpl::CProEngEngineImpl()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngEngineImpl::ConstructL()
+    {
+    iProfileEngine = CreateProfileEngineExtendedL();
+    iToneHandler = CProEngToneHandler::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngEngineImpl::ConstructL( RFs& aFs )
+    {
+    iProfileEngine = CreateProfileEngineExtendedL( &aFs );
+    iToneHandler = CProEngToneHandler::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngEngineImpl* CProEngEngineImpl::NewL()
+    {
+    CProEngEngineImpl* self = CProEngEngineImpl::NewLC();
+
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngEngineImpl* CProEngEngineImpl::NewLC()
+    {
+    CProEngEngineImpl* self = new ( ELeave ) CProEngEngineImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngEngineImpl* CProEngEngineImpl::NewL( RFs& aFs )
+    {
+    CProEngEngineImpl* self = CProEngEngineImpl::NewLC( aFs );
+
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngEngineImpl* CProEngEngineImpl::NewLC( RFs& aFs )
+    {
+    CProEngEngineImpl* self = new ( ELeave ) CProEngEngineImpl;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aFs );
+
+    return self;
+    }
+
+// Destructor
+CProEngEngineImpl::~CProEngEngineImpl()
+    {
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    delete iToneHandler;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::Release
+// -----------------------------------------------------------------------------
+//
+void CProEngEngineImpl::Release()
+    {
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ActiveProfileLC
+// -----------------------------------------------------------------------------
+//
+MProEngProfile* CProEngEngineImpl::ActiveProfileLC()
+    {
+    return ProfileLC( ActiveProfileId() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ActiveProfileL
+// -----------------------------------------------------------------------------
+//
+MProEngProfile* CProEngEngineImpl::ActiveProfileL()
+    {
+    MProEngProfile* profileWrapper = ActiveProfileLC();
+
+    CleanupStack::Pop(); // profileWrapper
+    
+    return profileWrapper;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ActiveProfileId
+// -----------------------------------------------------------------------------
+//
+TInt CProEngEngineImpl::ActiveProfileId()
+    {
+    return iProfileEngine->ActiveProfileId();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ProfileNameArrayLC
+// -----------------------------------------------------------------------------
+//
+MProEngProfileNameArray* CProEngEngineImpl::ProfileNameArrayLC()
+    {
+    MProfilesNamesArray* nameArray = iProfileEngine->ProfilesNamesArrayLC();
+
+    CProEngProfileNameArrayImpl* nameArrayWrapper =
+        CProEngProfileNameArrayImpl::NewL( nameArray ); // takes ownership
+
+    CleanupStack::Pop();  // namearray
+    CleanupStack::PushL( nameArrayWrapper );
+
+    return nameArrayWrapper;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::SetActiveProfileL
+// -----------------------------------------------------------------------------
+//
+void CProEngEngineImpl::SetActiveProfileL( TInt aId )
+    {
+    iProfileEngine->SetActiveProfileL( aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ProfileLC
+// -----------------------------------------------------------------------------
+//
+MProEngProfile* CProEngEngineImpl::ProfileLC( TInt aId )
+    {
+    return ProfilePrivateLC( aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ProfileL
+// -----------------------------------------------------------------------------
+//
+MProEngProfile* CProEngEngineImpl::ProfileL( TInt aId )
+    {
+    MProEngProfile* profileWrapper = ProfileLC( aId );
+
+    CleanupStack::Pop();  // profileWrapper
+
+    return profileWrapper;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ProfilePrivateLC
+// -----------------------------------------------------------------------------
+//
+CProEngProfileImpl* CProEngEngineImpl::ProfilePrivateLC( TInt aId )
+    {
+    // This check is needed if the given id belongs to a variated profile which
+    // is not supported by the platform (unfortunately the settings for this
+    // kind of profile always exist in Central Repository):
+    if( !IsDynamicProfileId( aId ) && !iProfileEngine->IsDefaultProfile( aId ) )
+        {
+        User::Leave( KErrNotFound );
+        }
+
+    MProfileExtended* profile = iProfileEngine->ProfileLC( aId );
+
+    CProEngProfileImpl* profileWrapper =
+        CProEngProfileImpl::NewL( *this, profile );
+
+    CleanupStack::Pop(); // profile
+    CleanupStack::PushL( profileWrapper );
+
+    return profileWrapper;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ProfileEngineExtended
+// -----------------------------------------------------------------------------
+//
+MProfileEngineExtended& CProEngEngineImpl::ProfileEngineExtended()
+    {
+    return *iProfileEngine;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::ToneHandler
+// -----------------------------------------------------------------------------
+//
+CProEngToneHandler& CProEngEngineImpl::ToneHandler()
+    {
+    return *iToneHandler;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngEngineImpl::IsDynamicProfileId
+// -----------------------------------------------------------------------------
+//
+TBool CProEngEngineImpl::IsDynamicProfileId( TInt aId )
+    {
+    return ( ( aId >= KProfileBaseDynamicProfileId ) &&
+             ( aId < ( KProfileBaseDynamicProfileId +
+                       KProfilesMaxNumberOfDynamicProfiles ) ) );
+    }
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementaion of MProEngEngine interface.
+*
+*/
+
+
+
+#ifndef CPROENGENGINEIMPL_H
+#define CPROENGENGINEIMPL_H
+
+// INCLUDES
+#include <MProEngEngine.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class RFs;
+class MProEngProfile;
+class MProEngProfileNameArray;
+class MProfileEngineExtended;
+class CProEngToneHandler;
+class CProEngProfileImpl;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngEngine interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngEngineImpl ) : public CBase,
+                                         public MProEngEngine
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngEngineImpl* NewL();
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngEngineImpl* NewLC();
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngEngineImpl* NewL( RFs& aFs );
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngEngineImpl* NewLC( RFs& aFs );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngEngineImpl();
+
+    public:
+
+        /**
+         * From MProEngEngine
+         */
+        void Release();
+
+        /**
+         * From MProEngEngine
+         */
+        MProEngProfile* ActiveProfileLC();
+
+        /**
+         * From MProEngEngine
+         */
+        MProEngProfile* ActiveProfileL();
+
+        /**
+         * From MProEngEngine
+         */
+        TInt ActiveProfileId();
+
+        /**
+         * From MProEngEngine
+         */
+        MProEngProfileNameArray* ProfileNameArrayLC();
+
+        /**
+         * From MProEngEngine
+         */
+        void SetActiveProfileL( TInt aId );
+
+        /**
+         * From MProEngEngine
+         */
+        MProEngProfile* ProfileLC( TInt aId );
+
+        /**
+         * From MProEngEngine
+         */
+        MProEngProfile* ProfileL( TInt aId );
+
+    public:  // New functions
+
+        /**
+         * Gets the data of the given profile.
+         * @since 3.1
+         * @param aId the ID of the profile which data is retrieved.
+         * @return Pointer to the implementation of profile data wrapper.
+         */
+        CProEngProfileImpl* ProfilePrivateLC( TInt aId );
+
+        /**
+         * Returns a reference to the underlying Profiles Engine Extended.
+         * @since 3.1
+         * @return Reference to the underlying Profiles Engine Extended.
+         */
+        MProfileEngineExtended& ProfileEngineExtended();
+
+        /**
+         * Returns a reference to the tone handler needed for checking the
+         * legality of the alert tones set by the client.
+         * @since 3.1
+         * @return Reference to the tone handler.
+         */
+        CProEngToneHandler& ToneHandler();
+
+    private:  // New functions
+
+        /**
+         * Checks if the given profile ID is in the range reserved for dynamic
+         * profiles. However, the method does not check whether a profile with
+         * the given ID really exists.
+         * @since 3.1
+         * @param aId the profile ID to be checked
+         * @return ETrue if the ID is in the range of dynamic profile IDs,
+         *         EFalse otherwise
+         */
+        TBool IsDynamicProfileId( TInt aId );
+
+    private:
+
+        /**
+         * C++ default constructor.
+         */
+        CProEngEngineImpl();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( RFs& aFs );
+
+    private:    // Data
+
+        // Own: the actual Profiles Engine
+        MProfileEngineExtended* iProfileEngine;
+
+        // Own: tone handler for DRM checkups etc.
+        CProEngToneHandler* iToneHandler;
+    };
+
+#endif      //  CPROENGENGINEIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngMediaVariation.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngMediaVariation.h"
+#include 	<centralrepository.h>
+#include    <apgcli.h> // RApaLsSession
+#include    "ProfileEngineInternalCRKeys.h"
+#include    "ProEngMmfInfoUtility.h"
+#include    "MProfileUtilitySingleton.h"
+#include    "MProfilesLocalFeatures.h"
+
+namespace
+	{
+	// CONSTANTS
+	_LIT( KProEngVideoMimeType, "video/*" );
+	_LIT( KProEngRMVideoMimeType, "application/vnd.rn-realmedia" );
+	_LIT( KProEngSDPVideoMimeType, "application/sdp" );
+#ifdef RD_VIDEO_AS_RINGING_TONE	
+    const TInt KProEngFeatureIdVideoAsRingingTone( 1 );
+#else
+    const TInt KProEngFeatureIdVideoAsRingingTone( 0 );
+#endif
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngMediaVariation::CProEngMediaVariation
+// -----------------------------------------------------------------------------
+//
+CProEngMediaVariation::CProEngMediaVariation()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngMediaVariation::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngMediaVariation::ConstructL()
+    {
+    User::LeaveIfError( iApaLsSession.Connect() );
+
+    // Singleton must be released in destructor
+    iLocalFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() );
+                        
+    const TInt KProEngMimesGranularity( 10 );
+    iSupportedMimeTypes = new ( ELeave ) CDesC8ArrayFlat(
+            KProEngMimesGranularity );
+    iMimeTypeBuf.CreateL( KMaxDataTypeLength ); 
+    ProEngMmfInfoUtility::GetSupportedMimeTypesL( *iSupportedMimeTypes );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngMediaVariation::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngMediaVariation* CProEngMediaVariation::NewL()
+    {
+    CProEngMediaVariation* self =
+        new ( ELeave ) CProEngMediaVariation();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CProEngMediaVariation::~CProEngMediaVariation()
+    {
+    delete iSupportedMimeTypes;
+    iMimeTypeBuf.Close();
+    iApaLsSession.Close();
+    
+    if ( iLocalFeatures )
+        {
+        ReleaseProfileUtility();    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngMediaVariation::DataTypeL
+// -----------------------------------------------------------------------------
+//
+void CProEngMediaVariation::GetDataTypeL(
+        const TDesC& aFileName, TDes16& aDataType ) const
+    {
+    TUid dummyUid = { 0 }; // instantiate as zero
+    TDataType dataType( dummyUid );
+    User::LeaveIfError(
+        iApaLsSession.AppForDocument( aFileName, dummyUid, dataType ) );
+    aDataType.Copy( dataType.Des8() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngMediaVariation::IsSupported
+// -----------------------------------------------------------------------------
+//
+TBool CProEngMediaVariation::IsSupported( const TDesC16& aMimeType )
+    {
+    if( !KProEngFeatureIdVideoAsRingingTone &&
+        ( ( aMimeType.MatchF( KProEngVideoMimeType ) == 0 ) ||
+          ( aMimeType.CompareF( KProEngRMVideoMimeType ) == 0 ) ||
+          ( aMimeType.CompareF( KProEngSDPVideoMimeType ) == 0 ) ) )
+        {
+        return EFalse;
+        }
+
+    if( iLocalFeatures->IsBlockedType( aMimeType ) ||
+        iLocalFeatures->IsExcludedType( aMimeType ) )
+        {
+        return EFalse;
+        }
+
+    TInt ignore( 0 );
+    iMimeTypeBuf.Copy( aMimeType );
+    if( iSupportedMimeTypes->FindIsq( iMimeTypeBuf, ignore ) != KErrNone )
+        {
+        return EFalse;
+        }
+     
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngMediaVariation::IsAllowedProtected
+// -----------------------------------------------------------------------------
+//
+TBool CProEngMediaVariation::IsAllowedProtected( const TDesC16& aMimeType )
+    const
+    {
+    return !iLocalFeatures->IsBlockedProtectedType( aMimeType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngMediaVariation::IsAllowedUnProtected
+// -----------------------------------------------------------------------------
+//
+TBool CProEngMediaVariation::IsAllowedUnProtected( const TDesC16& aMimeType )
+    const
+    {
+    return !iLocalFeatures->IsBlockedUnprotectedType( aMimeType );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class is used to read the variated features concerning 
+* 				different mime types of media files.
+*
+*/
+
+
+#ifndef CPROENGMEDIAVARIATION_H
+#define CPROENGMEDIAVARIATION_H
+
+
+// INCLUDE FILES
+#include    <e32base.h>
+#include    <apgcli.h> // RApaLsSession
+
+// FORWARD DECLARATIONS
+class MProfilesLocalFeatures;
+
+// CLASS DECLARATION
+
+/**
+* This class is used to read the variated features concerning different mime
+* types of media files.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngMediaVariation ) : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngMediaVariation* NewL();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngMediaVariation();
+
+    public:  // New functions
+
+        /**
+         * Returns the MIME type of the given file.
+         * @param aFileName the file the MIME type of which should be found out.
+         * @param aDataType contains the MIME type of aFileName on return.
+         */
+        void GetDataTypeL( const TDesC& aFileName, TDes16& aDataType ) const;
+
+        /**
+         * Checks if files of the given MIME type are supported to be used as
+         * alert tones.
+         * @param aMimeType the MIME type to be checked
+         * @return ETrue if aMimeType is supported, EFalse otherwise.
+         */
+        TBool IsSupported( const TDesC16& aMimeType );
+
+        /**
+         * Checks if files of the given MIME type are allowed to be used as
+         * alert tones if they are DRM-protected.
+         * @param aMimeType the MIME type to be checked
+         * @return ETrue if files of the given type are allowed,
+         * EFalse otherwise.
+         */
+        TBool IsAllowedProtected( const TDesC16& aMimeType ) const;
+
+        /**
+         * Checks if files of the given MIME type are allowed to be used as
+         * alert tones if they are NOT DRM-protected.
+         * @param aMimeType the MIME type to be checked
+         * @return ETrue if files of the given type are allowed,
+         * EFalse otherwise.
+         */
+        TBool IsAllowedUnProtected( const TDesC16& aMimeType ) const;
+
+    private:
+
+        /**
+         * C++ default constructor.
+         */
+        CProEngMediaVariation();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        /// Needed to get the MIME-type of the files
+        RApaLsSession iApaLsSession;
+
+        /// Not owned: Profiles local features
+        MProfilesLocalFeatures* iLocalFeatures;
+
+        /// Array holding the MIME types supported by MMF (and DevSound)
+        CDesC8ArrayFlat* iSupportedMimeTypes;
+
+        /// 8-bit helper buffer needed in IsSupported()
+        RBuf8 iMimeTypeBuf;
+    };
+
+#endif      //  CPROENGMEDIAVARIATION_H
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,277 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngNotifyHandlerImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngNotifyHandlerImpl.h"
+#include    <MProEngProfileActivationObserver.h>
+#include    <MProEngActiveProfileObserver.h>
+#include    <MProEngProfileObserver.h>
+#include    <MProEngProfileNameArrayObserver.h>
+#include    "ProfileEngineConstants.h"
+#include    "ProfileEnginePrivateCRKeys.h"
+#include    "ProfileEnginePrivatePSKeys.h"
+#include    "CProEngProfileActivationDelegate.h"
+#include    "CProEngActiveProfileDelegate.h"
+#include    "CProEngProfileNameArrayEventDelegate.h"
+#include    "CProEngProfileEventDelegate.h"
+
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CompareDelegates
+//
+// Comparison function to check that RPointerArray does not already
+// contain the given delegate for profile events
+// -----------------------------------------------------------------------------
+
+TBool CompareDelegates( const CProEngProfileEventDelegate& aDelegate1,
+                        const CProEngProfileEventDelegate& aDelegate2 )
+    {
+    return ( aDelegate1.ProfileId() == aDelegate2.ProfileId() );
+    }
+ 
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::CProEngNotifyHandlerImpl
+// -----------------------------------------------------------------------------
+//
+CProEngNotifyHandlerImpl::CProEngNotifyHandlerImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngNotifyHandlerImpl* CProEngNotifyHandlerImpl::NewL()
+    {
+    return new ( ELeave ) CProEngNotifyHandlerImpl();
+    }
+
+// Destructor
+CProEngNotifyHandlerImpl::~CProEngNotifyHandlerImpl()
+    {
+    CancelAll();
+    //iProfileEventDelegates.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::RequestProfileActivationNotifications
+// -----------------------------------------------------------------------------
+//
+TInt CProEngNotifyHandlerImpl::RequestProfileActivationNotificationsL(
+        MProEngProfileActivationObserver& aObserver )
+    {
+    if( iActiveIdEventDelegate )
+        {
+        return KErrAlreadyExists;
+        }
+
+    iActiveIdEventDelegate =
+            CProEngProfileActivationDelegate::NewL( aObserver );
+
+    // make the actual request to the Publish & Subscribe:
+    TInt result( iActiveIdEventDelegate->RequestNotification() );
+    if( result != KErrNone )
+        {
+        delete iActiveIdEventDelegate;
+        iActiveIdEventDelegate = NULL;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::RequestActiveProfileNotificationsL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngNotifyHandlerImpl::RequestActiveProfileNotificationsL(
+        MProEngActiveProfileObserver& aObserver )
+    {
+    if( iActiveProfileEventDelegate )
+        {
+        return KErrAlreadyExists;
+        }
+
+    iActiveProfileEventDelegate = new ( ELeave ) CProEngActiveProfileDelegate(
+            aObserver );
+
+    // make the actual request to the Publish & Subscribe:
+    TInt result( iActiveProfileEventDelegate->RequestNotification() );
+    if( result != KErrNone )
+        {
+        delete iActiveProfileEventDelegate;
+        iActiveProfileEventDelegate = NULL;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::RequestProfileNotificationsL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngNotifyHandlerImpl::RequestProfileNotificationsL(
+        MProEngProfileObserver& aObserver,
+        TInt aProfileId )
+    {
+    if( ( aProfileId < 0 ) || // profile id cannot be negative
+        // or greater than the last dynamic profile id
+        ( aProfileId > KProfileBaseDynamicProfileId +
+                       KProfilesMaxNumberOfDynamicProfiles ) )
+        {
+        return KErrNotFound;
+        }
+
+    CProEngProfileEventDelegate* delegate = CProEngProfileEventDelegate::NewL(
+            aProfileId, aObserver );
+            
+    TIdentityRelation<CProEngProfileEventDelegate> relation( CompareDelegates );
+    if( iProfileEventDelegates.Find( delegate, relation ) != KErrNotFound )
+        { // an observer has already been registered for the given profile id
+        delete delegate;
+        return KErrAlreadyExists;
+        }
+
+    TInt result( iProfileEventDelegates.Append( delegate ) );
+    if( result == KErrNone )
+        {
+        // make the actual request to the Central Repository:
+        result = delegate->RequestNotification();
+        }
+
+    if( result != KErrNone )
+        {
+        iProfileEventDelegates.Remove( iProfileEventDelegates.Count() - 1 );
+        delete delegate;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::RequestProfileNameArrayNotificationsL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngNotifyHandlerImpl::RequestProfileNameArrayNotificationsL(
+        MProEngProfileNameArrayObserver& aObserver )
+    {
+    if( iNameArrayEventDelegate )
+        {
+        return KErrAlreadyExists;
+        }
+
+    iNameArrayEventDelegate = CProEngProfileNameArrayEventDelegate::NewL(
+            aObserver );
+            
+    // make the actual request to the Central Repository:
+    TInt result( iNameArrayEventDelegate->RequestNotification() );
+    if( result != KErrNone )
+        {
+        delete iNameArrayEventDelegate;
+        iNameArrayEventDelegate = NULL;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::CancelProfileActivationNotifications
+// -----------------------------------------------------------------------------
+//
+void CProEngNotifyHandlerImpl::CancelProfileActivationNotifications()
+    {
+    if( iActiveIdEventDelegate )
+        {
+        iActiveIdEventDelegate->Cancel();
+        delete iActiveIdEventDelegate;
+        iActiveIdEventDelegate = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::CancelActiveProfileNotifications
+// -----------------------------------------------------------------------------
+//
+void CProEngNotifyHandlerImpl::CancelActiveProfileNotifications()
+    {
+    if( iActiveProfileEventDelegate )
+        {
+        iActiveProfileEventDelegate->Cancel();
+        delete iActiveProfileEventDelegate;
+        iActiveProfileEventDelegate = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::CancelProfileNotifications
+// -----------------------------------------------------------------------------
+//
+void CProEngNotifyHandlerImpl::CancelProfileNotifications( TInt aProfileId )
+    {
+    TInt count( iProfileEventDelegates.Count() );
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        if( iProfileEventDelegates[i]->ProfileId() == aProfileId )
+            {
+            CProEngProfileEventDelegate* delegate = iProfileEventDelegates[i];
+            iProfileEventDelegates.Remove( i );
+            delegate->Cancel();
+            delete delegate;
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::CancelProfileNameArrayNotifications
+// -----------------------------------------------------------------------------
+//
+void CProEngNotifyHandlerImpl::CancelProfileNameArrayNotifications()
+    {
+    if( iNameArrayEventDelegate )
+        {
+        iNameArrayEventDelegate->Cancel();
+        delete iNameArrayEventDelegate;
+        iNameArrayEventDelegate = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngNotifyHandlerImpl::CancelAll
+// -----------------------------------------------------------------------------
+//
+void CProEngNotifyHandlerImpl::CancelAll()
+    {
+    CancelProfileActivationNotifications();
+    CancelActiveProfileNotifications();
+    CancelProfileNameArrayNotifications();
+    TInt count = iProfileEventDelegates.Count();
+    for( TInt i( 0 ); i<count; ++i )
+        {
+        iProfileEventDelegates[i]->Cancel();
+        }
+    iProfileEventDelegates.ResetAndDestroy();
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class implements MProEngNotifyHandler interface.
+*
+*/
+
+
+
+#ifndef CPROENGNOTIFYHANDLERIMPL_H
+#define CPROENGNOTIFYHANDLERIMPL_H
+
+// INCLUDES
+#include <MProEngNotifyHandler.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CProEngProfileActivationDelegate;
+class CProEngActiveProfileDelegate;
+class CProEngProfileNameArrayEventDelegate;
+class CProEngProfileEventDelegate;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngNotifyHandler interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngNotifyHandlerImpl ) : public CBase,
+                                                public MProEngNotifyHandler
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngNotifyHandlerImpl* NewL();
+        
+        /**
+         * Destructor.
+         */
+          ~CProEngNotifyHandlerImpl();
+
+    public:
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        TInt RequestProfileActivationNotificationsL(
+                MProEngProfileActivationObserver& aObserver );
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        TInt RequestActiveProfileNotificationsL(
+                MProEngActiveProfileObserver& aObserver );
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        TInt RequestProfileNotificationsL(
+                MProEngProfileObserver& aObserver,
+                TInt aProfileId );
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        TInt RequestProfileNameArrayNotificationsL(
+                MProEngProfileNameArrayObserver& aObserver );
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        void CancelProfileActivationNotifications();
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        void CancelActiveProfileNotifications();
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        void CancelProfileNotifications( TInt aProfileId );
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        void CancelProfileNameArrayNotifications();
+
+        /**
+         * From MProEngNotifyHandler
+         */
+        void CancelAll();
+
+    private:
+
+        /**
+         * C++ default constructor.
+         */
+        CProEngNotifyHandlerImpl();
+
+    private:    // Data
+
+        // Own: Delegate for active profile change events
+        CProEngProfileActivationDelegate* iActiveIdEventDelegate;
+
+        // Own: Delegate for active profile modification events
+        CProEngActiveProfileDelegate* iActiveProfileEventDelegate;
+
+        // Own: Delegate for profile name array modification events
+        CProEngProfileNameArrayEventDelegate* iNameArrayEventDelegate;
+
+        // Own: Array of profile change observers
+        RPointerArray< CProEngProfileEventDelegate > iProfileEventDelegates;
+
+    };
+
+#endif      //  CPROENGNOTIFYHANDLERIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngObserverBase.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngObserverBase
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngObserverBase.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngObserverBase::CProEngObserverBase
+// -----------------------------------------------------------------------------
+//
+CProEngObserverBase::CProEngObserverBase( TUint32 aKey )
+    : CActive( EPriorityStandard ), iKey( aKey )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngObserverBase::
+// -----------------------------------------------------------------------------
+//
+void CProEngObserverBase::RunL()
+    {
+    TInt error( RequestNotification() );
+
+    if( !error )
+        {
+        TRAP( error, NotifyObserverL() );
+        }
+
+    if( error )
+        {
+        NotifyError( error );
+        }
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngObserverBase.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The base class for listening to events in Publish & Subscribe or in
+* 				Central Repository
+*
+*/
+
+
+
+#ifndef CPROENGOBSERVERBASE_H
+#define CPROENGOBSERVERBASE_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+* The base class for listening to events in Publish & Subscribe or in
+* Central Repository. This is a helper class for CProEngNotifyHandlerImpl.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngObserverBase ) : public CActive
+    {
+    protected:  // constructor and destructor
+
+        CProEngObserverBase( TUint32 aKey );
+
+        virtual ~CProEngObserverBase() {};
+
+    public: // New functions:
+
+        /**
+         * Absract method to request notifications from the source determined
+         * by the subclass. This must be called once after the real observer
+         * class is constructed. After that this is called by RunL() of this
+         * class.
+         * @return KErrNone if succeed, otherwise a system-wide error code.
+         */
+        virtual TInt RequestNotification() = 0;
+
+        /**
+         * Abstract method to send notification to the observer.
+         */
+        virtual void NotifyObserverL() = 0;
+
+        /**
+         * Abstract method to send notification about the given error to the
+         * observer.
+         * @param aError the error code to be delivered to the observer.
+         */
+        virtual void NotifyError( TInt aError ) = 0;
+
+    private: // Functions from base classes
+
+        /**
+         * From CActive.
+         */
+        void RunL();
+
+    protected: // Data:
+
+        // The key to observe
+        TUint32 iKey;
+
+    };
+
+#endif      //  CPROENGOBSERVERBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngPostFilter.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CProEngPostFilter.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProEngPostFilter.h"
+
+#include <MCLFItem.h>
+#include "CProEngMediaVariation.h"
+#include "CProEngDrmCommonWrapper.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngPostFilter::CProEngPostFilter
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProEngPostFilter::CProEngPostFilter()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngPostFilter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProEngPostFilter::ConstructL()
+    {
+    iMediaVariation = CProEngMediaVariation::NewL();
+    iDrmWrapper = CProEngDrmCommonWrapper::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngPostFilter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngPostFilter* CProEngPostFilter::NewL()
+    {
+    CProEngPostFilter* self = new (ELeave) CProEngPostFilter();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CProEngPostFilter::~CProEngPostFilter()
+    {
+    delete iDrmWrapper;
+    delete iMediaVariation;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngPostFilter::FilterItemsL
+// Method for filtering the source list.
+// -----------------------------------------------------------------------------
+//
+void CProEngPostFilter::FilterItemsL( const TArray<MCLFItem*>& aItemList,
+                                  RPointerArray<MCLFItem>& aFilteredItemList )
+    {
+    // Process all items in the item list
+    TInt count( aItemList.Count() );
+    for( TInt i = 0; i < count; i++ )
+        {
+        MCLFItem* currentItem = aItemList[i];
+        // Get the path of the media file from the item
+        TPtrC fileNameAndPath;
+        TInt error( currentItem->GetField( ECLFFieldIdFileNameAndPath,
+                                       fileNameAndPath ) );
+        
+        // Add the alert tone file to the filtered list,
+        // if it is OK according to the Media variation
+        if( error == KErrNone )
+            {
+            TBuf< KMaxDataTypeLength > dataType;
+            iMediaVariation->GetDataTypeL( fileNameAndPath, dataType );
+            TBool isSupported( iMediaVariation->IsSupported( dataType ) );
+            TBool isProtected( iDrmWrapper->IsProtected( fileNameAndPath ) );
+            if( ( isProtected &&
+                  iMediaVariation->IsAllowedProtected( dataType ) ) ||
+                ( !isProtected &&
+                     iMediaVariation->IsAllowedUnProtected( dataType ) ) )
+                {
+                aFilteredItemList.AppendL( currentItem );
+                }
+            }
+        }
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngPostFilter.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class is used to filter all the files that are of a forbidden type from
+*               the list returned by Content Listing Framework
+*
+*/
+
+
+
+#ifndef CPROENGPOSTFILTER_H
+#define CPROENGPOSTFILTER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <MCLFPostFilter.h>
+
+// FORWARD DECLARATIONS
+class MCLFItem;
+class CProEngDrmCommonWrapper;
+class CProEngMediaVariation;
+
+// CLASS DECLARATION
+
+/**
+* This class is used to filter all the files that are of a forbidden type from
+* the list returned by Content Listing Framework.
+*/
+NONSHARABLE_CLASS( CProEngPostFilter )
+    : public CBase,
+      public MCLFPostFilter
+    {
+    public:  // Constructors and destructor
+
+		/**
+		 * Creates and returns a new instance of this class.
+		 * @return Pointer to the CProEngPostFilter object
+		 */
+	    static CProEngPostFilter* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProEngPostFilter();
+
+    private:    // Constructors
+        /**
+        * C++ default constructor.
+        */
+        CProEngPostFilter();
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+    protected:  // Functions from base classes
+
+        /**
+        * From MCLFPostFilter. Method for filtering the source list. Will get 
+        * called when post filtering operation is executed by calling refresh 
+        * for the list model.
+        * @since Series 60 3.0
+        * @param aItemList Source item list
+        * @param aFilteredItemList Filtered/destination item list
+        */
+        void FilterItemsL( const TArray<MCLFItem*>& aItemList,
+                           RPointerArray<MCLFItem>& aFilteredItemList );
+
+    private:  // Data
+
+    /// Own: Needed to check whether a file is protected or not
+    CProEngDrmCommonWrapper* iDrmWrapper;
+
+    /// Own: Handles MIME-type checking
+    CProEngMediaVariation* iMediaVariation;
+    };
+
+#endif // CPROENGPOSTFILTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngProfileActivationDelegate.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngProfileActivationDelegate.h"
+#include    <centralrepository.h>
+#include    <MProEngProfileActivationObserver.h>
+#include    "ProfileEnginePrivatePSKeys.h"  // KProEngActiveProfileChanged
+#include    "ProfileEngineSDKCRKeys.h" // KCRUidProfileEngine etc.
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngProfileActivationDelegate::CProEngProfileActivationDelegate
+// -----------------------------------------------------------------------------
+//
+CProEngProfileActivationDelegate::CProEngProfileActivationDelegate(
+        MProEngProfileActivationObserver& aObserver )
+    : CProEngPubSubObserverBase( KProEngActiveProfileChanged ),
+      iObserver( aObserver )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileActivationDelegate::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileActivationDelegate::ConstructL()
+    {
+    iRepository = CRepository::NewL( KCRUidProfileEngine );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileActivationDelegate::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngProfileActivationDelegate* CProEngProfileActivationDelegate::NewL(
+        MProEngProfileActivationObserver& aObserver )
+    {
+    CProEngProfileActivationDelegate* self =
+        new ( ELeave ) CProEngProfileActivationDelegate( aObserver );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileActivationDelegate::~CProEngProfileActivationDelegate
+// -----------------------------------------------------------------------------
+//
+CProEngProfileActivationDelegate::~CProEngProfileActivationDelegate()
+    {
+    delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileActivationDelegate::NotifyObserverL
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileActivationDelegate::NotifyObserverL()
+    {
+    // Read the id of the current active profile and pass it to the observer
+    TInt profileId( 0 );
+    User::LeaveIfError( iRepository->Get( KProEngActiveProfile, profileId ) );
+    iObserver.HandleProfileActivatedL( profileId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileActivationDelegate::NotifyError
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileActivationDelegate::NotifyError( TInt aError )
+    {
+    iObserver.HandleProfileActivationNotificationError( aError );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class listens to the changes in the Publish & Subscribe key that is used
+*               by Profiles Engine to notify that the active profile has been changed.
+*
+*/
+
+
+
+#ifndef CPROENGPROFILEACTIVATIONDELEGATE_H
+#define CPROENGPROFILEACTIVATIONDELEGATE_H
+
+// INCLUDES
+#include "CProEngPubSubObserverBase.h"
+
+// FORWARD DECLARATIONS
+class CRepository;
+class MProEngProfileActivationObserver;
+
+// CLASS DECLARATION
+
+/**
+* This class listens to the changes in the Publish & Subscribe key that is used
+* by Profiles Engine to notify that the active profile has been changed.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngProfileActivationDelegate )
+    : public CProEngPubSubObserverBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngProfileActivationDelegate* NewL(
+                MProEngProfileActivationObserver& aObserver );
+        
+        /**
+         * Destructor.
+         */
+        ~CProEngProfileActivationDelegate();
+
+    private: // Functions from base classes
+
+        /**
+         * From CProEngProfileActivationDelegateBase.
+         */
+        void NotifyObserverL();
+
+        /**
+         * From CProEngProfileActivationDelegateBase.
+         */
+        void NotifyError( TInt aError );
+
+    private:
+
+        /**
+         * C++ constructor.
+         */
+        CProEngProfileActivationDelegate(
+                MProEngProfileActivationObserver& aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    public: // Data:
+
+        // Reference to the client implemented Profile Activation Observer
+        MProEngProfileActivationObserver& iObserver;
+
+        // Own: Profiles Engine Central Repository
+        CRepository* iRepository;
+
+    };
+
+#endif      //  CPROENGPROFILEACTIVATIONDELEGATE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileEventDelegate.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngProfileEventDelegate
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngProfileEventDelegate.h"
+#include    <MProEngProfileObserver.h>
+
+namespace
+    {
+    // CONSTANTS
+    // Profile ID is encoded in the first byte of a Profiles Engine CR key
+    const TInt KProEngProfileIdShift( 24 );
+    const TUint32 KProEngProfileIdMask( 0xFF000000 );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngProfileEventDelegate::CProEngProfileEventDelegate
+// -----------------------------------------------------------------------------
+//
+CProEngProfileEventDelegate::CProEngProfileEventDelegate(
+        TUint32 aPartialCenRepKey,
+        TUint32 aKeyMask,
+        MProEngProfileObserver& aObserver )
+    : CProEngCenRepObserverBase( aPartialCenRepKey, aKeyMask ),
+      iObserver( aObserver )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileEventDelegate::NewL
+// -----------------------------------------------------------------------------
+//
+CProEngProfileEventDelegate* CProEngProfileEventDelegate::NewL(
+          TInt aProfileId,
+          MProEngProfileObserver& aObserver )
+    {
+    CProEngProfileEventDelegate* self = new ( ELeave )
+        CProEngProfileEventDelegate( ( aProfileId << KProEngProfileIdShift ),
+                                     KProEngProfileIdMask, aObserver );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileEventDelegate::NotifyObserverL
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileEventDelegate::NotifyObserverL()
+    {
+    iObserver.HandleProfileModifiedL( ProfileId() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileEventDelegate::NotifyError
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileEventDelegate::NotifyError( TInt aError )
+    {
+    iObserver.HandleProfileNotificationError( aError );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileEventDelegate::NotifyError
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileEventDelegate::ProfileId() const
+    {
+    return ( iKey >> KProEngProfileIdShift );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileEventDelegate.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Delegate notifications about profile modifications
+*               to the observer.
+*
+*/
+
+
+
+#ifndef CPROENGPROFILEEVENTDELEGATE_H
+#define CPROENGPROFILEEVENTDELEGATE_H
+
+// INCLUDES
+#include "CProEngCenRepObserverBase.h"
+
+// FORWARD DECLARATIONS
+class MProEngProfileObserver;
+
+// CLASS DECLARATION
+
+/**
+* This class delegates notifications about profile modifications to the observer
+* implemented by the client of Profiles Engine Wrapper API. This is a helper
+* class for CProEngNotifyHandlerImpl.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngProfileEventDelegate )
+    : public CProEngCenRepObserverBase
+    {
+    public:  // constructor and destructor
+
+        static CProEngProfileEventDelegate* NewL(
+                 TInt aProfileId,
+                 MProEngProfileObserver& aObserver );
+
+        virtual ~CProEngProfileEventDelegate() {};
+
+    public: // Functions from base classes
+
+        /**
+         * From CProEngObserverBase.
+         */
+        void NotifyObserverL();
+
+        /**
+         * From CProEngObserverBase.
+         */
+        void NotifyError( TInt aError );
+
+
+    public: // New functions
+
+        /**
+         * Returns the ID of the profile observed by this class.
+         */
+        TInt ProfileId() const;
+
+    private:  // constructor
+
+        CProEngProfileEventDelegate( TUint32 aPartialCenRepKey,
+                                     TUint32 aKeyMask,
+                                     MProEngProfileObserver& aObserver );
+
+    private: // Data:
+
+        // The client implemented observer for profile modification events:
+        MProEngProfileObserver& iObserver;
+
+    };
+
+#endif      //  CPROENGPROFILEEVENTDELEGATE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,204 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngProfileImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngProfileImpl.h"
+#include    "CProEngProfileNameImpl.h"
+#include    "CProEngTonesImpl.h"
+#include    "CProEngToneSettingsImpl.h"
+#include    "CProEngEngineImpl.h"
+#include    "MProfileExtended.h"
+#include    "MProfileEngineExtended.h"
+#include    "MProfileSetTones.h"
+#include    "MProfileExtended.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::CProEngProfileImpl
+// -----------------------------------------------------------------------------
+//
+CProEngProfileImpl::CProEngProfileImpl( CProEngEngineImpl& aProfileEngine,
+                                        MProfileExtended* aProfile )
+    : iProfileEngine( aProfileEngine ), iProfile( aProfile )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileImpl::ConstructL()
+    {
+    TUint32 flags = iProfile->ModifiableFlags();
+    iProfileName = CProEngProfileNameImpl::NewL(
+            iProfile->ProfileName(),
+            iProfile->ProfileSetName(),
+            iProfileEngine,
+            flags & EProfileFlagProfileName );
+    iTones = CProEngTonesImpl::NewL( 
+            iProfile->ProfileTones(),
+            iProfile->ProfileSetTones(),
+            iProfile->ProfileExtraTones(),
+            iProfile->ProfileSetExtraTones(),
+            flags );
+    iToneSettings = CProEngToneSettingsImpl::NewL(
+            iProfile->ProfileSetTones().SetToneSettings(),
+            flags );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngProfileImpl* CProEngProfileImpl::NewL(
+        CProEngEngineImpl& aProfileEngine,
+        MProfileExtended* aProfile )
+    {
+    CProEngProfileImpl* self = new ( ELeave ) CProEngProfileImpl(
+            aProfileEngine, aProfile );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CProEngProfileImpl::~CProEngProfileImpl()
+    {
+    delete iToneSettings;
+    delete iTones;
+    delete iProfileName;
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::Release
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileImpl::Release()
+    {
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::AlertForL
+// -----------------------------------------------------------------------------
+//
+const TArray<TContactItemId> CProEngProfileImpl::AlertForL()
+    {
+    return iProfile->AlertForL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::SetAlertForL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileImpl::SetAlertForL( const TArray<TContactItemId>& aAlertFor )
+    {
+    TRAPD( err, iProfile->SetAlertForL( aAlertFor ) );
+    if( err == KErrArgument )
+        {
+        return err;
+        }
+
+    User::LeaveIfError( err );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::IsSilent
+// -----------------------------------------------------------------------------
+//
+TBool CProEngProfileImpl::IsSilent() const
+    {
+    return iProfile->IsSilent();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::ProfileName
+// -----------------------------------------------------------------------------
+//
+MProEngProfileName& CProEngProfileImpl::ProfileName() const
+    {
+    return *iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::ProfileTones
+// -----------------------------------------------------------------------------
+//
+MProEngTones& CProEngProfileImpl::ProfileTones() const
+    {
+    return *iTones;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::ToneSettings
+// -----------------------------------------------------------------------------
+//
+MProEngToneSettings& CProEngProfileImpl::ToneSettings() const
+    {
+    return *iToneSettings;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileImpl::CommitChangeL
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileImpl::CommitChangeL()
+    {
+    if( iProfileName->AlreadyExistsL( iProfileName->Name() ) )
+        {
+        User::Leave( KErrAlreadyExists );
+        }
+
+    User::LeaveIfError( iTones->CheckTonesL( iProfileEngine.ToneHandler() ) );
+
+    // Read the current tones of this profile for automated content removal
+    CProEngProfileImpl* current =
+        iProfileEngine.ProfilePrivateLC( iProfileName->Id() );
+
+    // Read the current settings (as internal interface) for roll back in case
+    // HandleAutomatedContentL() fails:
+    MProfileExtended* currentInternal =
+        iProfileEngine.ProfileEngineExtended().ProfileLC( iProfileName->Id() );
+
+    iProfileEngine.ProfileEngineExtended().CommitChangeL( *iProfile );
+
+    TInt err( iTones->HandleAutomatedContent( iProfileEngine.ToneHandler(),
+                                              *( current->iTones ) ) );
+    if( err )
+        { // Roll back the original settings:
+        iProfileEngine.ProfileEngineExtended().CommitChangeL(
+                *currentInternal );
+        }
+
+    CleanupStack::PopAndDestroy( 2 ); // currentInternal, current
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class implements MProEngProfile interface.
+*
+*/
+
+
+
+#ifndef CPROENGPROFILEIMPL_H
+#define CPROENGPROFILEIMPL_H
+
+// INCLUDES
+#include <MProEngProfile.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileName;
+class MProEngTones;
+class MProEngToneSettings;
+class MProfileExtended;
+class CProEngEngineImpl;
+class CProEngProfileNameImpl;
+class CProEngTonesImpl;
+class CProEngToneSettingsImpl;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngProfile interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngProfileImpl ) : public CBase,
+                                          public MProEngProfile
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         * @param aProfileEngine wrapper for Profiles Engine.
+         * @param aProfile private interface for Profiles data, ownership is
+         *        transferred.
+         */
+        static CProEngProfileImpl* NewL( CProEngEngineImpl& aProfileEngine,
+                                         MProfileExtended* aProfile );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngProfileImpl();
+
+    public:
+
+        /**
+         * From MProEngProfile
+         */
+        void Release();
+
+        /**
+         * From MProEngProfile
+         */
+        const TArray<TContactItemId> AlertForL();
+
+        /**
+         * From MProEngProfile
+         */
+        TInt SetAlertForL( const TArray<TContactItemId>& aAlertFor );
+
+        /**
+         * From MProEngProfile
+         */
+        TBool IsSilent() const;
+
+        /**
+         * From MProEngProfile
+         */
+        MProEngProfileName& ProfileName() const;
+
+        /**
+         * From MProEngProfile
+         */
+        MProEngTones& ProfileTones() const;
+
+        /**
+         * From MProEngProfile
+         */
+        MProEngToneSettings& ToneSettings() const;
+
+        /**
+         * From MProEngProfile
+         */
+        void CommitChangeL();
+
+    private:
+
+        /**
+         * C++ constructor.
+         */
+        CProEngProfileImpl( CProEngEngineImpl& aProfileEngine,
+                            MProfileExtended* aProfile );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Ref: the Profiles Engine wrapper
+        CProEngEngineImpl& iProfileEngine;
+
+        // Own: the real implementation of the profile
+        MProfileExtended* iProfile;
+
+        // Own: profile name wrapper implementation
+        CProEngProfileNameImpl* iProfileName;
+
+        // Own: profile tones wrapper implementation
+        CProEngTonesImpl* iTones;
+
+        // Own: profile tone settings wrapper implementation
+        CProEngToneSettingsImpl* iToneSettings;
+    };
+
+#endif      //  CPROENGPROFILEIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayEventDelegate.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngProfileNameArrayEventDelegate.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngProfileNameArrayEventDelegate.h"
+#include    <MProEngProfileNameArrayObserver.h>
+
+namespace
+    {
+    // CONSTANTS
+    // Conjunction of KProEngProfileName (for any profile) and KProEngUsedIds
+    // (see the key values in ProfileEnginePrivateCRKeys.h). This is the
+    // partial key used in NotifyRequest() call made by the parent class.
+    const TUint32 KProEngPartialNameAndDynamicProfilesKey( 0x00000002 );
+    // This mask is used to filter out the key for KProEngActiveRingingType when
+    // requesting notifications of name modifications and profile creations and
+    // deletions. The 1's in mask means that the bits in those positions of the
+    // partial Central Repository key given in NotifyRequest() are significant.
+    const TUint32 KProEngNameAndDynamicProfilesKeyMask( 0x40FFFFFF );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayEventDelegate::CProEngProfileNameArrayEventDelegate
+// -----------------------------------------------------------------------------
+//
+CProEngProfileNameArrayEventDelegate::CProEngProfileNameArrayEventDelegate(
+        TUint32 aPartialCenRepKey,
+        TUint32 aKeyMask,
+        MProEngProfileNameArrayObserver& aObserver )
+    : CProEngCenRepObserverBase( aPartialCenRepKey, aKeyMask ),
+      iObserver( aObserver )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayEventDelegate::NewL
+// -----------------------------------------------------------------------------
+//
+CProEngProfileNameArrayEventDelegate* CProEngProfileNameArrayEventDelegate::NewL
+        ( MProEngProfileNameArrayObserver& aObserver )
+          
+    {
+    CProEngProfileNameArrayEventDelegate* self = new ( ELeave )
+        CProEngProfileNameArrayEventDelegate(
+                KProEngPartialNameAndDynamicProfilesKey,
+                KProEngNameAndDynamicProfilesKeyMask,
+                aObserver );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayEventDelegate::NotifyObserverL
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileNameArrayEventDelegate::NotifyObserverL()
+    {
+    iObserver.HandleProfileNameArrayModificationL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayEventDelegate::NotifyError
+// -----------------------------------------------------------------------------
+//
+void CProEngProfileNameArrayEventDelegate::NotifyError( TInt aError )
+    {
+    iObserver.HandleProfileNameArrayNotificationError( aError );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayEventDelegate.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class delegates notifications about name array
+*               changes to the observer.
+*
+*/
+
+
+
+#ifndef CPROENGPROFILENAMEARRAYEVENTDELEGATE_H
+#define CPROENGPROFILENAMEARRAYEVENTDELEGATE_H
+
+// INCLUDES
+#include "CProEngCenRepObserverBase.h"
+
+// FORWARD DECLARATIONS
+class MProEngProfileNameArrayObserver;
+
+// CLASS DECLARATION
+
+/**
+* This class delegates notifications about name array changes to the observer
+* implemented by the client of Profiles Engine Wrapper API. This is
+* a helper class for CProEngNotifyHandlerImpl.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngProfileNameArrayEventDelegate )
+    : public CProEngCenRepObserverBase
+    {
+    public:
+
+        static CProEngProfileNameArrayEventDelegate* NewL(
+                MProEngProfileNameArrayObserver& aObserver );
+
+        virtual ~CProEngProfileNameArrayEventDelegate() {};
+
+    public: // Functions from base classes
+
+        /**
+         * From CProEngObserverBase.
+         */
+        void NotifyObserverL();
+
+        /**
+         * From CProEngObserverBase.
+         */
+        void NotifyError( TInt aError );
+
+    private:  // constructor
+
+        CProEngProfileNameArrayEventDelegate(
+                TUint32 aPartialCenRepKey,
+                TUint32 aKeyMask,
+                MProEngProfileNameArrayObserver& aObserver );
+
+    private: // Data:
+
+        // The client implemented observer for name array modification events:
+        MProEngProfileNameArrayObserver& iObserver;
+
+    };
+
+#endif      //  CPROENGPROFILENAMEARRAYEVENTDELEGATE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngProfileNameArrayImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngProfileNameArrayImpl.h"
+#include    <MProfilesNamesArray.h>
+#include    <MProfileName.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayImpl::CProEngProfileNameArrayImpl
+// -----------------------------------------------------------------------------
+//
+CProEngProfileNameArrayImpl::CProEngProfileNameArrayImpl(
+        MProfilesNamesArray* aProfilesNamesArray )
+        : iProfilesNamesArray( aProfilesNamesArray )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngProfileNameArrayImpl* CProEngProfileNameArrayImpl::NewL(
+        MProfilesNamesArray* aProfilesNamesArray )
+    {
+    return new ( ELeave ) CProEngProfileNameArrayImpl( aProfilesNamesArray );
+    }
+
+// Destructor
+CProEngProfileNameArrayImpl::~CProEngProfileNameArrayImpl()
+    {
+    delete iProfilesNamesArray;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayImpl::MdcaCount
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileNameArrayImpl::MdcaCount() const
+    {
+    return iProfilesNamesArray->MdcaCount();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayImpl::MdcaPoint
+// -----------------------------------------------------------------------------
+//
+TPtrC CProEngProfileNameArrayImpl::MdcaPoint( TInt aIndex ) const
+    {
+    const MProfileName* profileName =
+        iProfilesNamesArray->ProfileName( aIndex );
+
+    if( profileName )
+        {
+        return profileName->Name();
+        }
+
+    return KNullDesC();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayImpl::ProfileId
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileNameArrayImpl::ProfileId( TInt aIndex ) const
+    {
+    const MProfileName* profileName =
+        iProfilesNamesArray->ProfileName( aIndex );
+
+    if( profileName )
+        {
+        return profileName->Id();
+        }
+
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayImpl::FindById
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileNameArrayImpl::FindById( TInt aId ) const
+    {
+    return iProfilesNamesArray->FindById( aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameArrayImpl::FindByName
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileNameArrayImpl::FindByName( const TDesC& aProfileName ) const
+    {
+    return iProfilesNamesArray->FindByName( aProfileName );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class implements MProEngProfileNameArray 
+*               interface.
+*
+*/
+
+
+
+#ifndef CPROENGPROFILENAMEARRAYIMPL_H
+#define CPROENGPROFILENAMEARRAYIMPL_H
+
+// INCLUDES
+#include <MProEngProfileNameArray.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileName;
+class MProfilesNamesArray;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngProfileNameArray interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngProfileNameArrayImpl )
+    : public CBase,
+      public MProEngProfileNameArray
+    {
+    public:  // Constructor and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aProfilesNamesArray the internal interface to the profile name
+        *        array. Ownership is transferred.
+        */
+        static CProEngProfileNameArrayImpl* NewL(
+                MProfilesNamesArray* aProfilesNamesArray );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngProfileNameArrayImpl();
+
+    public:
+
+        /**
+         * From MDesCArray
+         */
+        TInt MdcaCount() const;
+
+        /**
+         * From MDesCArray
+         */
+        TPtrC MdcaPoint( TInt aIndex ) const;
+
+        /**
+         * From MProEngProfileNameArray
+         */
+         TInt ProfileId( TInt aIndex ) const;
+
+        /**
+         * From MProEngProfileNameArray
+         */
+         TInt FindById( TInt aId ) const;
+
+        /**
+         * From MProEngProfileNameArray
+         */
+         TInt FindByName( const TDesC& aProfileName ) const;
+
+    private:
+
+        /**
+         * C++ default constructor.
+         */
+        CProEngProfileNameArrayImpl( MProfilesNamesArray* aProfilesNamesArray );
+
+    private:    // Data
+
+        // Own: the real implementation of the profile name array
+        MProfilesNamesArray* iProfilesNamesArray;
+
+    };
+
+#endif      //  CPROENGPROFILENAMEARRAYIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngProfileNameImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngProfileNameImpl.h"
+#include    <MProfileName.h>
+#include    <MProEngProfileNameArray.h>
+#include    "MProfileSetName.h"
+#include    "CProEngEngineImpl.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameImpl::CProEngProfileNameImpl
+// -----------------------------------------------------------------------------
+//
+CProEngProfileNameImpl::CProEngProfileNameImpl(
+        const MProfileName& aProfileName,
+        MProfileSetName& aProfileSetName,
+        CProEngEngineImpl& aEngine,
+        TBool aModifiable )
+    : iProfileName( aProfileName ), iProfileSetName( aProfileSetName ),
+      iEngine( aEngine), iModifiable( aModifiable )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngProfileNameImpl* CProEngProfileNameImpl::NewL(
+        const MProfileName& aProfileName,
+        MProfileSetName& aProfileSetName,
+        CProEngEngineImpl& aEngine,
+        TBool aModifiable )
+    {
+    return new ( ELeave ) CProEngProfileNameImpl(
+            aProfileName, aProfileSetName, aEngine, aModifiable );
+    }
+
+// Destructor
+CProEngProfileNameImpl::~CProEngProfileNameImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameImpl::Id
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileNameImpl::Id() const
+    {
+    return iProfileName.Id();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameImpl::Name
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProEngProfileNameImpl::Name() const
+    {
+    return iProfileName.Name();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameImpl::SetNameL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngProfileNameImpl::SetNameL( const TDesC& aName )
+    {
+    if( !iModifiable )
+        {
+        return KErrAccessDenied;
+        }
+
+    if( AlreadyExistsL( aName ) )
+        {
+        return KErrAlreadyExists;
+        }
+
+    iProfileSetName.SetNameL( aName );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngProfileNameImpl::AlreadyExistsL
+// -----------------------------------------------------------------------------
+//
+TBool CProEngProfileNameImpl::AlreadyExistsL( const TDesC& aName )
+    {
+    MProEngProfileNameArray* existingNames( iEngine.ProfileNameArrayLC() );
+    TInt result( existingNames->FindByName( aName ) );
+    TInt resId( existingNames->ProfileId( result ) );
+    CleanupStack::PopAndDestroy(); // existingNames
+
+    return ( ( result != KErrNotFound ) && ( resId != Id() ) );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class implements MProEngProfileName interface.
+*
+*/
+
+
+
+#ifndef CPROENGPROFILENAMEIMPL_H
+#define CPROENGPROFILENAMEIMPL_H
+
+// INCLUDES
+#include <MProEngProfileName.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MProfileName;
+class MProfileSetName;
+class CProEngEngineImpl;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngProfileName interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngProfileNameImpl ) : public CBase,
+                                              public MProEngProfileName
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngProfileNameImpl* NewL(
+                const MProfileName& aProfileName,
+                MProfileSetName& aProfileSetName,
+                CProEngEngineImpl& aEngine,
+                TBool aModifiable );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngProfileNameImpl();
+
+    public: // Functions from base classes
+
+        /**
+         * From MProEngProfileName
+         */
+        TInt Id() const;
+
+        /**
+         * From MProEngProfileName
+         */
+        const TDesC& Name() const;
+
+        /**
+         * From MProEngProfileName
+         */
+        TInt SetNameL( const TDesC& aName );
+
+    public: // New functions
+
+        /**
+         * Checks if the name to be given for the profiles is already used by
+         * another profile.
+         * @param aName the name to be set to profile.
+         * @return ETrue if there already is a profile with the given name.
+         * @since 3.1
+         */
+        TBool AlreadyExistsL( const TDesC& aName );
+
+    private:
+
+        /**
+         * C++ constructor.
+         */
+        CProEngProfileNameImpl(
+                const MProfileName& aProfileName,
+                MProfileSetName& aProfileSetName,
+                CProEngEngineImpl& aEngine,
+                TBool aModifiable );
+
+    private:    // Data
+
+        // the interface to the implementation of the profile name
+        const MProfileName& iProfileName;
+
+        // the interface to the implementation of the profile set name
+        MProfileSetName& iProfileSetName;
+
+        // Engine ref. needed for checking whether a profile name already exists
+        CProEngEngineImpl& iEngine;
+
+        // Is name modification allowed
+        TBool iModifiable;
+    };
+
+#endif      //  CPROENGPROFILENAMEIMPL_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngPubSubObserverBase.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngPubSubObserverBase.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngPubSubObserverBase.h"
+#include    "ProfileEnginePrivatePSKeys.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngPubSubObserverBase::CProEngPubSubObserverBase
+// -----------------------------------------------------------------------------
+//
+CProEngPubSubObserverBase::CProEngPubSubObserverBase( TUint32 aPubSubKey )
+    : CProEngObserverBase( aPubSubKey )
+    {
+    iAttatched = EFalse;
+    }
+
+// Destructor
+CProEngPubSubObserverBase::~CProEngPubSubObserverBase()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngPubSubObserverBase::RequestNotification
+// -----------------------------------------------------------------------------
+//
+TInt CProEngPubSubObserverBase::RequestNotification()
+    {
+    TInt err = KErrNone;
+    
+    if ( !iAttatched )
+        {
+        err = iProperty.Attach( KPSUidProfileEngine, iKey );
+        if ( err == KErrNone )
+            {
+            iAttatched = ETrue;
+            }
+        }
+
+    if( err == KErrNone )
+        {
+        iProperty.Subscribe( iStatus );
+        SetActive();
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngPubSubObserverBase::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CProEngPubSubObserverBase::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngPubSubObserverBase.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The base class for listening to events in the 
+*               Publish & Subscribe.
+*
+*/
+
+
+
+#ifndef CPROENGPUBSUBOBSERVERBASE_H
+#define CPROENGPUBSUBOBSERVERBASE_H
+
+// INCLUDES
+#include    "CProEngObserverBase.h"
+#include    <e32property.h>  // RProperty
+
+// CLASS DECLARATION
+
+/**
+* The base class for listening to events in the Publish & Subscribe. This is
+* a helper class for CProEngNotifyHandlerImpl.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngPubSubObserverBase ) : public CProEngObserverBase
+    {
+    protected:  // constructor and destructor
+
+        CProEngPubSubObserverBase( TUint32 aPubSubKey );
+
+        virtual ~CProEngPubSubObserverBase();
+
+    public: // Functions from base classes
+
+        /**
+         * From CProEngObserverBase.
+         */
+        TInt RequestNotification();
+
+        /**
+         * From CActive.
+         */
+        void DoCancel();
+
+    protected: // Data:
+
+        // Profiles Engine Publish and Subscribe interface
+        RProperty iProperty;
+        
+        TBool iAttatched;
+
+    };
+
+#endif      //  CPROENGPUBSUBOBSERVERBASE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,306 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CProEngToneHandler.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngToneHandler.h"
+#include    <bautils.h> // BaflUtils
+#include    <AknGlobalNote.h> // CAknGlobalNote
+#include    <barsread.h>  // TResourceReader
+#include    <barsc.h>  // RResourceFile
+#include    <e32const.h> // KKilo
+#include    "CProEngMediaVariation.h"
+#include 	<centralrepository.h>
+#include    <ProfileEngineDomainCRKeys.h> // KProEngRingingToneMaxSize
+#include    <ProfileEng.hrh>
+
+namespace
+	{
+	// CONSTANTS
+	_LIT( KProEngROMDriveLetter, "Z:" );
+	// The filename of the resource file
+	_LIT( KProEngResourceFileName, "Z:ProEngWrapper.RSC" );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CProEngToneHandler
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProEngToneHandler::CProEngToneHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::ConstructL()
+    {
+    DrmConstructL();
+    User::LeaveIfError( iFs.Connect() );
+    iMediaVariation = CProEngMediaVariation::NewL();
+    GetMaxToneFileSizeL( iToneFileSizeLimitKB );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngToneHandler* CProEngToneHandler::NewLC()
+    {
+    CProEngToneHandler* self = new( ELeave ) CProEngToneHandler();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngToneHandler* CProEngToneHandler::NewL()
+    {
+    CProEngToneHandler* self = CProEngToneHandler::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CProEngToneHandler::~CProEngToneHandler()
+    {
+    delete iMediaVariation;
+    iFs.Close();
+    ReleaseDrm();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CheckToneFileL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::CheckToneFileL( const TDesC& aFileName, TInt aToneType )
+    {
+    // Check the file which is tried to set as ringing or alert tone.
+    TInt returnValue( DoCheckToneFileL( aFileName, aToneType ) );
+    if( returnValue != KErrNone )
+        {
+        return returnValue;
+        }
+
+    if( IsProtected( aFileName ) && CanSetAutomated( aFileName ) )
+        {
+        // If the file in question is unactivated protected content,
+        // ask user if he/she wants to activate it.
+        if( AskAutomated( aFileName ) == KErrCancel )
+            {
+            // User doesn't want to activate unactivated protected content.
+            return KErrCancel;
+            }
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::HandleAutomatedContentL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::HandleAutomatedContent( TProfileSettingId aSettingId,
+                                                 const TDesC& aFileName,
+                                                 const TDesC& aOldFileName)
+
+    {
+    // Register file as automated content
+    TInt err( SetAutomated( aSettingId, aFileName ) );
+    if( !err )
+        {
+        // Remove the old tone from the automated content list
+        RemoveAutomated( aOldFileName );
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::DoCheckToneFileL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::DoCheckToneFileL( const TDesC& aFileName, TInt aToneType )
+    {
+    if( aFileName.Length() == 0 )
+        {
+        // The filename is empty, ok.
+        // It will be changed to "No_sound.wav" when writing to Profiles Engine.
+        return KErrNone;
+        }
+
+    if( !BaflUtils::FileExists( iFs, aFileName ) )
+        {
+        // The file does not exist. No good (start the dance).
+        return KErrNotFound;
+        }
+
+    // The file exists. Check its data (MIME) type.
+    TBuf< KMaxDataTypeLength > dataType;
+    iMediaVariation->GetDataTypeL( aFileName, dataType );
+
+    if( !iMediaVariation->IsSupported( dataType ) )
+        {
+        return KErrNotSupported;
+        }
+
+
+    // File size check for ringing tones 1&2
+    if (aToneType == EProfileSettingIdRingingTone  ||
+        aToneType == EProfileSettingIdRingingTone2)
+        {
+        if (KErrNone != CheckFileSizeLimit( aFileName ))
+            {
+            return KErrTooBig;
+            }
+        }
+
+    // The file is a sound file. Can it be found on ROM
+    if( aFileName.Left( KProEngROMDriveLetter().Length() ).
+        CompareF( KProEngROMDriveLetter ) == 0 )
+        {
+        // Tone files on ROM are always valid
+        return KErrNone;
+        }
+
+    TInt result( KErrNone );
+    if( IsProtected( aFileName ) )
+        {
+        if( !iMediaVariation->IsAllowedProtected( dataType ) )
+            {
+            return KErrArgument;
+            }
+
+        result = CheckProtectedFileL( aFileName );
+
+        }
+    else if( !iMediaVariation->IsAllowedUnProtected( dataType ) )
+        {
+        result = KErrPermissionDenied;
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::ShowErrorNoteL
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::ShowErrorNoteL( TInt aResourceId )
+    {
+	TParse* fp = new(ELeave) TParse();
+	fp->Set(KProEngResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL);
+	TFileName localizedFileName( fp->FullName() );
+	delete fp;
+
+    BaflUtils::NearestLanguageFile( iFs, localizedFileName );
+
+    RResourceFile resourceFile;
+    resourceFile.OpenL( iFs, localizedFileName );
+    CleanupClosePushL( resourceFile );
+    resourceFile.ConfirmSignatureL();
+
+    HBufC8* resBuf = resourceFile.AllocReadLC( aResourceId );
+    TResourceReader reader;
+    reader.SetBuffer( resBuf );
+    TPtrC errorText( reader.ReadTPtrC() );
+
+    CAknGlobalNote* note = CAknGlobalNote::NewLC();
+    note->ShowNoteL( EAknGlobalInformationNote, errorText );
+
+	CleanupStack::PopAndDestroy( 3, &resourceFile );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CheckFileSizeLimitL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::CheckFileSizeLimit( const TDesC& aFileName ) const
+    {
+    TInt error = KErrNone;
+
+    if ( iToneFileSizeLimitKB )
+        {
+        if ( CheckToneFileSize( aFileName, iToneFileSizeLimitKB ) != KErrNone )
+            {
+            error = KErrTooBig;
+            }
+        }
+
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::GetMaxToneFileSizeL
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::GetMaxToneFileSizeL( TInt& aMaxSizeKB ) const
+    {
+	CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+	TInt error = cenrep->Get( KProEngRingingToneMaxSize, aMaxSizeKB );
+    delete cenrep;
+
+	if ( error != KErrNone )
+    	{
+        aMaxSizeKB = 0;
+    	}
+	if ( aMaxSizeKB < 0 )
+	    {
+	     aMaxSizeKB = 0;
+	    }
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CheckToneFileSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::CheckToneFileSize( const TDesC& aFile,
+                                            TInt aSizeLimitKB ) const
+    {
+    // Get file size
+    TInt size = 0;
+    TInt error = KErrNone;
+
+    TEntry entry;
+    error = iFs.Entry( aFile, entry );
+    if ( !error )
+        {
+        size = entry.iSize;
+        }
+
+    // Check
+    aSizeLimitKB *= KKilo;
+    if ( aSizeLimitKB  &&  size > aSizeLimitKB )
+        {
+        error = KErrTooBig;
+        }
+
+    return error;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,253 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A helper class for making correctness and DRM checkups to the
+*                tones to be used as alert tones.
+*
+*/
+
+
+
+#ifndef CPROENGTONEHANDLER_H
+#define CPROENGTONEHANDLER_H
+
+//  INCLUDES
+#include <f32file.h> // CBase, RFs
+#include <apmstd.h> // KMaxDataTypeLength
+#include <data_caging_path_literals.hrh>
+#include "ProfileEng.hrh" // TProfileSettingId
+
+// FORWARD DECLARATIONS
+class DRMCommon;
+class CDRMHelper;
+class CProEngMediaVariation;
+
+// CLASS DECLARATION
+
+/**
+*  A helper class for making correctness and DRM checkups to the
+*  tones to be used as alert tones.
+*  Registers DRM protected tones as automated content
+*  and removes old content from automated content list.
+*  Shows a content activation query and other DRM related
+*  notes if necessary.
+
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+NONSHARABLE_CLASS( CProEngToneHandler ) : public CBase
+    {
+    public:  // Constructors and destructor
+
+        // Two-phased constructors.
+        static CProEngToneHandler* NewL();
+        static CProEngToneHandler* NewLC();
+
+        // Destructor.
+        ~CProEngToneHandler();
+
+    public: // New functions
+
+        /**
+         * Checks that the given tone file exists and that it is
+         * a legal file to be used as a ringing or alert tone.
+         * @since 3.1
+         * @param aFileName Full path and filename of the file to be checked.
+         * @param aToneType Type of tone to check, see: ProfileEng.hrh
+         * @return KErrNone if the file can be used as a ringing or alert tone,
+         *         KErrNotFound if the file cannot be found,
+         *         KErrNotSupported if a file is of an unsupported type or
+         *         KErrPermissionDenied if the file is not allowed
+         *         to be used as a ringing or alert tone.
+         *         KErrGeneral if DRM rights are insufficient.
+		 *		   KErrArgument if the file is DRM protected
+		 *		   audio/mp4 and those are not allowed as ringingtones.
+		 *         KErrTooBig if file size exceeded file size limit.
+         */
+        TInt CheckToneFileL( const TDesC& aFileName, TInt aToneType );
+
+        /**
+         * Adds the file to automated content list and removes the old file
+         * from automated content list.
+         * Called by CProEngProfileImpl::CommitChangeL after the changes has
+         * been committed in the underlying Profiles Engine.
+         * @since 3.1
+         * @param aSettingId setting id which identifies which tone (ringing
+         *                   tone, sms tone etc.) this automated content
+         *                   handling operation concerns.
+         * @param aFileName Full path and filename of the tone to be used
+         *                  as the new ringing or alert tone.
+         * @param aOldFileName Full path and filename of the previous tone used
+         *                  as the ringing or alert tone.
+         * @return KErrNone, if succesful, otherwise a system-wide error code.
+         */
+        TInt HandleAutomatedContent( TProfileSettingId aSettingId,
+                                     const TDesC& aFileName,
+                                     const TDesC& aOldFileName);
+
+    protected:  // New functions
+
+        /**
+         * Helper function for CheckToneFileL. This function does most of the
+         * actual checking.
+         * @since 3.1
+         * @param aFileName Full path and filename of the file to be checked.
+         * @param aToneType Type of tone to check, see: ProfileEng.hrh
+         * @return KErrNone if the file can be used as a ringing or alert tone,
+         *         KErrNotFound if the file cannot be found,
+         *         KErrNotSupported if a file is of an unsupported type or
+         *         KErrPermissionDenied if the file is not allowed
+         *         to be used as a ringing or alert tone.
+         *         KErrGeneral if DRM rights are insufficient.
+		 *		   KErrArgument if the file is DRM protected
+		 *		   audio/mp4 and those are not allowed as ringingtones.
+		 *         KErrTooBig if file size exceeded file size limit.
+         */
+        TInt DoCheckToneFileL( const TDesC& aFileName, TInt aToneType );
+
+        /**
+         * Checks if a DRM protected file can be used as a ringing or alert tone.
+         * @since 3.1
+         * @param aFileName Full path and filename of the file to be checked.
+         * @return KErrNone if the file can be used as a ringing or alert tone or
+         *         KErrGeneral if DRM rights are insufficient.
+         */
+        TInt CheckProtectedFileL( const TDesC& aFileName );
+
+        /**
+         * Tells whether a file can be registered as automated content or not.
+         * If DRM is not supported, returns always EFalse.
+         * @since 3.1
+         * @param aFileName File to be registered as automated content.
+         * @return Returns ETrue if aFileName can be set as automated content.
+         *         Returns EFalse if can't or DRM is not supported.
+         */
+        TBool CanSetAutomated( const TDesC& aFileName );
+
+        /**
+         * Asks user if he/she wants to activate unactivated content.
+         * Shows a query. Does nothing if DRM is not supported.
+         * @since 3.1
+         * @param aFileName File to be registered as automated content.
+         * @return Returns KErrCancel if user cancels the query.
+         */
+        TInt AskAutomated( const TDesC& aFileName );
+
+        /**
+         * Registers a file to automated content list without any queries.
+         * Errors are omitted. Does nothing if DRM is not supported.
+         * @since 3.1
+         * @param aSettingId setting id which identifies which tone (ringing
+         *                   tone, sms tone etc.) this automated content
+         *                   setting operation concerns.
+         * @param aFileName File to be registered as automated content.
+         * @return KErrNone, if succesful, otherwise a system-wide error code.
+         */
+        TInt SetAutomated( TProfileSettingId aSettingId,
+                           const TDesC& aFileName );
+
+        /**
+         * Removes a file from automated content list.
+         * Errors are omitted. Does nothing if DRM is not supported.
+         * @since 3.1
+         * @param aFileName File to be removed from automated content list.
+         */
+        void RemoveAutomated( const TDesC& aFileName );
+
+        /**
+         * Returns whether a file is protected content or not.
+         * Returns always EFalse if DRM is not supported.
+         * @since 3.1
+         * @param aFileName The file name.
+         * @return Returns whether the file is protected content or not.
+         */
+        TBool IsProtected( const TDesC& aFileName ) const;
+
+        /**
+         * Returns whether a file is protected content or not.
+         * Returns always EFalse if DRM is not supported.
+         * @since 3.1
+         * @param aFileName The file name.
+         * @return Returns whether the file is protected content or not.
+         */
+        TBool IsProtectedL( const TDesC& aFileName ) const;
+
+		/**
+         * Displays an error note.
+         * @since 3.1
+         * @param aResourceId Resource ID to a TBUF resource.
+         */
+        void ShowErrorNoteL( TInt aResourceId );
+
+        /**
+         * Checks if tone file's size is larger than the size limit.
+         * @since 3.1
+         * @param aFileName The path to the file.
+         * @return KErrNone   if the file can be used as a ringing tone.
+         *         KErrTooBig if the file size limit is exceeded.
+         */
+        TInt CheckFileSizeLimit( const TDesC& aFileName ) const;
+        /**
+         * Checks if tone file's size is larger than the size limit.
+         * @since 3.1
+         * @return KErrNone   if the file can be used as a ringing tone.
+         *         KErrTooBig if the file size limit is exceeded.
+         */
+        TInt CheckToneFileSize( const TDesC& aFile, TInt aSizeLimitKB ) const;
+        /**
+         * Reads tone file size limit from cenrep.
+         * @since 3.1
+         * @return leaves on error
+         */
+        void GetMaxToneFileSizeL( TInt& aMaxSizeKB ) const;
+
+    private:
+
+        /// Default constructor
+        CProEngToneHandler();
+
+        /// 2nd phase constructor
+        void ConstructL();
+
+        /// Constructor for the DRM objects
+        void DrmConstructL();
+
+        /// Destructor for the DRM objects
+        void ReleaseDrm();
+
+        /// Called by SetAutomated
+        TInt SetAutomatedL( TProfileSettingId aSettingId,
+                           const TDesC& aFileName );
+
+    private:    // Data
+
+        /// Owns: DRM Helper client.
+        CDRMHelper* iDrmHelper;
+
+        /// Owns: DRM Common client
+        DRMCommon* iDrmCommon;
+
+        /// File Server client.
+        RFs iFs;
+
+        /// Mime-type handling:
+        CProEngMediaVariation* iMediaVariation;
+
+        /// voice call file size limit
+        TInt iToneFileSizeLimitKB;
+    };
+
+#endif      // CPROENGTONEHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandlerDrmEmpty.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CProEngToneHandler.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngToneHandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::DrmConstructL
+// 2nd phase construct for DRM objects. Empty implementation.
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::DrmConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::ReleaseDrm
+// Destructor for DRM objects. Empty implementation.
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::ReleaseDrm()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CheckProtectedFileL
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::CheckProtectedFileL( const TDesC& /*aFileName*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CanSetAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneHandler::CanSetAutomated( const TDesC& /*aFileName*/ )
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::AskAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::AskAutomated( const TDesC& /*aFileName*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::SetAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::SetAutomated( TProfileSettingId /* aSettingId */,
+                                       const TDesC& /*aFileName*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::RemoveAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::RemoveAutomated( const TDesC& /*aFileName*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::IsProtected
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneHandler::IsProtected( const TDesC& /*aFileName*/ ) const
+    {
+    return EFalse;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandlerDrmFull.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,301 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the CProEngToneHandler.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngToneHandler.h"
+
+#include    <DRMHelper.h>
+#include    <DRMCommon.h>
+#include    <ProEngWrapper.rsg>
+
+#include <caf/caf.h>
+
+
+// ============================ LOCAL FUNCTIONS ================================
+
+CDRMHelper::TDRMHelperAutomatedType SettingIdToAutomatedType( TProfileSettingId aSettingId )
+    {
+    switch( aSettingId )
+        {
+        case EProfileSettingIdRingingTone:
+        case EProfileSettingIdRingingTone2:
+            {
+            return CDRMHelper::EAutomatedTypeRingingTone;
+            }
+        case EProfileSettingIdMsgTone:
+            {
+            return CDRMHelper::EAutomatedTypeMessageAlert;
+            }
+        case EProfileSettingIdEmailTone:
+            {
+            return CDRMHelper::EAutomatedTypeEmailAlert;
+            }
+        default:
+            {
+            return CDRMHelper::EAutomatedTypeOther;
+            }
+        }
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::DrmConstructL
+// 2nd phase construct for DRM objects
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::DrmConstructL()
+    {
+    iDrmCommon = DRMCommon::NewL();
+    iDrmHelper = CDRMHelper::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::ReleaseDrm
+// Destructor for DRM objects
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::ReleaseDrm()
+    {
+    delete iDrmHelper;
+    iDrmHelper = NULL;
+    delete iDrmCommon;
+    iDrmCommon = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CheckProtectedFileL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::CheckProtectedFileL( const TDesC& aFileName )
+    {
+    DRMCommon::TContentProtection protection;
+    HBufC8* mimeType = NULL; // ignored
+    HBufC8* contentUri = NULL;
+    TUint dataLength; // ignored
+    TInt err = iDrmCommon->GetFileInfo( aFileName, protection, mimeType,
+                                        contentUri, dataLength );
+    delete mimeType;
+    if( err )
+        {
+        delete contentUri;
+        User::Leave( err );
+        }
+    CleanupStack::PushL( contentUri );
+
+    TInt result( KErrGeneral );
+    CDRMRights* rights = NULL;
+    err = iDrmCommon->GetActiveRights( *contentUri, DRMCommon::EPlay, rights );
+
+    CleanupStack::PopAndDestroy( contentUri );
+
+    if( rights == NULL )
+        {
+        if( err == DRMCommon::ENoRights )
+            {
+            // Handle "No rights" situation here
+            iDrmHelper->HandleErrorL( DRMCommon::ENoRights, aFileName );
+            return result;
+            }
+        else
+            {
+            User::Leave( KErrGeneral );
+            }
+        }
+
+    CleanupStack::PushL( rights );
+    
+	switch ( err )
+		{
+		case CDRMRights::EFullRights: // Fall through
+		case CDRMRights::ERestrictedRights:
+			{
+			CDRMRights::TRestriction restriction; // ignore
+			CDRMRights::TExpiration expiration;
+			TUint32 constType;
+			
+			rights->GetRightsInfo( DRMCommon::EPlay, restriction, // ignore return
+                                   expiration, constType );       // value
+		
+            // This is CFM protected file, ringingtone is set to "no"
+            if ( ( rights->GetPermission().iInfoBits & ENoRingingTone )
+                // This is normal DRM protected count-based tone
+                || ( constType & CDRMRights::ECountBased ) )
+                    {
+                    ShowErrorNoteL( R_PROENG_TEXT_DRM_PREV_RIGHTS_SET );
+                    }		
+                else
+                    {
+                    switch ( expiration )
+                        {
+                        case CDRMRights::EValidRights:
+                            {
+                            result = KErrNone;
+                            break;
+                            }
+
+                        case CDRMRights::EFutureRights:
+                            {
+                            iDrmHelper->HandleErrorL( DRMCommon::ENoRights,
+                                                      aFileName );
+                            break;
+                            }
+
+                        case CDRMRights::EExpiredRights: 
+                            {
+                            iDrmHelper->HandleErrorL( DRMCommon::ERightsExpired,
+                                                      aFileName );
+                            break;
+                            }
+
+                        default:
+                            {
+                            break;
+                            }
+                        }	
+
+                    }
+				
+
+			break;
+			}
+
+		case CDRMRights::EPreviewRights:
+			{
+			ShowErrorNoteL( R_PROENG_TEXT_DRM_PREV_RIGHTS_SET );
+			break;
+			}
+
+		case DRMCommon::ENoRights:
+			{
+			iDrmHelper->HandleErrorL( DRMCommon::ENoRights, aFileName );
+			break;
+			}
+
+		default:
+			{
+			break;
+			}
+
+		}
+   
+    CleanupStack::PopAndDestroy( rights );
+
+	return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::CanSetAutomated
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneHandler::CanSetAutomated( const TDesC& aFileName )
+    {
+    TBool canSetAutomated( EFalse );
+    return
+        ( iDrmHelper->CanSetAutomated( aFileName, canSetAutomated ) == KErrNone
+        && canSetAutomated );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::AskAutomated
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::AskAutomated( const TDesC& aFileName )
+    {
+    return iDrmHelper->ShowAutomatedNote( aFileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::SetAutomated
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::SetAutomated( TProfileSettingId aSettingId,
+                                       const TDesC& aFileName )
+    {
+    TInt err = KErrNone;
+
+    TRAP_IGNORE( err = SetAutomatedL( aSettingId, aFileName ) );
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::SetAutomatedL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneHandler::SetAutomatedL( TProfileSettingId aSettingId,
+                                       const TDesC& aFileName )
+    {
+    iDrmHelper->SetAutomatedType( SettingIdToAutomatedType( aSettingId ) );
+    TInt err( iDrmHelper->SetAutomatedSilent( aFileName, EFalse ) );
+    if( err == KErrNone )
+        {
+        using namespace ContentAccess;
+       	TVirtualPathPtr path( aFileName, KDefaultContentObject );
+        CData* data = CData::NewLC( path, EContentShareReadWrite );
+        err = data->ExecuteIntent( EPlay );
+        CleanupStack::PopAndDestroy( data );
+        // According to Risto Vilkman from DRM, KErrAccessDenied
+        // can be ignored at this point, since if
+        // CanSetAutomated says the tone is OK, it's OK.
+        if( err == KErrAccessDenied )
+        	{
+        	err = KErrNone;
+        	}
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::RemoveAutomated
+// -----------------------------------------------------------------------------
+//
+void CProEngToneHandler::RemoveAutomated( const TDesC& aFileName )
+    {
+    iDrmHelper->RemoveAutomatedPassive( aFileName ); // ignore return value
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::IsProtected
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneHandler::IsProtected( const TDesC& aFileName ) const
+    {
+    TBool result = EFalse;
+    TRAP_IGNORE( result = IsProtectedL( aFileName ) );
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneHandler::IsProtectedL
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneHandler::IsProtectedL( const TDesC& aFileName ) const
+    {
+    TInt isProtected( EFalse );
+   	ContentAccess::TVirtualPathPtr path( aFileName,
+   						ContentAccess::KDefaultContentObject );
+   	CData* data = CData::NewLC( path, EContentShareReadWrite );
+   	TInt result = data->GetAttribute( EIsProtected, isProtected );
+   	CleanupStack::PopAndDestroy(); // data
+
+    return( ( result == DRMCommon::EOk ) && isProtected );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CProEngToneSettingsImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngToneSettingsImpl.h"
+#include    <MProfileTones.h>
+#include    <MProfileExtraTones.h>
+#include    "MProfileSetTones.h"
+#include    "MProfileSetExtraTones.h"
+#include    "MProfileExtended.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::CProEngToneSettingsImpl
+// -----------------------------------------------------------------------------
+//
+CProEngToneSettingsImpl::CProEngToneSettingsImpl(
+        TProfileToneSettings& aToneSettings,
+        TUint32 aModifiableFlags )
+    : iToneSettings( aToneSettings ), iModifiableFlags( aModifiableFlags )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngToneSettingsImpl* CProEngToneSettingsImpl::NewL(
+        TProfileToneSettings& aToneSettings,
+        TUint32 aModifiableFlags )
+    {
+    return new ( ELeave ) CProEngToneSettingsImpl(
+            aToneSettings, aModifiableFlags );
+    }
+
+// Destructor
+CProEngToneSettingsImpl::~CProEngToneSettingsImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::RingingType
+// -----------------------------------------------------------------------------
+//
+TProfileRingingType CProEngToneSettingsImpl::RingingType() const
+    {
+    return iToneSettings.iRingingType;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::KeypadVolume
+// -----------------------------------------------------------------------------
+//
+TProfileKeypadVolume CProEngToneSettingsImpl::KeypadVolume() const
+    {
+    return iToneSettings.iKeypadVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TProfileRingingVolume CProEngToneSettingsImpl::RingingVolume() const
+    {
+    TProfileRingingVolume volume =
+        TProfileRingingVolume( iToneSettings.iRingingVolume );
+    return volume;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneSettingsImpl::VibratingAlert() const
+    {
+    return iToneSettings.iVibratingAlert;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneSettingsImpl::WarningAndGameTones() const
+    {
+    return iToneSettings.iWarningAndGameTones;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TBool CProEngToneSettingsImpl::TextToSpeech() const
+    {
+    return iToneSettings.iTextToSpeech;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneSettingsImpl::SetRingingType( TProfileRingingType aRingingType )
+    {
+    if( iModifiableFlags & EProfileFlagRingingType )
+        {
+        iToneSettings.iRingingType = aRingingType;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneSettingsImpl::SetKeypadVolume(
+        TProfileKeypadVolume aKeypadVolume )
+    {
+    if( iModifiableFlags & EProfileFlagKeypadVolume )
+        {
+        iToneSettings.iKeypadVolume = aKeypadVolume;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneSettingsImpl::SetRingingVolume(
+        TProfileRingingVolume aRingingVolume )
+    {
+    if( iModifiableFlags & EProfileFlagRingingVolume )
+        {
+        iToneSettings.iRingingVolume = aRingingVolume;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneSettingsImpl::SetVibratingAlert( TBool aVibratingAlert )
+    {
+    if( iModifiableFlags & EProfileFlagVibratingAlert )
+        {
+        iToneSettings.iVibratingAlert = aVibratingAlert;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneSettingsImpl::SetWarningAndGameTones( TBool aWarningAndGameTones )
+    {
+    if( iModifiableFlags & EProfileFlagWarningTones )
+        {
+        iToneSettings.iWarningAndGameTones = aWarningAndGameTones;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngToneSettingsImpl::
+// -----------------------------------------------------------------------------
+//
+TInt CProEngToneSettingsImpl::SetTextToSpeech( TBool aTextToSpeech )
+    {
+    if( iModifiableFlags & EProfileFlagTextToSpeechTone )
+        {
+        iToneSettings.iTextToSpeech = aTextToSpeech;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class implements MProEngToneSettings interface.
+*
+*/
+
+
+
+#ifndef CPROENGTONESETTINGSIMPL_H
+#define CPROENGTONESETTINGSIMPL_H
+
+// INCLUDES
+#include <MProEngToneSettings.h>
+#include <e32base.h>
+#include <TProfileToneSettings.h>
+
+// FORWARD DECLARATIONS
+class MProfileTones;
+class MProfileSetTones;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngToneSettings interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngToneSettingsImpl ) : public CBase,
+                                               public MProEngToneSettings
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngToneSettingsImpl* NewL(
+                TProfileToneSettings& aToneSettings,
+                TUint32 aModifiableFlags );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngToneSettingsImpl();
+
+    public:
+
+        /**
+         * From MProEngToneSettings
+         */
+        TProfileRingingType RingingType() const;
+
+        /**
+        * Returns the keypad volume.
+        * @since 3.1
+        * @return Returns the keypad volume.
+        */
+        TProfileKeypadVolume KeypadVolume() const;
+
+        /**
+        * Returns the ringing volume.
+        * @since 3.1
+        * @return Returns the ringing volume.
+        */
+        TProfileRingingVolume RingingVolume() const;
+
+        /**
+        * Returns the state of vibrating alert setting.
+        * @since 3.1
+        * @return Returns the state of vibrating alert setting.
+        */
+        TBool VibratingAlert() const;
+
+        /**
+        * Returns the state of warning and game tones setting.
+        * @since 3.1
+        * @return Returns the state of warning and game tones setting.
+        */
+        TBool WarningAndGameTones() const;
+
+        /**
+        * Returns the state of text-to-speech setting.
+        * @since 3.1
+        * @return Returns the state of text-to-speech setting.
+        */
+        TBool TextToSpeech() const;
+
+        /**
+        * Sets the ringing type.
+        * @since 3.1
+        * @param aRingingType The new value for ringing type.
+        * @return KErrNone if succesful, KErrAccessDenied if ringing type
+        *         setting of this profile is read-only.
+        */
+        TInt SetRingingType( TProfileRingingType aRingingType );
+
+        /**
+        * Sets the keypad volume.
+        * @since 3.1
+        * @param aKeypadVolume The new value for keypad tones volume.
+        * @return KErrNone if succesful, KErrAccessDenied if keypad tones
+        *         setting of this profile is read-only.
+        */
+        TInt SetKeypadVolume( TProfileKeypadVolume aKeypadVolume );
+
+        /**
+        * Sets the ringing volume.
+        * @since 3.1
+        * @param aRingingVolume The new value for ringing volume.
+        * @return KErrNone if succesful, KErrAccessDenied if ringing volume
+        *         setting of this profile is read-only.
+        */
+        TInt SetRingingVolume(
+                TProfileRingingVolume aRingingVolume );
+
+        /**
+        * Sets the state of vibrating alert setting.
+        * @since 3.1
+        * @param aVibratingAlert The new state for the vibrating alert setting.
+        * @return KErrNone if succesful, KErrAccessDenied if vibrating alert
+        *         setting of this profile is read-only.
+        */
+        TInt SetVibratingAlert( TBool aVibratingAlert );
+
+        /**
+        * Sets the state of warning and game tones setting.
+        * @since 3.1
+        * @param aWarningAndGameTones The new state for Warning and Game tones
+        * setting.
+        * @return KErrNone if succesful, KErrAccessDenied if warning and game
+        *         tones setting of this profile is read-only.
+        */
+        TInt SetWarningAndGameTones( TBool aWarningAndGameTones );
+
+        /**
+        * Sets the state of text-to-speech setting.
+        * @since 3.1
+        * @param aTextToSpeech The new state for text-to-speech setting.
+        * @return KErrNone if succesful, KErrAccessDenied if text-to-speech
+        *         setting of this profile is read-only.
+        */
+        TInt SetTextToSpeech( TBool aTextToSpeech );
+
+
+    private:
+
+        /**
+         * C++ default constructor.
+         */
+        CProEngToneSettingsImpl(
+                TProfileToneSettings& aToneSettings,
+                TUint32 aModifiableFlags );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // The real implementation of the profile tone settings
+        TProfileToneSettings& iToneSettings;
+
+        // Flags to check is modification allowed:
+        TUint32 iModifiableFlags;
+    };
+
+#endif      //  CPROENGTONESETTINGSIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,353 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CProEngTonesImpl.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProEngTonesImpl.h"
+#include    <MProfileTones.h>
+#include    <MProfileExtraTones.h>
+#include    "MProfileSetTones.h"
+#include    "MProfileSetExtraTones.h"
+#include    "MProfileExtended.h"
+#include    "CProEngToneHandler.h"
+#include    "ProfileEng.hrh" // TProfileSettingId
+#include    <pathinfo.h>
+#include    <ProfileEngineDomainConstants.h>
+
+namespace
+    {
+    // CONSTANTS
+    // This flag is only used internally by this class (actually 0x0002 is
+    // defined in MProfileExtended.h as EProfileFlagRingingType) for indicating
+    // whether ringing tone 2 has been modified or not:
+    const TInt KProEngFlagRingingTone2 = 0x0002;
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::CProEngTonesImpl
+// -----------------------------------------------------------------------------
+//
+CProEngTonesImpl::CProEngTonesImpl(
+        const MProfileTones& aProfileTones,
+        MProfileSetTones& aProfileSetTones,
+        const MProfileExtraTones& aProfileExtraTones,
+        MProfileSetExtraTones& aProfileSetExtraTones,
+        TUint32 aModifiableFlags )
+    : iProfileTones( aProfileTones ), iProfileSetTones( aProfileSetTones ),
+      iProfileExtraTones( aProfileExtraTones ),
+      iProfileSetExtraTones( aProfileSetExtraTones ),
+      iModifiableFlags( aModifiableFlags ),
+      iNullTone( KNullDesC )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProEngTonesImpl::ConstructL()
+    {
+    // Read the file to be used when KNullDesC is set as an alert tone:
+    RBuf toneBuf;
+    toneBuf.CreateL( KMaxFileName );
+    CleanupClosePushL( toneBuf );
+    toneBuf.Copy( TParsePtrC( PathInfo::RomRootPath() ).Drive() );
+    toneBuf.Append( KProfileNoSoundPath );
+
+    iEmptyTone = toneBuf.AllocL();
+    CleanupStack::PopAndDestroy(); // toneBuf
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProEngTonesImpl* CProEngTonesImpl::NewL(
+        const MProfileTones& aProfileTones,
+        MProfileSetTones& aProfileSetTones,
+        const MProfileExtraTones& aProfileExtraTones,
+        MProfileSetExtraTones& aProfileSetExtraTones,
+        TUint32 aModifiableFlags )
+    {
+    CProEngTonesImpl* self = new ( ELeave ) CProEngTonesImpl(
+            aProfileTones, aProfileSetTones, aProfileExtraTones,
+            aProfileSetExtraTones, aModifiableFlags );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// Destructor
+CProEngTonesImpl::~CProEngTonesImpl()
+    {
+    delete iEmptyTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::RingingTone1
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProEngTonesImpl::RingingTone1() const
+    {
+    return iProfileTones.RingingTone1();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::RingingTone2
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProEngTonesImpl::RingingTone2() const
+    {
+    return iProfileTones.RingingTone2();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::MessageAlertTone
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProEngTonesImpl::MessageAlertTone() const
+    {
+    return iProfileTones.MessageAlertTone();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::EmailAlertTone
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProEngTonesImpl::EmailAlertTone() const
+    {
+    return iProfileExtraTones.EmailAlertTone();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::VideoCallRingingTone
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProEngTonesImpl::VideoCallRingingTone() const
+    {
+    return iProfileExtraTones.VideoCallRingingTone();
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::SetRingingTone1L
+// -----------------------------------------------------------------------------
+//
+TInt CProEngTonesImpl::SetRingingTone1L( const TDesC& aRingingTone )
+    {
+    if( iModifiableFlags & EProfileFlagRingingTone )
+        {
+        TPtrC tonePtr( ConvertKNullToEmptyTone( aRingingTone ) );
+        iProfileSetTones.SetRingingTone1L( tonePtr );
+        iModifiedFlags |= EProfileFlagRingingTone;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::SetRingingTone2L
+// -----------------------------------------------------------------------------
+//
+TInt CProEngTonesImpl::SetRingingTone2L( const TDesC& aRingingTone )
+    {
+    if( iModifiableFlags & EProfileFlagRingingTone )
+        {
+        TPtrC tonePtr( ConvertKNullToEmptyTone( aRingingTone ) );
+        iProfileSetTones.SetRingingTone2L( tonePtr );
+        iModifiedFlags |= KProEngFlagRingingTone2;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::SetMessageAlertToneL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngTonesImpl::SetMessageAlertToneL( const TDesC& aMessageAlertTone )
+    {
+    if( iModifiableFlags & EProfileFlagMessageAlertTone )
+        {
+        TPtrC tonePtr( ConvertKNullToEmptyTone( aMessageAlertTone ) );
+        iProfileSetTones.SetMessageAlertToneL( tonePtr );
+        iModifiedFlags |= EProfileFlagMessageAlertTone;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::SetEmailAlertToneL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngTonesImpl::SetEmailAlertToneL( const TDesC& aEmailAlertTone )
+    {
+    if( iModifiableFlags & EProfileFlagEmailAlertTone )
+        {
+        TPtrC tonePtr( ConvertKNullToEmptyTone( aEmailAlertTone ) );
+        iProfileSetExtraTones.SetEmailAlertToneL( tonePtr );
+        iModifiedFlags |= EProfileFlagEmailAlertTone;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::SetVideoCallRingingToneL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngTonesImpl::SetVideoCallRingingToneL( const TDesC& aRingingTone )
+    {
+    if( iModifiableFlags & EProfileFlagVideoCallRingingTone )
+        {
+        TPtrC tonePtr( ConvertKNullToEmptyTone( aRingingTone ) );
+        iProfileSetExtraTones.SetVideoCallRingingToneL( tonePtr );
+        iModifiedFlags |= EProfileFlagVideoCallRingingTone;
+        return KErrNone;
+        }
+    return KErrAccessDenied;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::CheckTonesL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngTonesImpl::CheckTonesL( CProEngToneHandler& aToneHandler )
+    {
+    TInt result( KErrNone );
+    if( iModifiedFlags & EProfileFlagRingingTone )
+        {
+        result = aToneHandler.CheckToneFileL( iProfileTones.RingingTone1(), 
+            EProfileSettingIdRingingTone );
+        if( result != KErrNone )
+            {
+            return result;
+            }
+        }
+    if( iModifiedFlags & KProEngFlagRingingTone2 )
+        {
+        result = aToneHandler.CheckToneFileL( iProfileTones.RingingTone2(),
+            EProfileSettingIdRingingTone2 );
+        if( result != KErrNone )
+            {
+            return result;
+            }
+        }
+    if( iModifiedFlags & EProfileFlagMessageAlertTone )
+        {
+        result = aToneHandler.CheckToneFileL(
+                iProfileTones.MessageAlertTone(),
+            EProfileSettingIdMsgTone );
+        if( result != KErrNone )
+            {
+            return result;
+            }
+        }
+    if( iModifiedFlags & EProfileFlagEmailAlertTone )
+        {
+        result = aToneHandler.CheckToneFileL(
+                iProfileExtraTones.EmailAlertTone(), 
+                EProfileSettingIdEmailTone );
+        if( result != KErrNone )
+            {
+            return result;
+            }
+        }
+    if( iModifiedFlags & EProfileFlagVideoCallRingingTone )
+        {
+        result = aToneHandler.CheckToneFileL(
+                iProfileExtraTones.VideoCallRingingTone(),
+                EProfileSettingIdVideoCallTone );
+        }
+        return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::HandleAutomatedContentL
+// -----------------------------------------------------------------------------
+//
+TInt CProEngTonesImpl::HandleAutomatedContent(
+        CProEngToneHandler& aToneHandler, const CProEngTonesImpl& aOldTones )
+    {
+    TInt err( KErrNone );
+    if( iModifiedFlags & EProfileFlagRingingTone )
+        {
+        err = aToneHandler.HandleAutomatedContent(
+                EProfileSettingIdRingingTone,
+                iProfileTones.RingingTone1(),
+                aOldTones.iProfileTones.RingingTone1() );
+        iModifiedFlags &= ~EProfileFlagRingingTone;
+        }
+    if( !err && ( iModifiedFlags & KProEngFlagRingingTone2 ) )
+        {
+        err = aToneHandler.HandleAutomatedContent(
+                EProfileSettingIdRingingTone2,
+                iProfileTones.RingingTone2(),
+                aOldTones.iProfileTones.RingingTone2() );
+        iModifiedFlags &= ~KProEngFlagRingingTone2;
+        }
+    if( !err && ( iModifiedFlags & EProfileFlagMessageAlertTone ) )
+        {
+        err = aToneHandler.HandleAutomatedContent(
+                EProfileSettingIdMsgTone,
+                iProfileTones.MessageAlertTone(),
+                aOldTones.iProfileTones.MessageAlertTone() );
+        iModifiedFlags &= ~EProfileFlagMessageAlertTone;
+        }
+    if( !err && ( iModifiedFlags & EProfileFlagEmailAlertTone ) )
+        {
+        err = aToneHandler.HandleAutomatedContent(
+                EProfileSettingIdEmailTone,
+                iProfileExtraTones.EmailAlertTone(),
+                aOldTones.iProfileExtraTones.EmailAlertTone() );
+        iModifiedFlags &= ~EProfileFlagEmailAlertTone;
+        }
+    if( !err && ( iModifiedFlags & EProfileFlagVideoCallRingingTone ) )
+        {
+        err = aToneHandler.HandleAutomatedContent(
+                EProfileSettingIdVideoCallTone,
+                iProfileExtraTones.VideoCallRingingTone(),
+                aOldTones.iProfileExtraTones.VideoCallRingingTone() );
+        iModifiedFlags &= ~EProfileFlagVideoCallRingingTone;
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CProEngTonesImpl::ConvertKNullToEmptyTone
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProEngTonesImpl::ConvertKNullToEmptyTone(
+        const TDesC& aTone ) const
+    {
+    if( aTone.Length() == 0 )
+        {
+        return *iEmptyTone;
+        }
+    return aTone;
+    }
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This class implements MProEngTones interface.
+*
+*/
+
+
+
+#ifndef CPROENGTONESIMPL_H
+#define CPROENGTONESIMPL_H
+
+// INCLUDES
+#include <MProEngTones.h>
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MProfileTones;
+class MProfileSetTones;
+class MProfileExtraTones;
+class MProfileSetExtraTones;
+class CProEngToneHandler;
+
+// CLASS DECLARATION
+
+/**
+* This class implements MProEngTones interface.
+*
+*  @lib ProfileEngine.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProEngTonesImpl ) : public CBase,
+                                        public MProEngTones
+    {
+    public:  // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        static CProEngTonesImpl* NewL(
+            const MProfileTones& aProfileTones,
+            MProfileSetTones& aProfileSetTones,
+            const MProfileExtraTones& aProfileExtraTones,
+            MProfileSetExtraTones& aProfileSetExtraTones,
+            TUint32 aModifiableFlags );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CProEngTonesImpl();
+
+    public:
+
+        /**
+         * From MProEngTones
+         */
+        const TDesC& RingingTone1() const;
+
+        /**
+         * From MProEngTones
+         */
+        const TDesC& RingingTone2() const;
+
+        /**
+         * From MProEngTones
+         */
+        const TDesC& MessageAlertTone() const;
+
+        /**
+         * From MProEngTones
+         */
+        const TDesC& EmailAlertTone() const;
+
+        /**
+         * From MProEngTones
+         */
+        const TDesC& VideoCallRingingTone() const;
+
+        /**
+         * From MProEngTones
+         */
+        TInt SetRingingTone1L( const TDesC& aRingingTone );
+
+        /**
+         * From MProEngTones
+         */
+        TInt SetRingingTone2L( const TDesC& aRingingTone );
+
+        /**
+         * From MProEngTones
+         */
+        TInt SetMessageAlertToneL( const TDesC& aMessageAlertTone );
+
+        /**
+         * From MProEngTones
+         */
+        TInt SetEmailAlertToneL( const TDesC& aEmailAlertTone );
+
+        /**
+         * From MProEngTones
+         */
+        TInt SetVideoCallRingingToneL( const TDesC& aRingingTone );
+
+    public:  // New functions
+
+        /**
+         * Checks the tones that have been modified by client, so that the
+         * values in them are legal. This method is called from CommitChangeL()
+         * of CProEngProfileImpl.
+         * @since 3.1
+         * @param aToneHandler Tone handler needed for checking the legality
+         *        of the tones.
+         * @return KErrNone if all the tones set are correct,
+         *         KErrNotFound if a tone file cannot be found,
+         *         KErrNotSupported if a file is of an unsupported type or
+         *         KErrPermissionDenied if the file is not allowed
+         *         to be used as a ringing or alert tone.
+         *         KErrGeneral if DRM rights are insufficient.
+		 *		   KErrArgument if the file is DRM protected audio/MP4 and
+         *		   those are not allowed as alert tones.
+         */
+        TInt CheckTonesL( CProEngToneHandler& aToneHandler );
+
+        /**
+         * Handles removing of the old tones from the automated content list and
+         * adding of the new tones to the automated content list. This method is
+         * called from CommitChangeL() of CProEngProfileImpl after the changes
+         * has been committed in the underlying Profiles Engine.
+         * @since 3.1
+         * @param aToneHandler Tone handler needed for making the actual auto-
+         *        mated content handling for the tones.
+         *        of the tones.
+         * @param aOldTones contains the tones that are currently set as alert
+         *        tones for the same profile.
+         * @return KErrNone if succesful, otherwise a system wide error code.
+         */
+        TInt HandleAutomatedContent( CProEngToneHandler& aToneHandler,
+                                      const CProEngTonesImpl& aOldTones );
+
+    private:
+
+        /**
+         * Replaces KNullDesC with the path to the empty tone.
+         * @since 3.1
+         * @param aTone The tone that is converted if it is KNullDesC.
+         * @return The path to the empty tone if aTone is KNullDesC, otherwise
+         *         the original tone.
+         */
+        const TDesC& ConvertKNullToEmptyTone( const TDesC& aTone ) const;
+
+    private:
+
+        /**
+         * C++ constructor.
+         */
+        CProEngTonesImpl( const MProfileTones& aProfileTones,
+                          MProfileSetTones& aProfileSetTones,
+                          const MProfileExtraTones& aProfileExtraTones,
+                          MProfileSetExtraTones& aProfileSetExtraTones,
+                          TUint32 aModifiableFlags );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Ref: the interface to the implementation of the profile tones
+        const MProfileTones& iProfileTones;
+
+        // Ref: the interface to the implementation of the profile set tones
+        MProfileSetTones& iProfileSetTones;
+
+        // Ref: the interface to the implementation of the profile extra tones
+        const MProfileExtraTones& iProfileExtraTones;
+
+        // Ref: the interface to the implementation of the set extra tones
+        MProfileSetExtraTones& iProfileSetExtraTones;
+
+        // Flags to check is modification allowed:
+        TUint32 iModifiableFlags;
+
+        // Flags that tell which of the tones have been modified by the client
+        TUint32 iModifiedFlags;
+
+        // Null tone.
+        TBuf<1> iNullTone;
+
+        // Own: Path to empty tone
+        HBufC* iEmptyTone;
+
+    };
+
+#endif      //  CPROENGTONESIMPL_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/ProEngFactory.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the ProEngFactory.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <ProEngFactory.h>
+#include    "CProEngEngineImpl.h"
+#include    "CProEngNotifyHandlerImpl.h"
+#include    "CProEngAlertToneSeekerImpl.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ProEngFactory::NewEngineL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProEngEngine* ProEngFactory::NewEngineL()
+    {
+    return CProEngEngineImpl::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// ProEngFactory::NewEngineLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProEngEngine* ProEngFactory::NewEngineLC()
+    {
+    return CProEngEngineImpl::NewLC();
+    }
+
+// -----------------------------------------------------------------------------
+// ProEngFactory::NewEngineL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProEngEngine* ProEngFactory::NewEngineL( RFs& aFs )
+    {
+    return CProEngEngineImpl::NewL( aFs );
+    }
+
+// -----------------------------------------------------------------------------
+// ProEngFactory::NewEngineLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProEngEngine* ProEngFactory::NewEngineLC( RFs& aFs )
+    {
+    return CProEngEngineImpl::NewLC( aFs );
+    }
+
+// -----------------------------------------------------------------------------
+// ProEngFactory::NewNotifyHandlerL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProEngNotifyHandler* ProEngFactory::NewNotifyHandlerL()
+    {
+    return CProEngNotifyHandlerImpl::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// ProEngFactory::NewAlertToneSeekerL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProEngAlertToneSeeker* ProEngFactory::NewAlertToneSeekerL()
+    {
+    return CProEngAlertToneSeekerImpl::NewL();
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/ProEngMmfInfoUtility.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of ProEngMmfInfoUtility.
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "ProEngMmfInfoUtility.h"
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32std.h>
+#include <badesca.h>
+#include <mmf/common/mmfcontrollerpluginresolver.h>
+
+namespace
+	{
+	// CONSTANTS
+	_LIT8( KProEngRngMimeType,    "application/vnd.nokia.ringing-tone" );
+	//_LIT8( KProEngPlainTextType,  "text/plain" );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProEngMmfInfoUtility::GetSupportedMimeTypesL
+// -----------------------------------------------------------------------------
+//
+void ProEngMmfInfoUtility::GetSupportedMimeTypesL( CDesC8Array& aMimeArray )
+    {
+
+    aMimeArray.InsertIsqL( KProEngRngMimeType );
+
+	CMMFFormatSelectionParameters* formatPrms =
+        CMMFFormatSelectionParameters::NewLC();
+	CMMFControllerPluginSelectionParameters* controllerPrms =
+        CMMFControllerPluginSelectionParameters::NewLC();
+
+    // Empty format parameters means: "get all the supported formats"
+    controllerPrms->SetRequiredPlayFormatSupportL( *formatPrms );
+    RMMFControllerImplInfoArray cntrlArray;
+    controllerPrms->ListImplementationsL( cntrlArray );
+
+    TInt index( 0 );
+    for( TInt i( cntrlArray.Count() - 1 ); i >= 0 ; --i )
+        {
+        const RMMFFormatImplInfoArray&
+            infoArray( cntrlArray[i]->PlayFormats() );
+
+        for( TInt j( infoArray.Count() - 1 ); j >= 0; --j )
+            {
+            const CDesC8Array& mimes = (infoArray[j])->SupportedMimeTypes();
+            for( TInt k( mimes.MdcaCount() - 1 ); k >= 0; --k )
+                {
+                if( aMimeArray.FindIsq( mimes[k], index ) != KErrNone )
+                    {
+                    aMimeArray.InsertIsqL( mimes[k] );
+                    }
+                }
+            }
+        }
+	
+	cntrlArray.ResetAndDestroy();
+	cntrlArray.Close();
+    CleanupStack::PopAndDestroy( 2, formatPrms );
+
+    //if( aMimeArray.FindIsq( KProEngPlainTextType, index ) == KErrNone )
+    //    {
+    //    aMimeArray.Delete( index );
+    //    }
+
+    aMimeArray.Compress();
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/ProEngMmfInfoUtility.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A wrapper interface around MMF (Multimedia Framework) to get
+*                information about MIME-types supported by MMF.
+*
+*/
+
+
+
+#ifndef PROENGMMFINFOUTILITY_H
+#define PROENGMMFINFOUTILITY_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class CDesC8Array;
+
+// CLASS DECLARATION
+
+/**
+*  A helper class used by Profiles Engine Wrapper to get the list of supported
+*  MIME types from MMF.
+*
+*  @lib ProfileEngine.lib
+*  @since Series 60 3.1
+*/
+NONSHARABLE_CLASS( ProEngMmfInfoUtility )
+    {
+    public: // New functions
+
+        /**
+         * Gets the list of supported MIME types from MMF.
+         * @param aMimeArray the array that contains the list of supported MIME
+         *        types on return
+         */
+        static void GetSupportedMimeTypesL( CDesC8Array& aMimeArray );
+
+    private:  // Constructor and destructor
+
+        /**
+         * Default constructor. This is private since this class is not intended
+         * to be instantiated.
+         */
+        ProEngMmfInfoUtility() {};
+
+        // Destructor.
+        ~ProEngMmfInfoUtility() {};
+    };
+
+#endif      // PROENGMMFINFOUTILITY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is a resource file for Profiles Engine Wrapper.
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    PEW2
+
+
+//  INCLUDES
+#include <eikon.rh>
+#include <drmcommon.loc>
+
+//  CONSTANTS
+//  MACROS
+
+//  RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// signature
+// resource signature
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE {}
+
+
+// -----------------------------------------------------------------------------
+//
+// r_proeng_text_drm_prev_rights_set 
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LBUF r_proeng_text_drm_prev_rights_set { txt = qtn_drm_prev_rights_set; }
+
+// End of File
Binary file profilesservices/ProfileEngine/cenrep/keys_profilesengine.xls has changed
Binary file profilesservices/ProfileEngine/conf/profilesengine.confml has changed
Binary file profilesservices/ProfileEngine/conf/profilesengine_101F8798.crml has changed
Binary file profilesservices/ProfileEngine/conf/profilesengine_101F8799.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfileEng.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file of ProfileEng.
+*
+*/
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          ProfileEng.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x100058F8
+VENDORID 	    VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH      ../group
+START RESOURCE  ProfileEng.rss
+  HEADER
+  TARGETPATH    RESOURCE_FILES_DIR
+  LANGUAGE_IDS
+END
+
+SOURCEPATH      ../EngSrc
+SOURCE          CProfileNameImpl.cpp
+SOURCE          CProfileTonesImpl.cpp
+SOURCE          CProfilePresenceImpl.cpp
+SOURCE          CProfileExtraTonesImpl.cpp
+SOURCE          CProfileExtraSettingsImpl.cpp
+SOURCE          CProfileFeedbackSettingsImpl.cpp
+SOURCE          CProfile3DToneSettingsImpl.cpp
+SOURCE          CProfilePttSettingsImpl.cpp
+SOURCE          CProfileChangeNotifyHandler.cpp
+SOURCE          CProfileImpl.cpp
+SOURCE          ProfileEngUtils.cpp
+SOURCE          ProfileEngPanic.cpp
+SOURCE          CProfilesNamesArrayImpl.cpp
+SOURCE          CProfileEngineImpl.cpp
+SOURCE          CProfilesLocalFeatures.cpp
+SOURCE          CProfileTiming.cpp
+#ifdef __DYNAMIC_PROFILES
+SOURCE          CProfileEngineImplDynamicProfiles.cpp
+#else
+SOURCE          CProfileEngineImplStaticProfiles.cpp
+#endif // __DYNAMIC_PROFILES
+SOURCE          CProfileUtilitySingletonImpl.cpp
+
+USERINCLUDE     . ../EngInc ../../group
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         FeatMgr.lib
+LIBRARY         PbkEng.lib
+LIBRARY         cntmodel.lib
+LIBRARY         sssettings.lib // for als check-up
+LIBRARY         centralrepository.lib
+LIBRARY         sysutil.lib
+LIBRARY         PlatformEnv.lib
+LIBRARY         schsvr.lib // RScheduler etc
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfileEng.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,306 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is a resource file for ProfileEng
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    PFE2
+
+
+//  INCLUDES
+#include <eikon.rh>
+#include <bldvariant.hrh>
+#include "Profile.hrh"
+#include "ProfileEng.rh"
+#include "ProfileEng.hrh"
+#include <profile.loc>
+
+//  CONSTANTS
+//  MACROS
+
+//  RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// signature
+// resource signature
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { signature = PROFILES_ENGINE_RESOURCE_SIGNATURE; }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_default_profiles
+// Profiles default profiles.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DEFAULT_PROFILES r_default_profiles
+    {
+    items=
+        {
+        PROFILE
+            {
+            id = EProfileGeneralId;
+            name = qtn_mode_general;
+            shortname = qtn_navi_mode_general;
+            naviname = qtn_navi_mode_active_general;
+            titlename = qtn_mode_title_general;
+            },
+        PROFILE
+            {
+            id = EProfileSilentId;
+            name = qtn_mode_silent;
+            shortname = qtn_navi_mode_silent;
+            naviname = qtn_navi_mode_active_silent;
+            titlename = qtn_mode_title_silent;
+            },
+        PROFILE
+            {
+            id = EProfileMeetingId;
+            name = qtn_mode_meeting;
+            shortname = qtn_navi_mode_meeting;
+            naviname = qtn_navi_mode_active_meeting;
+            titlename = qtn_mode_title_meeting;
+            },
+        PROFILE
+            {
+            id = EProfileOutdoorId;
+            name = qtn_mode_outdoor;
+            shortname = qtn_navi_mode_outdoor;
+            naviname = qtn_navi_mode_active_outdoor;
+            titlename = qtn_mode_title_outdoor;
+            },
+        PROFILE
+            {
+            id = EProfilePagerId;
+            name = qtn_mode_pager;
+            shortname = qtn_navi_mode_pager;
+            naviname = qtn_navi_mode_active_pager;
+            titlename = qtn_mode_title_pager;
+            }
+#ifdef __OFFLINE_MODE
+        ,
+        PROFILE
+            {
+            id = EProfileOffLineId;
+            name = qtn_mode_offline;
+            shortname = qtn_navi_mode_offline;
+            naviname = qtn_navi_mode_active_offline;
+            titlename = qtn_mode_title_offline;
+            }
+#endif
+#ifdef __DRIVE_MODE
+        ,
+        PROFILE
+            {
+            id = EProfileDriveId;
+            name = qtn_mode_drive;
+            shortname = qtn_navi_mode_drive;
+            naviname = qtn_navi_mode_active_drive;
+            titlename = qtn_mode_title_drive;
+            }
+#endif
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_settings
+// Profiles profile settings.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE PROFILE_SETTINGS r_profile_settings
+    {
+    items=
+        {
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdModifiableFlags;
+            key_type = EProfileSettingKeyTypeBin;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdVisibleFlags;
+            key_type = EProfileSettingKeyTypeBin;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdProfileName;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdAlertForGroups;
+            key_type = EProfileSettingKeyTypeBin;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdRingingTone;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdRingingTone2;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdMsgTone;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdRingingType;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdKeypadVolume;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdRingingVolume;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdVibra;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdEmailVibra;
+            key_type = EProfileSettingKeyTypeInt;
+            },    
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdTactileFeedback;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdAudioFeedback;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdWarnAndGameTones;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdImTone;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdEmailTone;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdVideoCallTone;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdStatusMsg;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdAvailAttribute;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdMediaVolume;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdTextToSpeechTone;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdNameChanged;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdCallObjectContent;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdPttTone;
+            key_type = EProfileSettingKeyTypeString;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingIdPttStatus;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingId3DEffect;
+            key_type = EProfileSettingKeyTypeInt;
+            },
+        PROFILE_SETTING
+            {
+            id = EProfileSettingId3DEcho;
+            key_type = EProfileSettingKeyTypeInt;
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_new_profile
+// Profiles new profile.
+//
+// -----------------------------------------------------------------------------
+//
+#ifdef __DYNAMIC_PROFILES 
+RESOURCE LBUF r_new_profile
+	{
+	txt = qtn_profiles_new_profile;
+	}
+
+RESOURCE LBUF r_new_profile_short
+	{
+    txt = qtn_navi_profiles_new_profile;
+	}
+
+RESOURCE LBUF r_new_profile_navi
+	{
+    txt = qtn_navi_mode_active_new_profile;
+	}
+
+RESOURCE LBUF r_new_profile_title
+	{
+    txt = qtn_mode_title_new_profile;
+	}
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfileEngine.lnt	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,27 @@
+/** Unused Enum scan
+-e???? +e749
+*/
+
+/** Unused header scan
+-e???? +e766
+*/
+
+/** standard lint check
+*/
+-w1 -e322
+
+/** define unicode
+-D_UNICODE
+*/
+
+/** Standard include directories */
+
+-i..\doc
+-i..\group
+-i..\EngInc
+-i..\EngSrc
+-i\epoc32\include
+
+/** Examined application source directories */
+..\EngSrc\*.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfileEngine.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains build information for the ProfileEngine
+*
+*/
+
+// To get the MW_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          ProfileEngine.dll
+TARGETTYPE      dll
+
+UID             0x1000008d 0x100058FA
+VENDORID 	    VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH      ../WrapperSrc
+SOURCE          CProEngEngineImpl.cpp
+SOURCE          CProEngProfileImpl.cpp
+SOURCE          CProEngProfileNameArrayImpl.cpp
+SOURCE          CProEngProfileNameImpl.cpp
+SOURCE          CProEngToneHandler.cpp
+SOURCE          CProEngToneHandlerDrmFull.cpp
+SOURCE          CProEngDrmCommonWrapperFull.cpp
+LIBRARY         drmhelper.lib
+SOURCE          CProEngToneSettingsImpl.cpp
+SOURCE          CProEngTonesImpl.cpp
+SOURCE          CProEngAlertToneSeekerImpl.cpp
+SOURCE          CProEngNotifyHandlerImpl.cpp
+SOURCE          CProEngObserverBase.cpp
+SOURCE          CProEngCenRepObserverBase.cpp
+SOURCE          CProEngPubSubObserverBase.cpp
+SOURCE          CProEngActiveProfileDelegate.cpp
+SOURCE          CProEngProfileActivationDelegate.cpp
+SOURCE          CProEngProfileNameArrayEventDelegate.cpp
+SOURCE          CProEngProfileEventDelegate.cpp
+SOURCE          CProEngMediaVariation.cpp
+SOURCE          CProEngPostFilter.cpp
+SOURCE          ProEngFactory.cpp
+SOURCE          ProEngMmfInfoUtility.cpp
+
+START RESOURCE  ProEngWrapper.rss
+  HEADER
+  TARGETPATH    RESOURCE_FILES_DIR
+  LANGUAGE_IDS
+END
+
+USERINCLUDE     .
+USERINCLUDE     ../WrapperInc
+USERINCLUDE     ../EngInc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         bafl.lib
+LIBRARY         euser.lib
+LIBRARY         centralrepository.lib
+LIBRARY         profileeng.lib
+LIBRARY         apgrfx.lib  // RApaLSSession
+LIBRARY         apmime.lib  // TDataType
+LIBRARY         efsrv.lib  // RFs, TParse
+LIBRARY         aknnotify.lib // CAknGlobalNote
+LIBRARY         PlatformEnv.lib  // PathInfo
+LIBRARY         ContentListingFramework.lib
+LIBRARY         mmfcontrollerframework.lib
+
+LIBRARY         DRMCommon.lib
+LIBRARY         DrmRights.lib
+LIBRARY		caf.lib	cafutils.lib // Content access framework
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file of ProfileScheduleEvent.
+*
+*/
+
+
+// To get the MW_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          ProfileScheduleEvent.exe
+TARGETTYPE      exe
+UID             0x100039CE 0x102823BC
+VENDORID 	    VID_DEFAULT
+
+CAPABILITY      CAP_APPLICATION
+
+SOURCEPATH      ../ProfileScheduleEventSrc
+START RESOURCE  ProfileScheduleEvent.rss
+  HEADER
+  TARGETPATH    RESOURCE_FILES_DIR
+  LANGUAGE_IDS
+END
+
+SOURCEPATH      ../ProfileScheduleEventSrc
+SOURCE          Main.cpp
+SOURCE          CProfileChangeEvent.cpp
+
+
+USERINCLUDE     . ../EngInc ../../group
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         commonengine.lib
+LIBRARY         profileeng.lib
+LIBRARY         bafl.lib
+LIBRARY         efsrv.lib
+LIBRARY         aknnotify.lib // CAknGlobalNote
+LIBRARY         centralrepository.lib
+LIBRARY			featmgr.lib
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfilesDebug.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Debug macros for Profiles.
+*
+*/
+
+
+#ifndef PROFILESDEBUG_H
+#define PROFILESDEBUG_H
+
+#include <e32debug.h>
+
+#ifdef _DEBUG
+#define PRODEBUG(a) RDebug::Print( _L( a ) )
+#define PRODEBUG1(a,b) RDebug::Print( _L( a ),b )
+#define PRODEBUG2(a,b,c) RDebug::Print( _L( a ),b,c )
+#define PRODEBUG3(a,b,c,d) RDebug::Print( _L( a ),b,c,d )
+#else
+#define PRODEBUG(a) 
+#define PRODEBUG1(a,b) 
+#define PRODEBUG2(a,b,c) 
+#define PRODEBUG3(a,b,c,d) 
+#endif // _DEBUG
+
+#endif // PROFILESDEBUG_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfilesEngineExports.Inc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,96 @@
+/*
+* ==============================================================================
+*  Name        : ProfilesEngineExports.inc
+*  Part of     : Profiles Engine
+*  Interface   : ?Interface_category, ?Interface_name
+*  Description : ?Description
+*  Version     : ?Version
+*
+*  Copyright (c) 2002 Nokia Corporation.
+*  This material, including documentation and any related
+*  computer programs, is protected by copyright controlled by
+*  Nokia Corporation. All rights are reserved. Copying,
+*  including reproducing, storing, adapting or translating, any
+*  or all of this material requires the prior written consent of
+*  Nokia Corporation. This material also contains confidential
+*  information which may not be disclosed to others without the
+*  prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+
+#ifndef PROFILESENGINEEXPORTS_INC
+#define PROFILESENGINEEXPORTS_INC
+
+    ../loc/Profile.loc    MW_LAYER_LOC_EXPORT_PATH(Profile.loc)
+
+    // headers
+    // for SDK
+    //..\EngInc\Profile.hrh                       APP_LAYER_PUBLIC_EXPORT_PATH(Profile.hrh)
+    // Domain API
+/*
+    ..\EngInc\CProfileChangeNotifyHandler.h     APP_LAYER_DOMAIN_EXPORT_PATH(CProfileChangeNotifyHandler.h)
+    ..\EngInc\MProfile.h                        APP_LAYER_DOMAIN_EXPORT_PATH(MProfile.h)
+    ..\EngInc\MProfileChangeObserver.h          APP_LAYER_DOMAIN_EXPORT_PATH(MProfileChangeObserver.h)
+    ..\EngInc\MProfileEngine.h                  APP_LAYER_DOMAIN_EXPORT_PATH(MProfileEngine.h)
+    ..\EngInc\MProfileExtraTones.h              APP_LAYER_DOMAIN_EXPORT_PATH(MProfileExtraTones.h)
+    ..\EngInc\MProfileName.h                    APP_LAYER_DOMAIN_EXPORT_PATH(MProfileName.h)
+    ..\EngInc\MProfileTones.h                   APP_LAYER_DOMAIN_EXPORT_PATH(MProfileTones.h)
+    ..\EngInc\MProfilesNamesArray.h             APP_LAYER_DOMAIN_EXPORT_PATH(MProfilesNamesArray.h)
+    ..\EngInc\TProfileToneSettings.h            APP_LAYER_DOMAIN_EXPORT_PATH(TProfileToneSettings.h)
+    ..\EngInc\ProfileInternal.hrh               APP_LAYER_DOMAIN_EXPORT_PATH(ProfileInternal.hrh)
+    ..\EngInc\MProfileExtraSettings.h           APP_LAYER_DOMAIN_EXPORT_PATH(MProfileExtraSettings.h)
+    ..\EngInc\MProfilePttSettings.h             APP_LAYER_DOMAIN_EXPORT_PATH(MProfilePttSettings.h)
+    ..\EngInc\ProfileEngineDomainConstants.h  APP_LAYER_DOMAIN_EXPORT_PATH(ProfileEngineDomainConstants.h)
+
+    ..\EngInc\ProfileEngineSDKCRKeys.h          APP_LAYER_SDK_EXPORT_PATH(ProfileEngineSDKCRKeys.h)
+    ..\EngInc\ProfileEngineDomainCRKeys.h       APP_LAYER_DOMAIN_EXPORT_PATH(ProfileEngineDomainCRKeys.h)
+*/
+    // Internal API headers: NOW IN DOMAIN API
+/*
+    ..\EngInc\MProfileEngineExtended.h          |..\..\..\Inc\MProfileEngineExtended.h
+    ..\EngInc\MProfileExtended.h                |..\..\..\Inc\MProfileExtended.h
+    ..\EngInc\MProfilePresence.h                |..\..\..\Inc\MProfilePresence.h
+    ..\EngInc\MProfileSetPresence.h             |..\..\..\Inc\MProfileSetPresence.h
+    ..\EngInc\ProfileEng.hrh                    |..\..\..\Inc\ProfileEng.hrh
+    ..\EngInc\ProfileEngineConstants.h          |..\..\..\Inc\ProfileEngineConstants.h
+    ..\EngInc\MProfileSetExtraTones.h           |..\..\..\Inc\MProfileSetExtraTones.h
+    ..\EngInc\MProfileSetName.h                 |..\..\..\Inc\MProfileSetName.h
+    ..\EngInc\ProfileEng.rh                     |..\..\..\Inc\ProfileEng.rh
+    ..\EngInc\MProfilesLocalFeatures.h          |..\..\..\Inc\MProfilesLocalFeatures.h
+    ..\EngInc\MProfileUtilitySingleton.h        |..\..\..\Inc\MProfileUtilitySingleton.h
+    ..\EngInc\ProfileEngineInternalCRKeys.h     |..\..\..\Inc\ProfileEngineInternalCRKeys.h
+    ..\EngInc\ProfileEngineInternalPSKeys.h     |..\..\..\Inc\ProfileEngineInternalPSKeys.h
+*/
+    // no_sound.wav
+    // wins
+    ../Data/No_Sound.wav    /epoc32/RELEASE/WINS/udeb/Z/System/Sounds/Digital/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/RELEASE/WINS/urel/Z/System/Sounds/Digital/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/RELEASE/WINSCW/udeb/Z/System/Sounds/Digital/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/RELEASE/WINSCW/urel/Z/System/Sounds/Digital/No_Sound.wav
+    // thumb
+    ../Data/No_Sound.wav    /epoc32/RELEASE/THUMB/udeb/Z/System/Sounds/Digital/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/RELEASE/THUMB/urel/Z/System/Sounds/Digital/No_Sound.wav
+    // armv5
+    ../Data/No_Sound.wav    /epoc32/release/armv5/udeb/Z/System/Sounds/Digital/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/release/armv5/urel/Z/System/Sounds/Digital/No_Sound.wav
+
+    // these are needed for Profiles to work correctly in 3.0 emulator (resource directory
+    // is hardcoded here because for some reason #defines seem not to work in here):
+    // winscw
+    ../Data/No_Sound.wav    /epoc32/RELEASE/WINSCW/udeb/Z/resource/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/RELEASE/WINSCW/urel/Z/resource/No_Sound.wav
+    // thumb
+    ../Data/No_Sound.wav    /epoc32/RELEASE/THUMB/udeb/Z/resource/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/RELEASE/THUMB/urel/Z/resource/No_Sound.wav
+    // armv5
+    ../Data/No_Sound.wav    /epoc32/release/armv5/udeb/Z/resource/No_Sound.wav
+    ../Data/No_Sound.wav    /epoc32/release/armv5/urel/Z/resource/No_Sound.wav
+
+    backup_registration.xml z:/private/100058F8/backup_registration.xml
+
+#endif      // PROFILESENGINEEXPORTS_INC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/ProfilesWrapperExports.Inc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,45 @@
+/*
+* ==============================================================================
+*  Name        : ProfilesWrapperExports.inc
+*  Part of     : Profiles Engine
+*  Interface   : ?Interface_category, ?Interface_name
+*  Description : ?Description
+*  Version     : ?Version
+*
+*  Copyright (c) 2002 Nokia Corporation.
+*  This material, including documentation and any related
+*  computer programs, is protected by copyright controlled by
+*  Nokia Corporation. All rights are reserved. Copying,
+*  including reproducing, storing, adapting or translating, any
+*  or all of this material requires the prior written consent of
+*  Nokia Corporation. This material also contains confidential
+*  information which may not be disclosed to others without the
+*  prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+
+#ifndef PROFILESWRAPPEREXPORTS_INC
+#define PROFILESWRAPPEREXPORTS_INC
+
+    ../WrapperInc/MProEngActiveProfileObserver.h    APP_LAYER_PUBLIC_EXPORT_PATH(MProEngActiveProfileObserver.h)
+    ../WrapperInc/MProEngAlertToneSeeker.h          APP_LAYER_PUBLIC_EXPORT_PATH(MProEngAlertToneSeeker.h)
+    ../WrapperInc/MProEngAlertToneSeekerObserver.h  APP_LAYER_PUBLIC_EXPORT_PATH(MProEngAlertToneSeekerObserver.h)
+    ../WrapperInc/MProEngEngine.h          APP_LAYER_PUBLIC_EXPORT_PATH(MProEngEngine.h)
+    ../WrapperInc/MProEngNotifyHandler.h   APP_LAYER_PUBLIC_EXPORT_PATH(MProEngNotifyHandler.h)
+    ../WrapperInc/MProEngProfile.h         APP_LAYER_PUBLIC_EXPORT_PATH(MProEngProfile.h)
+    ../WrapperInc/MProEngProfileActivationObserver.h APP_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileActivationObserver.h)
+    ../WrapperInc/MProEngProfileName.h          APP_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileName.h)
+    ../WrapperInc/MProEngProfileNameArray.h          APP_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileNameArray.h)
+    ../WrapperInc/MProEngProfileNameArrayObserver.h  APP_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileNameArrayObserver.h)
+    ../WrapperInc/MProEngProfileObserver.h          APP_LAYER_PUBLIC_EXPORT_PATH(MProEngProfileObserver.h)
+    ../WrapperInc/MProEngTones.h          APP_LAYER_PUBLIC_EXPORT_PATH(MProEngTones.h)
+    ../WrapperInc/MProEngToneSettings.h   APP_LAYER_PUBLIC_EXPORT_PATH(MProEngToneSettings.h)
+    ../WrapperInc/ProEngFactory.h         APP_LAYER_PUBLIC_EXPORT_PATH(ProEngFactory.h)
+
+#endif      // PROFILESWRAPPEREXPORTS_INC
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/backup_registration.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,11 @@
+<!-- Copyright (c) 2005, Nokia. Inc. All Rights Reserved -->
+<!-- Profiles backup registration file -->
+
+<backup_registration>
+
+    <proxy_data_manager sid = "0x10202BE9" />
+
+    <restore requires_reboot = "no"/>
+
+</backup_registration>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building the
+*    Profile Engine
+*
+*/
+
+// To get the APP_LAYER_LOC_EXPORT_PATH-definition
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+//Configuration tool migration
+../conf/profilesengine.confml          MW_LAYER_CONFML(profilesengine.confml)
+../conf/profilesengine_101F8798.crml   MW_LAYER_CRML(profilesengine_101F8798.crml)
+../conf/profilesengine_101F8799.crml   MW_LAYER_CRML(profilesengine_101F8799.crml)
+
+#include "ProfilesEngineExports.Inc"
+
+../rom/Profileengine.iby           CORE_MW_LAYER_IBY_EXPORT_PATH(Profileengine.iby)
+../rom/ProfileEngineResources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(ProfileEngineResources.iby)
+
+
+PRJ_MMPFILES
+    ProfileEng.mmp
+    ProfileEngine.mmp
+    ProfileScheduleEvent.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/loc/Profile.loc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is a localisation file for Profiles Engine
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//d: List of Profiles for user selection item #1 (in Profile Main dialog)
+//l: navi_text_pane_t1
+#define qtn_mode_general            "General"
+
+//d: List of Profiles for user selection item #2
+//l: navi_text_pane_t1
+#define qtn_mode_silent             "Silent"
+
+//d: List of Profiles for user selection item #3
+//l: navi_text_pane_t1
+#define qtn_mode_meeting            "Meeting"
+
+//d: List of Profiles for user selection item #4
+//l: navi_text_pane_t1
+#define qtn_mode_outdoor            "Outdoor"
+
+//d: List of Profiles for user selection item #5
+//l: navi_text_pane_t1
+#define qtn_mode_pager              "Pager"
+
+//d: List of Profiles for user selection item #6
+//l: navi_text_pane_t1
+#define qtn_mode_offline            "Off-line"
+
+//d: List of Profiles for user selection item #7
+//l: navi_text_pane_t1
+//r: 2.8
+#define qtn_mode_drive              "Drive"
+
+//d: List of Profiles for user selection item #n
+//l: list_single_pane_t1_cp2
+#define qtn_profiles_new_profile    "New profile"
+
+//d: Navi pane item #1 in Profile Personalization view
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_mode_general            "General"
+
+//d: Navi pane item #2 in Profile Personalization view
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_mode_silent             "Silent"
+
+//d: Navi pane item #3 in Profile Personalization view
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_mode_meeting            "Meeting"
+
+//d: Navi pane item #4 in Profile Personalization view
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_mode_outdoor            "Outdoor"
+
+//d: Navi pane item #5 in Profile Personalization view
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_mode_pager              "Pager"
+
+//d: Navi pane item #6 in Profile Personalization view
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_mode_offline            "Off-line"
+
+//d: Navi pane item #7 in Profile Personalization view
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_mode_drive              "Drive"
+
+//d: Navi pane item in Profile Personalization view for user-created profile
+//d: This string may be appended with 4-character string "(nn)", where nn is a
+//d: number between 01 and 19, if there are more than 1 user-created profiles
+//d: and user hasn't renamed them.
+//l: tabs_3_long_active_pane_t1
+//r: 3.1
+#define qtn_navi_profiles_new_profile    "New profile"
+
+//d: Navi pane item for Profile with ID 0 in Profiles Main View/Idle View
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_general            "General"
+
+//d: Navi pane item for Profile with ID 1 in Profiles Main View/Idle View
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_silent             "Silent"
+
+//d: Navi pane item for Profile with ID 2 in Profiles Main View/Idle View
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_meeting            "Meeting"
+
+//d: Navi pane item for Profile with ID 3 in Profiles Main View/Idle View
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_outdoor            "Outdoor"
+
+//d: Navi pane item for Profile with ID 4 in Profiles Main View/Idle View
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_pager              "Pager"
+
+//d: Navi pane item for Profile with ID 5 in Profiles Main View/Idle View
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_offline            "Off-line"
+
+//d: Navi pane item for Profile with ID 6 in Profiles Main View/Idle View
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_drive              "Drive"
+
+//d: Navi pane item for user-created profiles in Profiles Main View/Idle View
+//d: This string may be appended with 4-character string "(nn)", where nn is a
+//d: number between 01 and 19, if there are more than 1 user-created profiles
+//d: and user hasn't renamed them.
+//l: navi_text_pane_t1
+//r: 3.2
+#define qtn_navi_mode_active_new_profile    "New profile"
+
+//d: Title pane text for Profile with ID 0 in the setting pages opened from
+//d: Personalisation view.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_general            "General"
+
+//d: Title pane text for Profile with ID 1 in the setting pages opened from
+//d: Personalisation view.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_silent             "Silent"
+
+//d: Title pane text for Profile with ID 2 in the setting pages opened from
+//d: Personalisation view.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_meeting            "Meeting"
+
+//d: Title pane text for Profile with ID 3 in the setting pages opened from
+//d: Personalisation view.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_outdoor            "Outdoor"
+
+//d: Title pane text for Profile with ID 4 in the setting pages opened from
+//d: Personalisation view.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_pager              "Pager"
+
+//d: Title pane text for Profile with ID 5 in the setting pages opened from
+//d: Personalisation view.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_offline            "Off-line"
+
+//d: Title pane text for Profile with ID 6 in the setting pages opened from
+//d: Personalisation view.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_drive              "Drive"
+
+//d: Title pane text in the setting pages opened from Personalisation view.
+//d: This string may be appended with 4-character string "(nn)", where nn is a
+//d: number between 01 and 19, if there are more than 1 user-created profiles
+//d: and user hasn't renamed them.
+//l: title_pane_t2/opt9
+//r: 3.2
+#define qtn_mode_title_new_profile    "New profile"
+
+//d: Confirmation note that is shown when a timed profile expires
+//l: popup_note_window
+#define qtn_profiles_confirm_timed_expired "Timed profile expired"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/rom/ProfileEngineResources.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: IBY files for profile engine resource.
+*
+*/
+#ifndef __PROFILE_ENGINE_RESOURCES_IBY__
+#define __PROFILE_ENGINE_RESOURCES_IBY__
+
+//Resource file(s) for ProfileEng
+data=ZRESOURCE\profileeng.rsc                                        RESOURCE_FILES_DIR\profileeng.rsc
+data=ZRESOURCE\profilescheduleevent.rsc                              RESOURCE_FILES_DIR\profilescheduleevent.rsc
+
+// Resource file for Wrapper API
+data=ZRESOURCE\proengwrapper.rsc                                        RESOURCE_FILES_DIR\proengwrapper.rsc
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/rom/Profileengine.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: IBY files for profile engine.
+*/
+#ifndef __PROFILEENGINE_IBY__
+#define __PROFILEENGINE_IBY__
+
+file=ABI_DIR\BUILD_DIR\profileengine.dll                        SHARED_LIB_DIR\profileengine.dll
+
+file=ABI_DIR\BUILD_DIR\profileeng.dll                           SHARED_LIB_DIR\profileeng.dll
+
+file=ABI_DIR\BUILD_DIR\profilescheduleevent.exe                 SHARED_LIB_DIR\profilescheduleevent.exe
+
+data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\No_Sound.wav     RESOURCE_FILES_DIR\No_Sound.wav
+   
+data=ZPRIVATE\100058F8\backup_registration.xml                  private\100058F8\backup_registration.xml
+
+#ifdef FF_3D_RINGING_TONES
+// 3D Ringing tone plugin
+ECOM_PLUGIN( RingingTone3DPlugin.dll, 10208ADF.rsc )
+
+data=DATAZ_\RESOURCE_FILES_DIR\3DTones\1circular.xml                  RESOURCE_FILES_DIR\3DTones\1circular.xml
+data=DATAZ_\RESOURCE_FILES_DIR\3DTones\2flyby.xml                     RESOURCE_FILES_DIR\3DTones\2flyby.xml
+data=DATAZ_\RESOURCE_FILES_DIR\3DTones\3zigzag.xml                    RESOURCE_FILES_DIR\3DTones\3zigzag.xml
+data=DATAZ_\RESOURCE_FILES_DIR\3DTones\4meander.xml                   RESOURCE_FILES_DIR\3DTones\4meander.xml
+data=DATAZ_\RESOURCE_FILES_DIR\3DTones\5random.xml                    RESOURCE_FILES_DIR\3DTones\5random.xml
+#endif // FF_3D_RINGING_TONES
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/bwins/T_ProfileEngineu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/eabi/T_ProfileEngineu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,25 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+	_ZTI10T_MProfile @ 2 NONAME ; #<TI>#
+	_ZTI14T_MProfileName @ 3 NONAME ; #<TI>#
+	_ZTI15T_MProfileTones @ 4 NONAME ; #<TI>#
+	_ZTI16T_MProfileEngine @ 5 NONAME ; #<TI>#
+	_ZTI20T_MProfileExtraTones @ 6 NONAME ; #<TI>#
+	_ZTI21T_MProfilePttSettings @ 7 NONAME ; #<TI>#
+	_ZTI21T_MProfilesNamesArray @ 8 NONAME ; #<TI>#
+	_ZTI23T_MProfileExtraSettings @ 9 NONAME ; #<TI>#
+	_ZTI26T_MProfileFeedbackSettings @ 10 NONAME ; #<TI>#
+	_ZTI29T_CProfileChangeNotifyHandler @ 11 NONAME ; #<TI>#
+	_ZTV10T_MProfile @ 12 NONAME ; #<VT>#
+	_ZTV14T_MProfileName @ 13 NONAME ; #<VT>#
+	_ZTV15T_MProfileTones @ 14 NONAME ; #<VT>#
+	_ZTV16T_MProfileEngine @ 15 NONAME ; #<VT>#
+	_ZTV20T_MProfileExtraTones @ 16 NONAME ; #<VT>#
+	_ZTV21T_MProfilePttSettings @ 17 NONAME ; #<VT>#
+	_ZTV21T_MProfilesNamesArray @ 18 NONAME ; #<VT>#
+	_ZTV23T_MProfileExtraSettings @ 19 NONAME ; #<VT>#
+	_ZTV26T_MProfileFeedbackSettings @ 20 NONAME ; #<VT>#
+	_ZTV29T_CProfileChangeNotifyHandler @ 21 NONAME ; #<VT>#
+	_ZTI24T_MProfile3DToneSettings @ 22 NONAME ; #<TI>#
+	_ZTV24T_MProfile3DToneSettings @ 23 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/group/T_ProfileEngine.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profile Engine tests
+*
+*/
+
+////////////////////////////////////////////////////////////
+// T_ProfileEngine.mmp
+//
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+// DEFINES
+#define         KEUnitUid3 0x1000af59
+#define         KEUnitTestDllUid2 0x1000af5a
+
+// Build target
+TARGET          T_ProfileEngine.dll
+TARGETTYPE      dll
+TARGETPATH      ../../../../wins/c/DigiaEUnit/Tests
+UID             KEUnitTestDllUid2 KEUnitUid3
+
+CAPABILITY      ALL -TCB
+
+MACRO KPROFILE_TEST_DEFAULT
+
+// Source files
+SOURCEPATH      ../src
+SOURCE          DllMain.cpp
+SOURCE          T_MProfilesNamesArray.cpp
+SOURCE          T_MProfileEngine.cpp
+SOURCE          T_MProfile.cpp
+SOURCE          T_CProfileChangeNotifyHandler.cpp
+SOURCE          T_MProfileName.cpp
+SOURCE          T_MProfileTones.cpp
+SOURCE          T_MProfileExtraTones.cpp
+SOURCE		T_MProfileExtraSettings.cpp
+SOURCE          T_MProfilePttSettings.cpp
+SOURCE		T_MProfileFeedbackSettings.cpp
+SOURCE		T_MProfile3DToneSettings.cpp
+
+// Include paths
+USERINCLUDE	../inc
+USERINCLUDE	../../../../../EngInc
+SYSTEMINCLUDE	../../../../../../../inc
+SYSTEMINCLUDE   /epoc32/include/digia/EUnit
+APP_LAYER_SYSTEMINCLUDE
+
+// Dependencies to system components
+LIBRARY         euser.lib
+LIBRARY         EUnit.lib
+LIBRARY         EUnitutil.lib
+LIBRARY         efsrv.lib
+LIBRARY         bafl.lib
+LIBRARY         PbkEng.lib
+LIBRARY         cntmodel.lib
+LIBRARY         CommonEngine.lib
+LIBRARY         centralrepository.lib
+
+// Dependencies to Profiles components
+LIBRARY         ProfileEng.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building the
+*    Profile Engine tests
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+
+PRJ_PLATFORMS
+DEFAULT
+
+// Exports for module tests:
+PRJ_TESTEXPORTS
+
+PRJ_TESTMMPFILES
+// MMP-files for module tests:
+T_ProfileEngine.mmp   // module test dll
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_CProfileChangeNotifyHandler.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CProfileChangeNotifyHandler test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_CProfileChangeNotifyHandler.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+#include <MProfileChangeObserver.h>
+
+// FORWARD DECLARATION
+class CProfileChangeNotifyHandler;
+class CTestObserver;
+class MProfileEngineExtended;
+class MProfileExtended;
+
+
+
+/**
+ * Test suite for class CProfileChangeNotifyHandler
+ */
+class T_CProfileChangeNotifyHandler : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_CProfileChangeNotifyHandler* NewLC();
+        ~T_CProfileChangeNotifyHandler();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+        void CreateTestL();
+
+        void HandleNotifyTestL();
+
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        CProfileChangeNotifyHandler* iHandler;
+        CTestObserver* iObserver;
+        MProfileExtended* iProfile;
+        MProfileEngineExtended* iProfileEngine;
+        TInt iOrigRingingVolume;
+        TFileName iOrigRingingTone;
+
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfile.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfile test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfile.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <CPbkContactEngine.h>
+#include <cntdef.h>
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+
+/**
+ * Test suite for class MProfile
+ */
+class T_MProfile : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfile* NewLC();
+        ~T_MProfile();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void SetupL();
+
+        // teardowns
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+        void CreateTestL();
+
+        // MProfile
+        void GetAlertForTestL();
+        void IsSilentTestL();
+        void GetProfileNameTestL();
+        void GetProfileTonesTestL();
+        void GetProfileExtraTonesTestL();
+        void GetProfileExtraSettingsTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+        TInt iActiveId;
+        RFs iFs;
+        CPbkContactEngine* iCE;
+        RArray<TContactItemId> iArray;
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfile3DToneSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfile3DToneSettings test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfile3DToneSettings.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+class MProfileExtraSettings;
+class MProfile3DToneSettings;
+class CRepository;
+
+/**
+ * Test suite for class MProfile
+ */
+class T_MProfile3DToneSettings : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfile3DToneSettings* NewLC();
+        ~T_MProfile3DToneSettings();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+
+        void GetEffectTestL();
+        void GetEchoTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+        TInt iActiveId;
+        RFs iFs;
+
+        const MProfileExtraSettings* iProfileExtraSettings;
+        const MProfile3DToneSettings* iProfile3DToneSettings;
+        CRepository* iCenRep;
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileEngine.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfileEngine test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileEngine.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfileEngineExtended;
+class CRepository;
+
+
+/**
+ * Test suite for class MProfileEngine
+ */
+class T_MProfileEngine : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfileEngine* NewLC();
+        ~T_MProfileEngine();
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+        void Setup0L();
+        void SetupGetRingingVolumeL();
+        void SetupGetMediaVolumeL();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+        void CreateTestL();
+
+        void GetActiveProfileTestL();
+        void GetActiveProfileIdTestL();
+        void SetActiveProfileTestL();
+        void GetProfilesNamesArrayTestL();
+        void SetTempRingingVolumeTestL();
+        void SetTempMediaVolumeTestL();
+        void GetTempRingingVolumeTestL();
+        void GetTempMediaVolumeTestL();
+        void IsActiveProfileTimedLTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfileEngineExtended* iProfileEngineExtended;
+        TInt iActiveId;
+        RArray<TInt> iArray;
+        RFs iFs;
+        CRepository* iCenRep;
+        TInt iOrigMediaVolume;
+        TInt iOrigRingingVolume;
+        TInt iTimed;
+
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileExtraSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfileExtraSettings test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileExtraSettings.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+#include <CNTDEF.H>
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+
+/**
+ * Test suite for class MProfileExtraSettings
+ */
+class T_MProfileExtraSettings : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfileExtraSettings* NewLC();
+        ~T_MProfileExtraSettings();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+        void ProfilePttSettingsTestL();
+        void ProfileFeedbackSettingsTestL();
+        void Profile3DToneSettingsTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileExtraTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfileExtraTones test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileExtraTones.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+class MProfileExtraTones;
+class CRepository;
+
+/**
+ * Test suite for class MProfile
+ */
+class T_MProfileExtraTones : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfileExtraTones* NewLC();
+        ~T_MProfileExtraTones();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+
+        void GetIMMessageAlertToneTestL();
+
+        void GetEmailAlertToneTestL();
+
+        void GetVideoCallRingingToneTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+        TInt iActiveId;
+        RArray<TInt> iArray;
+        RFs iFs;
+
+        const MProfileExtraTones* iProfileExtraTones;
+        CRepository* iCenRep;
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileFeedbackSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfileFeedbackSettings test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileFeedbackSettings.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+class MProfileExtraSettings;
+class MProfileFeedbackSettings;
+class CRepository;
+
+/**
+ * Test suite for class MProfile
+ */
+class T_MProfileFeedbackSettings : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfileFeedbackSettings* NewLC();
+        ~T_MProfileFeedbackSettings();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+
+        void GetTactileFeedbackTestL();
+        void GetAudioFeedbackTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+        TInt iActiveId;
+        RFs iFs;
+
+        const MProfileExtraSettings* iProfileExtraSettings;
+        const MProfileFeedbackSettings* iProfileFeedbackSettings;
+        CRepository* iCenRep;
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileName.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfileName test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileName.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+class MProfileName;
+class MProfileTones;
+class MProfileExtraTones;
+
+
+/**
+ * Test suite for class MProfile
+ */
+class T_MProfileName : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfileName* NewLC();
+        ~T_MProfileName();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+
+        // MProfileName
+        void GetIdTestL();
+        void GetNameTestL();
+        void GetShortNameTestL();
+        void GetNaviNameTestL();
+        void GetTitleNameTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+        TInt iActiveId;
+
+        const MProfileName* iProfileName;
+        RFs iFs;
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfilePttSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfilePttSettings test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfilePttSettings.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+class MProfileExtraSettings;
+class MProfilePttSettings;
+class CRepository;
+
+/**
+ * Test suite for class MProfile
+ */
+class T_MProfilePttSettings : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfilePttSettings* NewLC();
+        ~T_MProfilePttSettings();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+
+        void GetPttStatusTestL();
+
+        void GetPttRingingToneTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+        TInt iActiveId;
+        RFs iFs;
+
+        const MProfileExtraSettings* iProfileExtraSettings;
+        const MProfilePttSettings* iProfilePttSettings;
+        CRepository* iCenRep;
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfileTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfileTones test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileTonesName.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfileEngine;
+class MProfile;
+class MProfileTones;
+class CRepository;
+
+/**
+ * Test suite for class MProfile
+ */
+class T_MProfileTones : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfileTones* NewLC();
+        ~T_MProfileTones();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+
+        void GetRingingTone1TestL();
+        void GetRingingTone2TestL();
+        void GetMessageAlertToneTestL();
+        void GetProfileToneSettingsTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        MProfileEngine* iProfileEngine;
+        MProfile* iProfile;
+        TInt iActiveId;
+        RFs iFs;
+
+        const MProfileTones* iProfileTones;
+        CRepository* iCenRep;
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_MProfilesNamesArray.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MProfilesNamesArray test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfilesNamesArray.h
+//
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+#include <f32file.h>
+#include <s32file.h>
+
+#include <APGCLI.H>
+
+
+// FORWARD DECLARATION
+class MProfilesNamesArray;
+class MProfileEngine;
+
+/**
+ * Test suite for class MProfilesNamesArray
+ */
+class T_MProfilesNamesArray : public CEUnitTestSuiteClass
+    {
+    public:     // Construct / destruct
+        static T_MProfilesNamesArray* NewLC();
+        ~T_MProfilesNamesArray();
+
+    private:
+        void ConstructL();
+
+    private:    // Assistance methods
+
+    private:    // test methods
+        // setups
+        void EmptySetupL();
+        void SetupL();
+
+        // teardowns
+        void EmptyTeardown();
+        void Teardown();
+
+        // tests
+        void EmptyTestL();
+        void CreateTestL();
+
+        void ProfileNameTestL();
+        void FindIdTestL();
+        void FindNameTestL();
+        void MdcaCountTestL();
+        void MdcaPointTestL();
+
+    private:    // Implementation
+
+        EUNIT_DECLARE_TESTCASE_TABLE;
+
+    private:    // Data
+        RFs iFs;
+        MProfileEngine* iProfileEngine;
+        MProfilesNamesArray* iProfilesNames;
+
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/inc/T_ProfileTestTools.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Tools class used in ProfileEngine tests.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_ProfileTestTools.h
+//
+
+// INCLUDES
+#include <e32std.h>
+#include <CNTDEF.H>
+
+#include <MProfileChangeObserver.h>
+//CONSTS
+
+//#define PROFILE_TEST_RUN_ALLOC
+
+
+// default profile names
+_LIT( KProfileGeneralName, "General" );
+_LIT( KProfileSilentName,  "Silent" );
+_LIT( KProfileMeetingName, "Meeting" );
+_LIT( KProfileOutdoorName, "Outdoor" );
+_LIT( KProfilePagerName,   "Pager" );
+#ifdef __OFFLINE_MODE
+_LIT( KProfileOfflineName,   "Off-line" );
+#endif
+#ifdef __DRIVE_MODE
+_LIT( KProfileDriveName,   "Drive" );
+#endif
+
+_LIT( KProfileGeneralName2, "General2" );
+_LIT( KProfileSilentName2,  "Silent2" );
+_LIT( KProfileMeetingName2, "Meeting2" );
+_LIT( KProfileOutdoorName2, "Outdoor2" );
+_LIT( KProfilePagerName2,   "Pager2" );
+#ifdef __OFFLINE_MODE
+_LIT( KProfileOfflineName2,   "Off-line2" );
+#endif
+#ifdef __DRIVE_MODE
+_LIT( KProfileDriveName2,   "Drive2" );
+#endif
+
+// default tone settings
+_LIT( KProfileNokiaTune, "z:\\data\\sounds\\digital\\nokia tune.aac" );
+_LIT( KProfileMessageTone, "z:\\data\\sounds\\digital\\message 1.aac" );
+_LIT( KProfileIMMessageTone, "z:\\data\\sounds\\digital\\Chat alert.aac" );
+_LIT( KProfileBeep, "z:\\data\\sounds\\simple\\beep.rng" );
+_LIT( KProfileBeepTwice, "z:\\data\\sounds\\simple\\beep twice.rng" );
+_LIT( KProfileNoSound, "z:\\resource\\no_sound.wav" );
+
+// default presence settings
+//_LIT( KProfileStatusMessageAvailable, "Available" );
+//_LIT( KProfileStatusMessageDiscreet, "Discreet" );
+//_LIT( KProfileStatusMessageNotAvailable, "Not available" );
+_LIT( KProfileStatusMessageAvailable, "" );
+_LIT( KProfileStatusMessageDiscreet, "" );
+_LIT( KProfileStatusMessageNotAvailable, "" );
+
+_LIT( KProfileEmpty, "" );
+_LIT( KProfileMinName, "Z" );
+_LIT( KProfileMaxName, "1234567890123456789012345678901234567890123456789012345678901234" ); // 64
+//_LIT( KProfileTooLongProfileName, "1234567890123456789012345678901234567890123456789012345678901234567890" ); // 70
+_LIT( KProfileMaxFileName, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456" ); // 256
+_LIT( KProfileTooLongFileName, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567" ); // 257
+_LIT( KProfileMaxStatusMessage, "1234567890123456789012345678901234567890" );   // 40
+
+const TInt KMaxNumberOfDynamicProfiles( 20 );
+
+
+// FORWARD DECLARATION
+class RFs;
+class MProfilesNamesArray;
+struct TProfileToneSettings;
+class CPbkContactEngine;
+
+struct TSharedDataSettings
+    {
+    TInt iRingType;
+    TInt iRingVol;
+    TInt iVibrAlert;
+    TInt iKeyVolume;
+    TInt iWarnTone;
+    TInt iMsgAlert;
+    TBuf<64> iRingTone1;
+    TBuf<64> iRingTone2;
+    TBuf<64> iMsgTone;
+    TBuf<16> iName;
+    TInt iActive;
+    };
+
+/**
+* Test observer
+*/
+class CTestObserver: public CBase, public MProfileChangeObserver
+    {
+    public:
+        static CTestObserver* NewL()
+                    {CTestObserver* self = new (ELeave) CTestObserver; return self;}
+        ~CTestObserver()
+                    {};
+        void HandleActiveProfileEventL( TProfileEvent aProfileEvent, TInt aProfileId )
+                    {
+                    iLastEvent = aProfileEvent;
+                    iLastId = aProfileId;
+                    CActiveScheduler::Stop();
+                    }
+        TProfileEvent iLastEvent;
+        TInt iLastId;
+    };
+
+/**
+ * Test Tools
+ */
+class T_ProfileTestTools
+    {
+    public:
+        static void ResetRepository();
+        static void RemoveFilesL( RFs& aFs );
+        static TInt DefaultFiles( RFs& aFs );
+        static TInt CorruptFiles( RFs& aFs );
+        static TInt MakeBackupFiles( RFs& aFs );
+        static TBool CompareArrays( const TArray<TContactItemId>& aArray1, const TArray<TContactItemId>& aArray2 );
+        static TBool CheckArray( const MProfilesNamesArray& aArray );
+        static TBool CheckModifiedArray( MProfilesNamesArray& aArray );
+        static const TDesC& ProfileShortName( TInt aId );
+        static const TDesC& ProfileName( TInt aId );
+        static const TDesC& ProfileModifiedName( TInt aId );
+        static const TDesC& ProfileRingingTone( TInt aId );
+        static const TDesC& ProfileMessageAlertTone( TInt aId );
+        static const TDesC& ProfileIMMessageAlertTone( TInt aId );
+        static const TDesC& ProfileEmailAlertTone( TInt aId );
+        static const TDesC& ProfileVideoCallRingingTone( TInt aId );
+        static const TDesC& ProfileStatusMessage( TInt aId );
+        static TBool CheckToneSettings( TInt aId, const TProfileToneSettings&  aSettings );
+        static void CreateContactGroupsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void DeleteContactGroups( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void CreateContactsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void DeleteContacts( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void WriteAlertForIdsToCenrepL( TInt aProfileId, RArray<TContactItemId>& aArray );
+        static void DeleteAlertForIdsFromCenrep( TInt aProfileId );
+        static TBool CheckSharedDataSettingsL( TInt aId );
+        static TBool CheckSharedDataSettingsL( const TSharedDataSettings& aSettings );
+        static TBool CompareSettings( const TSharedDataSettings& aSettings, const TSharedDataSettings& aSettings1 );
+        static TInt ProfilePttStatus( TInt aProfileId );
+        static const TDesC& ProfilePttRingingTone( TInt aProfileId );
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/DllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ProfileEngine test suite.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// DllMain for T_ProfileEngine.dll
+
+
+// INCLUDES
+#include <CEUnitTestSuite.h>
+#include "T_MProfileEngine.h"
+#include "T_MProfile.h"
+#include "T_CProfileChangeNotifyHandler.h"
+#include "T_MProfilesNamesArray.h"
+#include "T_MProfileName.h"
+#include "T_MProfileTones.h"
+#include "T_MProfileExtraTones.h"
+#include "T_MProfileExtraSettings.h"
+#include "T_MProfilePttSettings.h"
+#include "T_MProfileFeedbackSettings.h"
+#include "T_MProfile3DToneSettings.h"
+
+/**
+ * T_ProfileEngine.dll test suite factory function.
+ */
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    CEUnitTestSuite* mainSuite = CEUnitTestSuite::NewLC(_L("T_ProfileEngine API Tests"));
+
+    // NewLC leaves the pointer to cleanupstack until AddL finishes
+    mainSuite->AddL( T_MProfileName::NewLC() );
+    mainSuite->AddL( T_MProfileTones::NewLC() );
+    mainSuite->AddL( T_MProfileExtraTones::NewLC() );
+    mainSuite->AddL( T_MProfileExtraSettings::NewLC() );
+    mainSuite->AddL( T_MProfilePttSettings::NewLC() );
+    mainSuite->AddL( T_MProfileFeedbackSettings::NewLC() );
+    mainSuite->AddL( T_MProfile3DToneSettings::NewLC() );
+    mainSuite->AddL( T_MProfilesNamesArray::NewLC() );
+    mainSuite->AddL( T_MProfile::NewLC() );
+    mainSuite->AddL( T_CProfileChangeNotifyHandler::NewLC() );
+    mainSuite->AddL( T_MProfileEngine::NewLC() );
+
+    CleanupStack::Pop( 11 );
+
+    CleanupStack::Pop( mainSuite );
+    return mainSuite;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_CProfileChangeNotifyHandler.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_CProfileChangeNotifyHandler test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_CProfileChangeNotifyHandler.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <CProfileChangeNotifyHandler.h>
+
+#include "T_ProfileTestTools.h"
+#include <centralrepository.h>
+#include <e32property.h>
+#include <ProfileEngineSDKCRKeys.h>
+#include <MProfileEngineExtended.h>
+#include <MProfileExtended.h>
+#include <TProfileToneSettings.h>
+#include <MProfileTones.h>
+#include "MProfileSetTones.h"
+#include "ProfileEnginePrivatePSKeys.h"
+
+// the header for the tested class
+#include "T_CProfileChangeNotifyHandler.h"
+
+//CONSTS
+//#define PROFILE_TEST_RUN_ALLOC
+
+
+// create the testing class
+T_CProfileChangeNotifyHandler* T_CProfileChangeNotifyHandler::NewLC()
+    {
+    T_CProfileChangeNotifyHandler* self = new(ELeave) T_CProfileChangeNotifyHandler;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_CProfileChangeNotifyHandler::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_CProfileChangeNotifyHandler::~T_CProfileChangeNotifyHandler()
+    {
+    delete iObserver;
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_CProfileChangeNotifyHandler::EmptySetupL()
+    {
+    }
+
+
+
+void T_CProfileChangeNotifyHandler::SetupL()
+    {
+    iObserver = CTestObserver::NewL();
+    }
+
+
+
+/**
+ * Teardown
+ */
+void T_CProfileChangeNotifyHandler::EmptyTeardown()
+    {
+
+    }
+
+void T_CProfileChangeNotifyHandler::Teardown()
+    {
+    delete iObserver;
+    iObserver = NULL;
+    }
+
+/**
+ * Tests
+ */
+
+void T_CProfileChangeNotifyHandler::CreateTestL()
+    {
+    CProfileChangeNotifyHandler* handler = CProfileChangeNotifyHandler::NewL( iObserver );
+    EUNIT_ASSERT( handler );
+    delete handler;
+    }
+
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_CProfileChangeNotifyHandler, "T_CProfileChangeNotifyHandler test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Create test ", SetupL, CreateTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfile.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfile test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfile.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <RSSSettings.h>
+#include "MProfileEngine.h"
+#include "MProfileEngineExtended.h"
+#include "MProfile.h"
+#include "MProfileName.h"
+#include "MProfileExtraTones.h"
+#include "MProfileSetExtraTones.h"
+#include "MProfileExtraSettings.h"
+#include "MProfilesLocalFeatures.h"
+#include "MProfileTones.h"
+#include <TProfileToneSettings.h>
+#include "MProfileExtended.h"
+#include "MProfileSetTones.h"
+//#include "T_ProfileTestTools.h"
+#include "ProfilesVariant.hrh"
+
+// the header for the tested class
+#include "T_MProfile.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfile* T_MProfile::NewLC()
+    {
+    T_MProfile* self = new(ELeave) T_MProfile;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfile::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfile::~T_MProfile()
+    {
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+void T_MProfile::SetupL()
+    {
+    iActiveId = 0;
+
+    iProfileEngine = CreateProfileEngineL();
+
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    iProfile = iProfileEngine->ActiveProfileL();
+    }
+
+
+/**
+ * Teardown
+ */
+
+void T_MProfile::Teardown()
+    {
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    }
+
+/**
+ * Tests
+ */
+void T_MProfile::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfile::CreateTestL()
+    {
+    MProfile* profile = NULL;
+    profile = iProfileEngine->ActiveProfileL();
+    EUNIT_ASSERT( profile );
+    profile->Release();
+    profile = NULL;
+
+    profile = iProfileEngine->ActiveProfileL();
+    EUNIT_ASSERT( profile );
+    CleanupReleasePushL( *profile );
+    CleanupStack::PopAndDestroy();
+    profile = NULL;
+
+    profile = iProfileEngine->ActiveProfileLC();
+    EUNIT_ASSERT( profile );
+    CleanupStack::PopAndDestroy();
+    profile = NULL;
+    }
+
+void T_MProfile::GetAlertForTestL()
+    {
+    __UHEAP_MARK;
+    TArray<TContactItemId> array = iProfile->AlertForL();
+    __UHEAP_MARKEND;
+
+    EUNIT_ASSERT( array.Count() == 0 );
+    }
+
+void T_MProfile::IsSilentTestL()
+    {
+    __UHEAP_MARK;
+    TBool isSilent( iProfile->IsSilent() );
+    __UHEAP_MARKEND;
+    if( iActiveId == 1 || iActiveId == 4 )
+        {
+        EUNIT_ASSERT( isSilent );
+        }
+    else
+        {
+        EUNIT_ASSERT( !isSilent );
+        }
+    }
+
+void T_MProfile::GetProfileNameTestL()
+    {
+    const MProfileName* profileName = NULL;
+    __UHEAP_MARK;
+    profileName = &( iProfile->ProfileName() );
+    __UHEAP_MARKEND;
+    EUNIT_ASSERT( profileName );
+    }
+
+void T_MProfile::GetProfileTonesTestL()
+    {
+    const MProfileTones* profileTones = NULL;
+    __UHEAP_MARK;
+    profileTones = &( iProfile->ProfileTones() );
+    __UHEAP_MARKEND;
+    EUNIT_ASSERT( profileTones );
+    }
+
+void T_MProfile::GetProfileExtraTonesTestL()
+    {
+    const MProfileExtraTones* profileExtraTones = NULL;
+    __UHEAP_MARK;
+    profileExtraTones = &( iProfile->ProfileExtraTones() );
+    __UHEAP_MARKEND;
+    EUNIT_ASSERT( profileExtraTones );
+    }
+
+void T_MProfile::GetProfileExtraSettingsTestL()
+    {
+    const MProfileExtraSettings* profileExtraSettings = NULL;
+    __UHEAP_MARK;
+    profileExtraSettings = &( iProfile->ProfileExtraSettings() );
+    __UHEAP_MARKEND;
+    EUNIT_ASSERT( profileExtraSettings );
+    }
+
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfile, "T_MProfile test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Create test ",              SetupL, CreateTestL, Teardown)
+    EUNIT_TESTCASE("Get alert for test ",       SetupL, GetAlertForTestL, Teardown)
+    EUNIT_TESTCASE("Is silent test ",           SetupL, IsSilentTestL, Teardown)
+    EUNIT_TESTCASE("Get profile name test ",    SetupL, GetProfileNameTestL, Teardown)
+    EUNIT_TESTCASE("Get profile tones test ",   SetupL, GetProfileTonesTestL, Teardown)
+    EUNIT_TESTCASE("Get profile extra tones test ",   SetupL, GetProfileExtraTonesTestL, Teardown)
+    EUNIT_TESTCASE("Get profile extra settings test ",   SetupL, GetProfileExtraSettingsTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfile3DToneSettings.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfile3DToneSettings test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfile3DToneSettings.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileName.h>
+#include <MProfileExtraSettings.h>
+//#include "T_ProfileTestTools.h"
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+// the header for the tested class
+#include <MProfile3DToneSettings.h>
+// the header for the tester class
+#include "T_MProfile3DToneSettings.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfile3DToneSettings* T_MProfile3DToneSettings::NewLC()
+    {
+    T_MProfile3DToneSettings* self = new(ELeave) T_MProfile3DToneSettings;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfile3DToneSettings::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfile3DToneSettings::~T_MProfile3DToneSettings()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfile3DToneSettings::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfile3DToneSettings::SetupL()
+    {
+    iFs.Connect();
+    iCenRep = CRepository::NewL( KCRUidProfileEngine );
+    iCenRep->Reset();
+
+    iProfileEngine = CreateProfileEngineL();
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    iProfile = iProfileEngine->ActiveProfileL();
+
+    iProfileExtraSettings = &( iProfile->ProfileExtraSettings() );
+    iProfile3DToneSettings = &( iProfileExtraSettings->Profile3DToneSettings() );
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfile3DToneSettings::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfile3DToneSettings::Teardown()
+    {
+    iFs.Close();
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        iProfile3DToneSettings = NULL;
+        iProfileExtraSettings = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    delete iCenRep;
+
+    }
+
+/**
+ * Tests
+ */
+void T_MProfile3DToneSettings::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfile3DToneSettings::GetEffectTestL()
+    {
+    __UHEAP_MARK;
+    TProfile3DToneEffect effect( iProfile3DToneSettings->Effect() );
+    __UHEAP_MARKEND;
+    }
+
+void T_MProfile3DToneSettings::GetEchoTestL()
+    {
+    __UHEAP_MARK;
+    TProfile3DToneEcho echo( iProfile3DToneSettings->Echo() );
+    __UHEAP_MARKEND;
+    }
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfile3DToneSettings, "T_MProfile3DToneSettings test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Get Effect test ", SetupL, GetEffectTestL, Teardown)
+
+    EUNIT_TESTCASE("Get Echo test ", SetupL, GetEchoTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileEngine.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,389 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfileEngine test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileEngine.cpp
+//
+
+// INCLUDES
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+#include <e32math.h>
+#include <e32svr.h>
+#include <bautils.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfilesNamesArray.h>
+#include <MProfileTones.h>
+#include <MProfileExtraTones.h>
+#include "MProfilesLocalFeatures.h"
+#include "ProfilesVariant.hrh"
+#include "MProfileExtended.h"
+#include "MProfileSetName.h"
+#include "MProfileEngineExtended.h"
+#include <TProfileToneSettings.h>
+//#include "T_ProfileTestTools.h"
+//#include "T_ProfileTestHelper.h"
+
+// the header for the tested class
+#include "T_MProfileEngine.h"
+
+//CONSTS
+const TProfileRingingVolume
+        KProfileTestExpectedVolume( EProfileRingingVolumeLevel3 );
+
+// Redefined from RSSSettings.h (which includes shareddatakeys.h and thus cannot
+// be included here):
+namespace
+    {
+    enum TSSSettingsAlsValue
+        {
+        ESSSettingsAlsNotSupported = 0,
+        ESSSettingsAlsPrimary = 1,
+        ESSSettingsAlsAlternate = 2
+        };
+    }
+
+// create the testing class
+T_MProfileEngine* T_MProfileEngine::NewLC()
+    {
+    T_MProfileEngine* self = new(ELeave) T_MProfileEngine;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+T_MProfileEngine::~T_MProfileEngine()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    iArray.Close();
+    }
+
+/**
+ * Setup
+ */
+void T_MProfileEngine::EmptySetupL()
+    {
+    iFs.Connect();
+    }
+
+
+
+void T_MProfileEngine::SetupL()
+    {
+    iFs.Connect();
+    iCenRep = CRepository::NewL( KCRUidProfileEngine );
+    iCenRep->Reset();
+
+    iProfileEngine = CreateProfileEngineL( &iFs );
+    iArray.Reset();
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    iTimed = EFalse;
+    }
+
+void T_MProfileEngine::Setup0L()
+    {
+    iActiveId = 0;
+    SetupL();
+    }
+
+void T_MProfileEngine::SetupGetRingingVolumeL()
+    {
+    Setup0L();
+
+    User::LeaveIfError( iCenRep->Get( KProEngActiveRingingVolume,
+                                     iOrigRingingVolume ) );
+    User::LeaveIfError( iCenRep->Set( KProEngActiveRingingVolume,
+                                     KProfileTestExpectedVolume ) );
+    }
+
+void T_MProfileEngine::SetupGetMediaVolumeL()
+    {
+    Setup0L();
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfileEngine::EmptyTeardown()
+    {
+    iFs.Close();
+    }
+
+void T_MProfileEngine::Teardown()
+    {
+    iFs.Close();
+    delete iCenRep;
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    iArray.Reset();
+    }
+
+
+/**
+ * Tests
+ */
+void T_MProfileEngine::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfileEngine::CreateTestL()
+    {
+    MProfileEngine* tmp = NULL;
+    tmp = CreateProfileEngineL();
+    EUNIT_ASSERT( tmp );
+    if( tmp )
+        {
+        tmp->Release();
+        }
+    
+    tmp = NULL;
+    tmp = CreateProfileEngineL();
+    CleanupReleasePushL( *tmp );
+    EUNIT_ASSERT( tmp );
+    CleanupStack::PopAndDestroy();
+    
+    tmp = NULL;
+    tmp = CreateProfileEngineL( &iFs );
+    EUNIT_ASSERT( tmp );
+    if( tmp )
+        {
+        tmp->Release();
+        }
+    
+    tmp = NULL;
+    tmp = CreateProfileEngineL( &iFs );
+    CleanupReleasePushL( *tmp );
+    EUNIT_ASSERT( tmp );
+    CleanupStack::PopAndDestroy();
+    }
+
+void T_MProfileEngine::GetActiveProfileTestL()
+    {
+    MProfile* profile = NULL;
+    profile = iProfileEngine->ActiveProfileL();
+    EUNIT_ASSERT( profile );
+    profile->Release();
+
+    profile = NULL;
+    profile = iProfileEngine->ActiveProfileLC();
+    CleanupStack::Pop(); // profile
+    EUNIT_ASSERT( profile );
+    profile->Release();
+    }
+
+void T_MProfileEngine::GetActiveProfileIdTestL()
+    {
+    TInt id = User::LeaveIfError( iProfileEngine->ActiveProfileId() );
+    EUNIT_ASSERT( iActiveId == id );
+    }
+
+void T_MProfileEngine::SetActiveProfileTestL()
+    {
+    TInt id(0);
+    iProfileEngine->SetActiveProfileL( 0 );
+    id = iProfileEngine->ActiveProfileId();
+    User::LeaveIfError( id );
+    EUNIT_ASSERT( id == 0 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 0 ) );
+
+    iProfileEngine->SetActiveProfileL( 1 );
+    id = iProfileEngine->ActiveProfileId();
+    User::LeaveIfError( id );
+    EUNIT_ASSERT( id == 1 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 1 ) );
+
+    iProfileEngine->SetActiveProfileL( 2 );
+    id = iProfileEngine->ActiveProfileId();
+    User::LeaveIfError( id );
+    EUNIT_ASSERT( id == 2 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 2 ) );
+
+    iProfileEngine->SetActiveProfileL( 3 );
+    id = iProfileEngine->ActiveProfileId();
+    User::LeaveIfError( id );
+    EUNIT_ASSERT( id == 3 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 3 ) );
+
+    iProfileEngine->SetActiveProfileL( 4 );
+    id = iProfileEngine->ActiveProfileId();
+    User::LeaveIfError( id );
+    EUNIT_ASSERT( id == 4 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 4 ) );
+
+    iProfileEngine->SetActiveProfileL( 0 );
+    id = User::LeaveIfError( iProfileEngine->ActiveProfileId() );
+    EUNIT_ASSERT( id == 0 );
+    
+    TRAPD( err, iProfileEngine->SetActiveProfileL( -1 ) );
+    EUNIT_ASSERT( err != KErrNone );
+    if( ( err != KErrNotFound ) && ( err != KErrPathNotFound ) )
+        {
+        User::LeaveIfError( err );
+        }
+    EUNIT_ASSERT( ( err == KErrNotFound ) || ( err == KErrPathNotFound ) );
+    id = User::LeaveIfError( iProfileEngine->ActiveProfileId() );
+    EUNIT_ASSERT( id == 0 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 0 ) );
+
+#ifdef __OFFLINE_MODE
+    iProfileEngine->SetActiveProfileL( 5 );
+    id = iProfileEngine->ActiveProfileId();
+    User::LeaveIfError( id );
+    EUNIT_ASSERT( id == 5 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 5 ) );
+
+    iProfileEngine->SetActiveProfileL( 0 );
+    id = User::LeaveIfError( iProfileEngine->ActiveProfileId() );
+    EUNIT_ASSERT( id == 0 );
+#endif
+    
+#ifdef __DRIVE_MODE
+    iProfileEngine->SetActiveProfileL( 6 );
+    id = iProfileEngine->ActiveProfileId();
+    User::LeaveIfError( id );
+    EUNIT_ASSERT( id == 6 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 6 ) );
+
+    iProfileEngine->SetActiveProfileL( 0 );
+    id = User::LeaveIfError( iProfileEngine->ActiveProfileId() );
+    EUNIT_ASSERT( id == 0 );
+#endif
+    TRAP( err, iProfileEngine->SetActiveProfileL( 7 ) );
+    EUNIT_ASSERT( err != KErrNone );
+    if( ( err != KErrNotFound ) && ( err != KErrPathNotFound ) )
+        {
+        User::LeaveIfError( err );
+        }
+    EUNIT_ASSERT( ( err == KErrNotFound ) || ( err == KErrPathNotFound ) );
+    id = User::LeaveIfError( iProfileEngine->ActiveProfileId() );
+    EUNIT_ASSERT( id == 0 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 0 ) );
+
+    TRAP( err, iProfileEngine->SetActiveProfileL( 1232131 ) );
+    EUNIT_ASSERT( err != KErrNone );
+    if( ( err != KErrNotFound ) && ( err != KErrPathNotFound ) )
+        {
+        User::LeaveIfError( err );
+        }
+    EUNIT_ASSERT( ( err == KErrNotFound ) || ( err == KErrPathNotFound ) );
+    id = User::LeaveIfError( iProfileEngine->ActiveProfileId() );
+    EUNIT_ASSERT( id == 0 );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckSharedDataSettingsL( 0 ) );
+    }
+
+void T_MProfileEngine::GetProfilesNamesArrayTestL()
+    {
+    MProfilesNamesArray* array = iProfileEngine->ProfilesNamesArrayLC();
+    EUNIT_ASSERT( array );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckArray( *array ) );
+    CleanupStack::PopAndDestroy();
+    array = NULL;
+
+    array = iProfileEngine->ProfilesNamesArrayLC();
+    EUNIT_ASSERT( array );
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckArray( *array ) );
+    CleanupStack::Pop();
+    delete array;
+    }
+
+void T_MProfileEngine::SetTempRingingVolumeTestL()
+    {
+    iProfileEngine->SetTempRingingVolumeL( EProfileRingingVolumeLevel5 );
+    TInt volume( 0 );
+    User::LeaveIfError( iCenRep->Get( KProEngActiveRingingVolume, volume ) );
+    EUNIT_ASSERT( volume == 5 );
+    TRAPD( err, 
+           iProfileEngine->SetTempRingingVolumeL( 
+           EProfileRingingVolumeLevel1 ) );
+    if( err )
+        {
+        }
+#ifdef __PROTOCOL_CDMA
+    //EUNIT_ASSERT( err == KErrNone );
+#else
+    //EUNIT_ASSERT( err == KErrNotSupported );
+#endif
+
+    iProfileEngine->SetTempRingingVolumeL( EProfileRingingVolumeLevel7 );
+    }
+
+void T_MProfileEngine::SetTempMediaVolumeTestL()
+    {
+    iProfileEngine->SetTempMediaVolumeL( EProfileRingingVolumeLevel2 );
+    }
+
+void T_MProfileEngine::GetTempRingingVolumeTestL()
+    {
+    TProfileRingingVolume vol( iProfileEngine->TempRingingVolumeL() );
+    EUNIT_ASSERT( vol == KProfileTestExpectedVolume );
+    }
+
+void T_MProfileEngine::GetTempMediaVolumeTestL()
+    {
+    TProfileRingingVolume vol( iProfileEngine->TempMediaVolumeL() );
+    }
+
+void T_MProfileEngine::IsActiveProfileTimedLTestL()
+    {
+    MProfileEngineExtended* engineExt = CreateProfileEngineExtendedL( &iFs );
+    CleanupReleasePushL( *engineExt );
+    MProfilesLocalFeatures& features = engineExt->LocalFeatures();
+    if( features.IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+        {
+        TBool result( iProfileEngine->IsActiveProfileTimedL() );
+        EUNIT_ASSERT( result == iTimed );
+        }
+    CleanupStack::PopAndDestroy(); //engineExt
+    }
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfileEngine, "T_MProfileEngine test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Create test ", EmptySetupL, CreateTestL, EmptyTeardown)
+//     
+    EUNIT_TESTCASE("Get active profile test",      Setup0L, GetActiveProfileTestL, Teardown )
+    EUNIT_TESTCASE("Get active profile id test ",   Setup0L, GetActiveProfileIdTestL, Teardown )
+    EUNIT_TESTCASE("Set active profile test ",      Setup0L, SetActiveProfileTestL, Teardown )
+    EUNIT_TESTCASE("Get profiles names array test ", Setup0L, GetProfilesNamesArrayTestL, Teardown )
+
+    EUNIT_TESTCASE("Set temporary ringing volume ", Setup0L, SetTempRingingVolumeTestL, Teardown )
+    EUNIT_TESTCASE("Set temporary media volume ", Setup0L, SetTempMediaVolumeTestL, Teardown )
+    EUNIT_TESTCASE("Get temporary ringing volume ", SetupGetRingingVolumeL, GetTempRingingVolumeTestL, Teardown )
+    EUNIT_TESTCASE("Get temporary media volume ", SetupGetMediaVolumeL, GetTempMediaVolumeTestL, Teardown )
+    EUNIT_TESTCASE("Is Active Profile Timed test", Setup0L, IsActiveProfileTimedLTestL, Teardown )
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileExtraSettings.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfileExtraSettings test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileExtraSettings.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileExtraSettings.h>
+#include <MProfilePttSettings.h>
+#include <MProfileFeedbackSettings.h>
+#include <MProfile3DToneSettings.h>
+//#include "T_ProfileTestTools.h"
+
+// the header for the tested class
+#include "T_MProfileExtraSettings.h"
+
+
+// create the testing class
+T_MProfileExtraSettings* T_MProfileExtraSettings::NewLC()
+    {
+    T_MProfileExtraSettings* self = new(ELeave) T_MProfileExtraSettings;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfileExtraSettings::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+
+    }
+
+T_MProfileExtraSettings::~T_MProfileExtraSettings()
+    {
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfileExtraSettings::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfileExtraSettings::SetupL()
+    {
+    iProfileEngine = CreateProfileEngineL();
+    iProfile = iProfileEngine->ActiveProfileL();
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfileExtraSettings::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfileExtraSettings::Teardown()
+    {
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    }
+
+/**
+ * Tests
+ */
+void T_MProfileExtraSettings::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+/////////////////////
+// MProfile
+void T_MProfileExtraSettings::ProfilePttSettingsTestL()
+    {
+    const MProfileExtraSettings& extraSettings = iProfile->ProfileExtraSettings();
+    const MProfilePttSettings& pttSettings = extraSettings.ProfilePttSettings();
+    }
+
+void T_MProfileExtraSettings::ProfileFeedbackSettingsTestL()
+    {
+    const MProfileExtraSettings& extraSettings = iProfile->ProfileExtraSettings();
+    const MProfileFeedbackSettings& feedbackSettings = extraSettings.ProfileFeedbackSettings();
+    }
+
+void T_MProfileExtraSettings::Profile3DToneSettingsTestL()
+    {
+    const MProfileExtraSettings& extraSettings = iProfile->ProfileExtraSettings();
+    const MProfile3DToneSettings& threeDSettings = extraSettings.Profile3DToneSettings();
+    }
+
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfileExtraSettings, "T_MProfileExtended test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Get PTT interface test ", SetupL, ProfilePttSettingsTestL, Teardown )
+    EUNIT_TESTCASE("Get Feedback interface test ", SetupL, ProfileFeedbackSettingsTestL, Teardown )
+    EUNIT_TESTCASE("Get 3D-Tone interface test ", SetupL, Profile3DToneSettingsTestL, Teardown )
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileExtraTones.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfileExtraTones test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileExtraTonesExtraTones.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileName.h>
+#include <MProfileExtraTones.h>
+#include <MProfileTones.h>
+#include <TProfileToneSettings.h>
+//#include "T_ProfileTestTools.h"
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+// the header for the tested class
+#include "T_MProfileExtraTones.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfileExtraTones* T_MProfileExtraTones::NewLC()
+    {
+    T_MProfileExtraTones* self = new(ELeave) T_MProfileExtraTones;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfileExtraTones::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfileExtraTones::~T_MProfileExtraTones()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    iArray.Close();
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfileExtraTones::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfileExtraTones::SetupL()
+    {
+    iFs.Connect();
+    iCenRep = CRepository::NewL( KCRUidProfileEngine );
+    iCenRep->Reset();
+
+    iArray.Reset();
+    iProfileEngine = CreateProfileEngineL();
+
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    iProfile = iProfileEngine->ActiveProfileL();
+
+    iProfileExtraTones = &( iProfile->ProfileExtraTones() );
+    }
+
+void T_MProfileExtraTones::Setup0L()
+    {
+    iActiveId = 0;
+    SetupL();
+    }
+
+void T_MProfileExtraTones::Setup1L()
+    {
+    iActiveId = 1;
+    SetupL();
+    }
+
+void T_MProfileExtraTones::Setup2L()
+    {
+    iActiveId = 2;
+    SetupL();
+    }
+
+void T_MProfileExtraTones::Setup3L()
+    {
+    iActiveId = 3;
+    SetupL();
+    }
+
+void T_MProfileExtraTones::Setup4L()
+    {
+    iActiveId = 4;
+    SetupL();
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfileExtraTones::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfileExtraTones::Teardown()
+    {
+    iFs.Close();
+    iArray.Reset();
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    delete iCenRep;
+
+    }
+
+/**
+ * Tests
+ */
+void T_MProfileExtraTones::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfileExtraTones::GetIMMessageAlertToneTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileExtraTones->IMMessageAlertTone();
+    __UHEAP_MARKEND;
+
+    //EUNIT_ASSERT( des.CompareF( T_ProfileTestTools::ProfileIMMessageAlertTone( iActiveId ) ) == 0 );
+    }
+
+void T_MProfileExtraTones::GetEmailAlertToneTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileExtraTones->EmailAlertTone();
+    __UHEAP_MARKEND;
+
+    //EUNIT_ASSERT( des.CompareF( T_ProfileTestTools::ProfileEmailAlertTone( iActiveId ) ) == 0 );
+    }
+
+void T_MProfileExtraTones::GetVideoCallRingingToneTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileExtraTones->VideoCallRingingTone();
+    __UHEAP_MARKEND;
+
+    //EUNIT_ASSERT( des.CompareF( T_ProfileTestTools::ProfileVideoCallRingingTone( iActiveId ) ) == 0 );
+    }
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfileExtraTones, "T_MProfileExtraTones test suite", "MODULE" )
+
+    EUNIT_TESTCASE("0: Get IM msg alert tone test ", Setup0L, GetIMMessageAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("1: Get IM msg alert tone test ", Setup1L, GetIMMessageAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("2: Get IM msg alert tone test ", Setup2L, GetIMMessageAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("3: Get IM msg alert tone test ", Setup3L, GetIMMessageAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("4: Get IM msg alert tone test ", Setup4L, GetIMMessageAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("0: Get Email alert tone test ", Setup0L, GetEmailAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("1: Get Email alert tone test ", Setup1L, GetEmailAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("2: Get Email alert tone test ", Setup2L, GetEmailAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("3: Get Email alert tone test ", Setup3L, GetEmailAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("4: Get Email alert tone test ", Setup4L, GetEmailAlertToneTestL, Teardown)
+
+    EUNIT_TESTCASE("0: Get Video call ringing tone test ", Setup0L, GetVideoCallRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("1: Get Video call ringing tone test ", Setup1L, GetVideoCallRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("2: Get Video call ringing tone test ", Setup2L, GetVideoCallRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("3: Get Video call ringing tone test ", Setup3L, GetVideoCallRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("4: Get Video call ringing tone test ", Setup4L, GetVideoCallRingingToneTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileFeedbackSettings.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfileFeedbackSettings test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileFeedbackSettings.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileName.h>
+#include <MProfileExtraSettings.h>
+//#include "T_ProfileTestTools.h"
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+// the header for the tested class
+#include <MProfileFeedbackSettings.h>
+// the header for the tester class
+#include "T_MProfileFeedbackSettings.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfileFeedbackSettings* T_MProfileFeedbackSettings::NewLC()
+    {
+    T_MProfileFeedbackSettings* self = new(ELeave) T_MProfileFeedbackSettings;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfileFeedbackSettings::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfileFeedbackSettings::~T_MProfileFeedbackSettings()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfileFeedbackSettings::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfileFeedbackSettings::SetupL()
+    {
+    iFs.Connect();
+    iCenRep = CRepository::NewL( KCRUidProfileEngine );
+    iCenRep->Reset();
+
+    iProfileEngine = CreateProfileEngineL();
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    iProfile = iProfileEngine->ActiveProfileL();
+
+    iProfileExtraSettings = &( iProfile->ProfileExtraSettings() );
+    iProfileFeedbackSettings = &( iProfileExtraSettings->ProfileFeedbackSettings() );
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfileFeedbackSettings::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfileFeedbackSettings::Teardown()
+    {
+    iFs.Close();
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        iProfileFeedbackSettings = NULL;
+        iProfileExtraSettings = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    delete iCenRep;
+
+    }
+
+/**
+ * Tests
+ */
+void T_MProfileFeedbackSettings::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfileFeedbackSettings::GetTactileFeedbackTestL()
+    {
+    __UHEAP_MARK;
+    TProfileTactileFeedback tac( iProfileFeedbackSettings->TactileFeedback() );
+    __UHEAP_MARKEND;
+    }
+
+void T_MProfileFeedbackSettings::GetAudioFeedbackTestL()
+    {
+    __UHEAP_MARK;
+    TProfileAudioFeedback aud( iProfileFeedbackSettings->AudioFeedback() );
+    __UHEAP_MARKEND;
+    }
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfileFeedbackSettings, "T_MProfileFeedbackSettings test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Get Tactile feedback test ", SetupL, GetTactileFeedbackTestL, Teardown)
+
+    EUNIT_TESTCASE("Get Audio feedback test ", SetupL, GetAudioFeedbackTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileName.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfileName test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileName.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileName.h>
+//#include "T_ProfileTestTools.h"
+
+// the header for the tested class
+#include "T_MProfileName.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfileName* T_MProfileName::NewLC()
+    {
+    T_MProfileName* self = new(ELeave) T_MProfileName;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfileName::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfileName::~T_MProfileName()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfileName::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfileName::SetupL()
+    {
+    iFs.Connect();
+
+    iProfileEngine = CreateProfileEngineL();
+
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    iProfile = iProfileEngine->ActiveProfileL();
+
+    iProfileName = &( iProfile->ProfileName() );
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfileName::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfileName::Teardown()
+    {
+    iFs.Close();
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+
+    }
+
+/**
+ * Tests
+ */
+void T_MProfileName::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfileName::GetIdTestL()
+    {
+    __UHEAP_MARK;
+    TInt id = iProfileName->Id();
+    __UHEAP_MARKEND;
+    EUNIT_ASSERT( id == iActiveId );
+    }
+
+void T_MProfileName::GetNameTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileName->Name();
+    __UHEAP_MARKEND;
+    //EUNIT_ASSERT( des.Compare( T_ProfileTestTools::ProfileName( iActiveId ) ) == 0 );
+    }
+
+void T_MProfileName::GetShortNameTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileName->ShortName();
+    __UHEAP_MARKEND;
+    //EUNIT_ASSERT( des.Compare( T_ProfileTestTools::ProfileName( iActiveId ) ) == 0 );
+    }
+void T_MProfileName::GetNaviNameTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileName->NaviName();
+    __UHEAP_MARKEND;
+    //EUNIT_ASSERT( des.Compare( T_ProfileTestTools::ProfileName( iActiveId ) ) == 0 );
+    }
+void T_MProfileName::GetTitleNameTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileName->TitleName();
+    __UHEAP_MARKEND;
+    //EUNIT_ASSERT( des.Compare( T_ProfileTestTools::ProfileName( iActiveId ) ) == 0 );
+    }
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfileName, "T_MProfileName test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Get ID test ", SetupL, GetIdTestL, Teardown)
+    EUNIT_TESTCASE("Get Name test ", SetupL, GetNameTestL, Teardown)
+    EUNIT_TESTCASE("Get ShortName test ", SetupL, GetShortNameTestL, Teardown)
+    EUNIT_TESTCASE("Get NaviName test ", SetupL, GetNaviNameTestL, Teardown)
+    EUNIT_TESTCASE("Get TitleName test ", SetupL, GetTitleNameTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfilePttSettings.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfilePttSettings test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfilePttSettings.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileName.h>
+#include <MProfileExtraSettings.h>
+//#include "T_ProfileTestTools.h"
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+// the header for the tested class
+#include <MProfilePttSettings.h>
+// the header for the tester class
+#include "T_MProfilePttSettings.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfilePttSettings* T_MProfilePttSettings::NewLC()
+    {
+    T_MProfilePttSettings* self = new(ELeave) T_MProfilePttSettings;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfilePttSettings::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfilePttSettings::~T_MProfilePttSettings()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfilePttSettings::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfilePttSettings::SetupL()
+    {
+    RDebug::Print( _L( "Digia:PttSettings test 1" ) );
+    iFs.Connect();
+    RDebug::Print( _L( "Digia:PttSettings test 2" ) );
+    iCenRep = CRepository::NewL( KCRUidProfileEngine );
+    RDebug::Print( _L( "Digia:PttSettings test 3" ) );
+    iCenRep->Reset();
+    RDebug::Print( _L( "Digia:PttSettings test 4" ) );
+
+    iProfileEngine = CreateProfileEngineL();
+
+    RDebug::Print( _L( "Digia:PttSettings test 5" ) );
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    RDebug::Print( _L( "Digia:PttSettings test 6" ) );
+    iProfile = iProfileEngine->ActiveProfileL();
+    RDebug::Print( _L( "Digia:PttSettings test 7" ) );
+
+    iProfileExtraSettings = &( iProfile->ProfileExtraSettings() );
+    RDebug::Print( _L( "Digia:PttSettings test 8" ) );
+    iProfilePttSettings = &( iProfileExtraSettings->ProfilePttSettings() );
+    RDebug::Print( _L( "Digia:PttSettings test 9" ) );
+    }
+
+void T_MProfilePttSettings::Setup0L()
+    {
+    iActiveId = 0;
+    SetupL();
+    }
+
+void T_MProfilePttSettings::Setup1L()
+    {
+    iActiveId = 1;
+    SetupL();
+    }
+
+void T_MProfilePttSettings::Setup2L()
+    {
+    iActiveId = 2;
+    SetupL();
+    }
+
+void T_MProfilePttSettings::Setup3L()
+    {
+    iActiveId = 3;
+    SetupL();
+    }
+
+void T_MProfilePttSettings::Setup4L()
+    {
+    iActiveId = 4;
+    SetupL();
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfilePttSettings::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfilePttSettings::Teardown()
+    {
+    iFs.Close();
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        iProfilePttSettings = NULL;
+        iProfileExtraSettings = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    delete iCenRep;
+
+    }
+
+/**
+ * Tests
+ */
+void T_MProfilePttSettings::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfilePttSettings::GetPttStatusTestL()
+    {
+    __UHEAP_MARK;
+    TProfilePttStatus status( iProfilePttSettings->PttStatus() );
+    __UHEAP_MARKEND;
+
+    RDebug::Print( _L( "GetPttStatusTestL: status=%d" ), status );
+    //EUNIT_ASSERT( status == T_ProfileTestTools::ProfilePttStatus( iActiveId ) );
+    }
+
+void T_MProfilePttSettings::GetPttRingingToneTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& desc = iProfilePttSettings->PttRingingTone();
+    __UHEAP_MARKEND;
+
+    //EUNIT_ASSERT( desc.CompareF( T_ProfileTestTools::ProfilePttRingingTone( iActiveId ) ) == 0 );
+    }
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfilePttSettings, "T_MProfilePttSettings test suite", "MODULE" )
+
+    EUNIT_TESTCASE("0: Get ptt status test ", Setup0L, GetPttStatusTestL, Teardown)
+
+    EUNIT_TESTCASE("1: Get ptt status test ", Setup1L, GetPttStatusTestL, Teardown)
+
+    EUNIT_TESTCASE("2: Get ptt status test ", Setup2L, GetPttStatusTestL, Teardown)
+
+    EUNIT_TESTCASE("3: Get ptt status test ", Setup3L, GetPttStatusTestL, Teardown)
+
+    EUNIT_TESTCASE("4: Get ptt status test ", Setup4L, GetPttStatusTestL, Teardown)
+
+    EUNIT_TESTCASE("0: Get ptt ringing tone test ", Setup0L, GetPttRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("1: Get ptt ringing tone test ", Setup1L, GetPttRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("2: Get ptt ringing tone test ", Setup2L, GetPttRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("3: Get ptt ringing tone test ", Setup3L, GetPttRingingToneTestL, Teardown)
+
+    EUNIT_TESTCASE("4: Get ptt ringing tone test ", Setup4L, GetPttRingingToneTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileTones.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfileTones test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfileTones.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileName.h>
+#include <MProfileExtraTones.h>
+#include <MProfileTones.h>
+#include <TProfileToneSettings.h>
+//#include "T_ProfileTestTools.h"
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+// the header for the tested class
+#include "T_MProfileTones.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfileTones* T_MProfileTones::NewLC()
+    {
+    T_MProfileTones* self = new(ELeave) T_MProfileTones;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfileTones::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfileTones::~T_MProfileTones()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfileTones::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfileTones::SetupL()
+    {
+    iFs.Connect();
+    iCenRep = CRepository::NewL( KCRUidProfileEngine );
+    iCenRep->Reset();
+
+    iProfileEngine = CreateProfileEngineL();
+
+    iProfileEngine->SetActiveProfileL( iActiveId );
+    iProfile = iProfileEngine->ActiveProfileL();
+
+    iProfileTones = &( iProfile->ProfileTones() );
+    }
+
+void T_MProfileTones::Setup0L()
+    {
+    iActiveId = 0;
+    SetupL();
+    }
+
+void T_MProfileTones::Setup1L()
+    {
+    iActiveId = 1;
+    SetupL();
+    }
+
+void T_MProfileTones::Setup2L()
+    {
+    iActiveId = 2;
+    SetupL();
+    }
+
+void T_MProfileTones::Setup3L()
+    {
+    iActiveId = 3;
+    SetupL();
+    }
+
+void T_MProfileTones::Setup4L()
+    {
+    iActiveId = 4;
+    SetupL();
+    }
+
+
+/**
+ * Teardown
+ */
+void T_MProfileTones::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfileTones::Teardown()
+    {
+    iFs.Close();
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    delete iCenRep;
+
+    }
+
+/**
+ * Tests
+ */
+void T_MProfileTones::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfileTones::GetRingingTone1TestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileTones->RingingTone1();
+    __UHEAP_MARKEND;
+    TFileName rt( des );
+    //EUNIT_ASSERT( des.CompareF( T_ProfileTestTools::ProfileRingingTone( iActiveId ) ) == 0 );
+    }
+
+void T_MProfileTones::GetRingingTone2TestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileTones->RingingTone2();
+    __UHEAP_MARKEND;
+    //EUNIT_ASSERT( des.CompareF( T_ProfileTestTools::ProfileRingingTone( iActiveId ) ) == 0 );
+    }
+
+void T_MProfileTones::GetMessageAlertToneTestL()
+    {
+    __UHEAP_MARK;
+    const TDesC& des = iProfileTones->MessageAlertTone();
+    __UHEAP_MARKEND;
+    //EUNIT_ASSERT( des.CompareF( T_ProfileTestTools::ProfileMessageAlertTone( iActiveId ) ) == 0 );
+    }
+
+void T_MProfileTones::GetProfileToneSettingsTestL()
+    {
+    __UHEAP_MARK;
+    const TProfileToneSettings& settings = iProfileTones->ToneSettings();
+    __UHEAP_MARKEND;
+    //EUNIT_ASSERT( T_ProfileTestTools::CheckToneSettings( iActiveId, settings ) );
+    }
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfileTones, "T_MProfileTones test suite", "MODULE" )
+
+    EUNIT_TESTCASE("0: Get ringing tone 1 test ",  Setup0L, GetRingingTone1TestL, Teardown)
+    EUNIT_TESTCASE("0: Get ringing tone 2 test ",  Setup0L, GetRingingTone2TestL, Teardown)
+    EUNIT_TESTCASE("0: Get msg alert tone test ",  Setup0L, GetMessageAlertToneTestL, Teardown)
+    EUNIT_TESTCASE("0: Get tone settings test ",   Setup0L, GetProfileToneSettingsTestL, Teardown)
+
+    EUNIT_TESTCASE("1: Get ringing tone 1 test ",  Setup1L, GetRingingTone1TestL, Teardown)
+    EUNIT_TESTCASE("1: Get ringing tone 2 test ",  Setup1L, GetRingingTone2TestL, Teardown)
+    EUNIT_TESTCASE("1: Get msg alert tone test ",  Setup1L, GetMessageAlertToneTestL, Teardown)
+    EUNIT_TESTCASE("1: Get tone settings test ",   Setup1L, GetProfileToneSettingsTestL, Teardown)
+
+    EUNIT_TESTCASE("2: Get ringing tone 1 test ",  Setup2L, GetRingingTone1TestL, Teardown)
+    EUNIT_TESTCASE("2: Get ringing tone 2 test ",  Setup2L, GetRingingTone2TestL, Teardown)
+    EUNIT_TESTCASE("2: Get msg alert tone test ",  Setup2L, GetMessageAlertToneTestL, Teardown)
+    EUNIT_TESTCASE("2: Get tone settings test ",   Setup2L, GetProfileToneSettingsTestL, Teardown)
+
+    EUNIT_TESTCASE("3: Get ringing tone 1 test ",  Setup3L, GetRingingTone1TestL, Teardown)
+    EUNIT_TESTCASE("3: Get ringing tone 2 test ",  Setup3L, GetRingingTone2TestL, Teardown)
+    EUNIT_TESTCASE("3: Get msg alert tone test ",  Setup3L, GetMessageAlertToneTestL, Teardown)
+    EUNIT_TESTCASE("3: Get tone settings test ",   Setup3L, GetProfileToneSettingsTestL, Teardown)
+
+    EUNIT_TESTCASE("4: Get ringing tone 1 test ",  Setup4L, GetRingingTone1TestL, Teardown)
+    EUNIT_TESTCASE("4: Get ringing tone 2 test ",  Setup4L, GetRingingTone2TestL, Teardown)
+    EUNIT_TESTCASE("4: Get msg alert tone test ",  Setup4L, GetMessageAlertToneTestL, Teardown)
+    EUNIT_TESTCASE("4: Get tone settings test ",   Setup4L, GetProfileToneSettingsTestL, Teardown)
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfilesNamesArray.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the T_MProfilesNamesArray test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// T_MProfilesNamesArray.cpp
+//
+
+// INCLUDES
+#include <e32math.h>
+#include <e32svr.h>
+
+#include <EUnitMacros.h>
+#include <TEUnitAssertionInfo.h>
+
+#include <BAMDESCA.H>
+#include <MProfileEngine.h>
+#include <MProfileName.h>
+#include <MProfilesNamesArray.h>
+#include "T_ProfileTestTools.h"
+
+// the header for the tested class
+#include "T_MProfilesNamesArray.h"
+
+//CONSTS
+
+// create the testing class
+T_MProfilesNamesArray* T_MProfilesNamesArray::NewLC()
+    {
+    T_MProfilesNamesArray* self = new(ELeave) T_MProfilesNamesArray;
+
+    CleanupStack::PushL( self );
+    // need to generate the table, so call base classes
+    // second phase constructor
+    self->ConstructL();
+    return self;
+    }
+
+void T_MProfilesNamesArray::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+T_MProfilesNamesArray::~T_MProfilesNamesArray()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    delete iProfilesNames;
+    }
+
+/**
+ * Assistance methods
+ */
+
+
+/**
+ * Setup
+ */
+void T_MProfilesNamesArray::EmptySetupL()
+    {
+    }
+
+
+
+void T_MProfilesNamesArray::SetupL()
+    {
+    iFs.Connect();
+    
+    iProfileEngine = CreateProfileEngineL();
+    iProfilesNames = iProfileEngine->ProfilesNamesArrayLC();
+    CleanupStack::Pop();
+    }
+/*
+void T_MProfilesNamesArray::Setup0L()
+    {
+    iActiveId = 0;
+    SetupL();
+    }
+
+void T_MProfilesNamesArray::Setup1L()
+    {
+    iActiveId = 1;
+    SetupL();
+    }
+
+void T_MProfilesNamesArray::Setup2L()
+    {
+    iActiveId = 2;
+    SetupL();
+    }
+
+void T_MProfilesNamesArray::Setup3L()
+    {
+    iActiveId = 3;
+    SetupL();
+    }
+
+void T_MProfilesNamesArray::Setup4L()
+    {
+    iActiveId = 4;
+    SetupL();
+    }
+*/
+
+/**
+ * Teardown
+ */
+void T_MProfilesNamesArray::EmptyTeardown()
+    {
+
+    }
+
+void T_MProfilesNamesArray::Teardown()
+    {
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        iProfileEngine = NULL;
+        }
+    delete iProfilesNames;
+    iProfilesNames = NULL;
+    }
+
+/**
+ * Tests
+ */
+void T_MProfilesNamesArray::EmptyTestL()
+    {
+    //EUNIT_ASSERT( ETrue );
+    }
+
+void T_MProfilesNamesArray::CreateTestL()
+    {
+    MProfilesNamesArray* array = iProfileEngine->ProfilesNamesArrayLC();
+    CleanupStack::PopAndDestroy();
+    array = iProfileEngine->ProfilesNamesArrayLC();
+    CleanupStack::Pop();
+    delete array;
+    }
+
+void T_MProfilesNamesArray::ProfileNameTestL()
+    {
+    __UHEAP_MARK;
+    const MProfileName* pn = NULL;
+    pn = iProfilesNames->ProfileName( 0 );
+    EUNIT_ASSERT( pn );
+    EUNIT_ASSERT( pn->Name().Compare( KProfileGeneralName ) == 0 );
+    EUNIT_ASSERT( pn->Id() == 0 );
+    
+    pn = iProfilesNames->ProfileName( 1 );
+    EUNIT_ASSERT( pn );
+    EUNIT_ASSERT( pn->Name().Compare( KProfileSilentName ) == 0 );
+    EUNIT_ASSERT( pn->Id() == 1 );
+
+    pn = iProfilesNames->ProfileName( 2 );
+    EUNIT_ASSERT( pn );
+    EUNIT_ASSERT( pn->Name().Compare( KProfileMeetingName ) == 0 );
+    EUNIT_ASSERT( pn->Id() == 2 );
+
+    pn = iProfilesNames->ProfileName( 3 );
+    EUNIT_ASSERT( pn );
+    EUNIT_ASSERT( pn->Name().Compare( KProfileOutdoorName ) == 0 );
+    EUNIT_ASSERT( pn->Id() == 3 );
+
+    pn = iProfilesNames->ProfileName( 4 );
+    EUNIT_ASSERT( pn );
+    EUNIT_ASSERT( pn->Name().Compare( KProfilePagerName ) == 0 );
+    EUNIT_ASSERT( pn->Id() == 4 );
+
+    pn = iProfilesNames->ProfileName( -1 );
+    EUNIT_ASSERT( !pn );
+
+    pn = iProfilesNames->ProfileName( 12 );
+    EUNIT_ASSERT( !pn );
+
+#ifdef __OFFLINE_MODE
+    pn = iProfilesNames->ProfileName( 5 );
+    EUNIT_ASSERT( pn );
+    EUNIT_ASSERT( pn->Name().Compare( KProfileOfflineName ) == 0 );
+    EUNIT_ASSERT( pn->Id() == 5 );
+#endif
+
+#ifdef __DRIVE_MODE
+    pn = iProfilesNames->ProfileName( 6 );
+    EUNIT_ASSERT( pn );
+    EUNIT_ASSERT( pn->Name().Compare( KProfileDriveName ) == 0 );
+    EUNIT_ASSERT( pn->Id() == 6 );
+#endif
+    pn = iProfilesNames->ProfileName( 7 );
+    EUNIT_ASSERT( !pn );
+
+    __UHEAP_MARKEND;
+    }
+
+void T_MProfilesNamesArray::FindIdTestL()
+    {
+    __UHEAP_MARK;
+    EUNIT_ASSERT( iProfilesNames->FindById( 0 ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->FindById( 1 ) == 1 );
+    EUNIT_ASSERT( iProfilesNames->FindById( 2 ) == 2 );
+    EUNIT_ASSERT( iProfilesNames->FindById( 3 ) == 3 );
+    EUNIT_ASSERT( iProfilesNames->FindById( 4 ) == 4 );
+#ifdef __OFFLINE_MODE
+    EUNIT_ASSERT( iProfilesNames->FindById( 5 ) == 5 );
+#endif
+#ifdef __DRIVE_MODE
+    EUNIT_ASSERT( iProfilesNames->FindById( 6 ) == 6 );
+#endif
+    EUNIT_ASSERT( iProfilesNames->FindById( 7 ) == KErrNotFound );
+    EUNIT_ASSERT( iProfilesNames->FindById( -1 ) == KErrNotFound );
+    EUNIT_ASSERT( iProfilesNames->FindById( 12312312 ) == KErrNotFound );
+    __UHEAP_MARKEND;
+    }
+
+void T_MProfilesNamesArray::FindNameTestL()
+    {
+    __UHEAP_MARK;
+    EUNIT_ASSERT( iProfilesNames->FindByName( KProfileGeneralName ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->FindByName( KProfileSilentName ) == 1 );
+    EUNIT_ASSERT( iProfilesNames->FindByName( KProfileMeetingName ) == 2 );
+    EUNIT_ASSERT( iProfilesNames->FindByName( KProfileOutdoorName ) == 3 );
+    EUNIT_ASSERT( iProfilesNames->FindByName( KProfilePagerName ) == 4 );
+    EUNIT_ASSERT( iProfilesNames->FindByName( _L( "general" ) ) == KErrNotFound );
+    EUNIT_ASSERT( iProfilesNames->FindByName( _L( "" ) ) == KErrNotFound );
+    EUNIT_ASSERT( iProfilesNames->FindByName( _L( "dasdasdsadsadasdsadasddddddddddddddddddddddddddddddddddddd" ) ) == KErrNotFound );
+    __UHEAP_MARKEND;
+    }
+
+void T_MProfilesNamesArray::MdcaCountTestL()
+    {
+    __UHEAP_MARK;
+    TInt expectedCount( 5 );
+#ifdef __OFFLINE_MODE
+    ++expectedCount;
+#endif
+#ifdef __DRIVE_MODE
+    ++expectedCount;
+#endif
+    EUNIT_ASSERT( iProfilesNames->MdcaCount() == expectedCount );
+    __UHEAP_MARKEND;
+    
+    }
+
+void T_MProfilesNamesArray::MdcaPointTestL()
+    {
+    __UHEAP_MARK;
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 0 ).Compare( KProfileGeneralName ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 1 ).Compare( KProfileSilentName ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 2 ).Compare( KProfileMeetingName ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 3 ).Compare( KProfileOutdoorName ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 4 ).Compare( KProfilePagerName ) == 0 );
+#ifdef __OFFLINE_MODE
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 5 ).Compare( KProfileOfflineName ) == 0 );
+#endif
+#ifdef __DRIVE_MODE
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 6 ).Compare( KProfileDriveName ) == 0 );
+#endif
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 7 ).Compare( _L( "" ) ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( -1 ).Compare( _L( "" ) ) == 0 );
+    EUNIT_ASSERT( iProfilesNames->MdcaPoint( 12312312 ).Compare( _L( "" ) ) == 0 );
+    __UHEAP_MARKEND;
+    }
+
+
+// Test case table for this test suite class
+EUNIT_BEGIN_TEST_TABLE( T_MProfilesNamesArray, "T_MProfilesNamesArray test suite", "MODULE" )
+
+    EUNIT_TESTCASE("Create test ",			SetupL, CreateTestL, Teardown)
+    EUNIT_TESTCASE("Profile name test ",	SetupL, ProfileNameTestL, Teardown)
+    EUNIT_TESTCASE("Find id test ",			SetupL, FindIdTestL, Teardown)
+    EUNIT_TESTCASE("Find name test ",		SetupL, FindNameTestL, Teardown)
+    EUNIT_TESTCASE("MdcaCount test ",		SetupL, MdcaCountTestL, Teardown)
+    EUNIT_TESTCASE("MdcaPoint test ",		SetupL, MdcaPointTestL, Teardown)
+
+
+EUNIT_END_TESTCASE_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/bwins/T_ProfileEngineWrapperu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/eabi/T_ProfileEngineWrapperu.def	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,25 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+	_ZTI15MT_MProEngTones @ 2 NONAME ; #<TI>#
+	_ZTI16CMyDebugObserver @ 3 NONAME ; #<TI>#
+	_ZTI16MT_MProEngEngine @ 4 NONAME ; #<TI>#
+	_ZTI16MT_ProEngFactory @ 5 NONAME ; #<TI>#
+	_ZTI17MT_MProEngProfile @ 6 NONAME ; #<TI>#
+	_ZTI20MT_CSchedulerUtility @ 7 NONAME ; #<TI>#
+	_ZTI21MT_MProEngProfileName @ 8 NONAME ; #<TI>#
+	_ZTI22MT_MProEngToneSettings @ 9 NONAME ; #<TI>#
+	_ZTI23MT_MProEngNotifyHandler @ 10 NONAME ; #<TI>#
+	_ZTI25MT_MProEngAlertToneSeeker @ 11 NONAME ; #<TI>#
+	_ZTI26MT_MProEngProfileNameArray @ 12 NONAME ; #<TI>#
+	_ZTV15MT_MProEngTones @ 13 NONAME ; #<VT>#
+	_ZTV16CMyDebugObserver @ 14 NONAME ; #<VT>#
+	_ZTV16MT_MProEngEngine @ 15 NONAME ; #<VT>#
+	_ZTV16MT_ProEngFactory @ 16 NONAME ; #<VT>#
+	_ZTV17MT_MProEngProfile @ 17 NONAME ; #<VT>#
+	_ZTV20MT_CSchedulerUtility @ 18 NONAME ; #<VT>#
+	_ZTV21MT_MProEngProfileName @ 19 NONAME ; #<VT>#
+	_ZTV22MT_MProEngToneSettings @ 20 NONAME ; #<VT>#
+	_ZTV23MT_MProEngNotifyHandler @ 21 NONAME ; #<VT>#
+	_ZTV25MT_MProEngAlertToneSeeker @ 22 NONAME ; #<VT>#
+	_ZTV26MT_MProEngProfileNameArray @ 23 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/group/T_ProfileEngineWrapper.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Profiles Engine wrapper tests.
+*
+*/
+
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+TARGET          T_ProfileEngineWrapper.dll
+TARGETTYPE      dll
+
+UID             0x1000af5a 0x01700000
+
+CAPABILITY      ALL -TCB
+
+SOURCEPATH              ../src
+SOURCE                  MT_CSchedulerUtility.cpp
+SOURCE                  MT_ProfileEngineDllMain.cpp
+SOURCE                  T_ProfileTestTools.cpp
+SOURCE                  MT_ProEngFactory.cpp
+SOURCE                  MT_MProEngNotifyHandler.cpp
+SOURCE                  MT_MProEngAlertToneSeeker.cpp
+SOURCE                  MT_MProEngProfile.cpp
+SOURCE                  MT_MProEngProfileName.cpp
+SOURCE                  MT_MProEngTones.cpp
+SOURCE                  MT_MProEngToneSettings.cpp
+SOURCE                  MT_MProEngProfileNameArray.cpp
+SOURCE                  MT_MProEngEngine.cpp
+
+USERINCLUDE		../inc
+USERINCLUDE		../../../../../EngInc
+SYSTEMINCLUDE   	../../../../../WrapperInc
+SYSTEMINCLUDE		../../../../../../../inc
+SYSTEMINCLUDE   	/epoc32/include/digia/EUnit
+SYSTEMINCLUDE           /epoc32/include/Digia/EUnit
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 aknnotify.lib
+LIBRARY                 apgrfx.lib
+LIBRARY                 apmime.lib
+LIBRARY                 bafl.lib
+LIBRARY                 centralrepository.lib
+LIBRARY                 ContentListingFramework.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 EUnit.lib
+LIBRARY                 euser.lib
+LIBRARY                 PlatformEnv.lib
+LIBRARY                 profileeng.lib
+LIBRARY                 ProfileEngine.lib
+LIBRARY                 PbkEng.lib
+LIBRARY                 cntmodel.lib
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building the
+*    Profile Engine wrapper tests
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+
+PRJ_PLATFORMS
+DEFAULT
+
+// Exports for module tests:
+PRJ_TESTEXPORTS
+
+PRJ_TESTMMPFILES
+// MMP-files for module tests:
+T_ProfileEngineWrapper.mmp   // module test dll
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_CSchedulerUtility.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This singleton class takes care of creation of different other
+*                classes needed in PECProfiles.
+*
+*/
+
+
+
+#ifndef MT_CSCHEDULERUTILITY_H
+#define MT_CSCHEDULERUTILITY_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+* A singleton class used to handle starting and stopping a new scheduler-loop
+* This stops the scheduler loop if it was started by this class.
+*
+*  @lib Profiles_PEC.lib
+*  @since 3.0
+*/
+class MT_CSchedulerUtility : public CBase
+    {
+    public: // New functions
+        
+        /**
+        * Create and return instance of MT_CSchedulerUtility.
+        * @since 3.0
+        * @return instance of MT_CSchedulerUtility
+        */
+        //?type ?member_function( ?type ?arg1 );
+        static MT_CSchedulerUtility* InstanceL();
+
+        /**
+        * Destroys the scheduler utility instance.
+        * @since 3.0
+        */
+        static void Release();
+
+        /**
+         * Starts a new scheduler loop if one isn't already started.
+         * @since 3.0
+         */
+        void Start();
+
+        /**
+         * Stops a scheduler loop if it was started by this class.
+         * @since 3.0
+         */
+        void Stop();
+
+    private:
+
+        /**
+        * Two-phased constructor.
+        */
+        static MT_CSchedulerUtility* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~MT_CSchedulerUtility();
+
+        /**
+        * C++ default constructor.
+        */
+        MT_CSchedulerUtility();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+         
+        CActiveSchedulerWait* iWait;
+    };
+
+#endif      // MT_CSCHEDULERUTILITY_H
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngAlertToneSeeker.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: Module tests for Profiles alert tone seeker.
+*
+* Description:
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngAlertToneSeeker.h
+//
+
+#ifndef MT_MPROENGALERTTONESEEKER_H
+#define MT_MPROENGALERTTONESEEKER_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "bamdesca.h"
+#include "MT_CSchedulerUtility.h"
+#include <CEUnitTestSuiteClass.h>
+#include <MProEngAlertToneSeekerObserver.h>
+
+// FORWARD DECLARATIONS
+class MProEngAlertToneSeeker;
+class MT_CProEngAlertToneSeekerObserver;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profiles alert tone seeker.
+*
+*/
+class MT_MProEngAlertToneSeeker
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngAlertToneSeeker* NewL();
+        static MT_MProEngAlertToneSeeker* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngAlertToneSeeker();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngAlertToneSeeker();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void SetupL();
+        void SetupCancelFetchTestL();
+
+    private: // Teardown functions
+
+        void Teardown();
+
+    private: // Test functions
+
+        void FetchAlertToneListTestL();
+        void CancelFetchTestL();
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        MProEngAlertToneSeeker* iSeeker;
+        MT_CProEngAlertToneSeekerObserver* iObserver;
+
+    };
+
+// Helper classes to test notifications:
+//
+
+class MT_CProEngAlertToneSeekerObserver: public CBase,
+        public MProEngAlertToneSeekerObserver
+    {
+    public:
+        static MT_CProEngAlertToneSeekerObserver* NewL()
+            {return new (ELeave) MT_CProEngAlertToneSeekerObserver;}
+        ~MT_CProEngAlertToneSeekerObserver() { delete iToneList; }
+        virtual void HandleAlertToneListCompletedL( MDesCArray* aToneList )
+            { iToneList = aToneList; iNotified = ETrue; MT_CSchedulerUtility::InstanceL()->Stop();}
+
+        virtual void HandleError( TInt aError )
+            { iError = aError; iNotified = ETrue; MT_CSchedulerUtility::InstanceL()->Stop();}
+
+        MDesCArray* iToneList;
+        TInt iNotified;
+        TInt iError;
+    };
+
+#endif      // MT_MPROENGALERTTONESEEKER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngEngine.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Module tests for Profile name array wrapper.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngEngine.h
+//
+
+#ifndef MT_MPROENGENGINE_H
+#define MT_MPROENGENGINE_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <f32file.h>
+#include <bamdesca.h>
+#include <cntdef.h>
+#include "MT_CSchedulerUtility.h"
+#include <CEUnitTestSuiteClass.h>
+
+// FORWARD DECLARATIONS
+class MProEngEngine;
+class MProEngProfile;
+class MProEngEngine;
+class MProfileEngineExtended;
+class MProfilesNamesArray;
+class MProfile;
+class MT_CProEngProfileObserver;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profile name array wrapper.
+*
+*/
+class MT_MProEngEngine
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngEngine* NewL();
+        static MT_MProEngEngine* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngEngine();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngEngine();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+#ifdef __OFFLINE_MODE
+        void Setup5L();
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+        void Setup6L();
+#endif // __DRIVE_MODE
+
+#ifdef __DYNAMIC_PROFILES
+        void SetupDynamicProfilesL();
+        void Setup30L();
+        void Setup31L();
+        void Setup32L();
+        void Setup33L();
+        void Setup34L();
+        void Setup35L();
+        void Setup36L();
+        void Setup37L();
+        void Setup38L();
+        void Setup39L();
+        void Setup40L();
+        void Setup41L();
+        void Setup42L();
+        void Setup43L();
+        void Setup44L();
+        void Setup45L();
+        void Setup46L();
+        void Setup47L();
+        void Setup48L();
+        void Setup49L();
+#endif // __DYNAMIC_PROFILES
+
+    private: // Teardown functions
+
+        void Teardown();
+
+#ifdef __DYNAMIC_PROFILES
+        void TeardownDynamicProfiles();
+#endif // __DYNAMIC_PROFILES
+
+    private: // Test functions
+
+        void ReleaseTestL();
+        void ActiveProfileLCTestL();
+        void ActiveProfileTestL();
+        void ActiveProfileIdTestL();
+        void ProfileNameArrayLCTestL();
+        void SetActiveProfileTestL();
+        void ProfileLCTestL();
+        void ProfileTestL();
+
+#ifdef __DYNAMIC_PROFILES
+        void SetActiveProfileDynamicProfilesTestL();
+        void ProfileDynamicProfilesTestL();
+
+    private: // Helper functions
+
+        void ForcedLeaveL();
+
+#endif // __DYNAMIC_PROFILES
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        TInt iOrigId;
+        TInt iActiveId;
+        // owned
+        MProfileEngineExtended* iInternalEngine;
+        // owned
+        MProEngEngine* iEngine;
+    };
+
+#endif      // MT_MPROENGENGINE_H
+
+// End of File
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngNotifyHandler.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,256 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Module tests for Profile name array wrapper.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngNotifyHandler.h
+//
+
+#ifndef MT_MPROENGNOTIFYHANDLER_H
+#define MT_MPROENGNOTIFYHANDLER_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "MT_CSchedulerUtility.h"
+#include <f32file.h>
+#include <cntdef.h>
+#include <Profile.hrh>
+#include <CEUnitTestSuiteClass.h>
+#include <MProEngProfileActivationObserver.h>
+#include <MProEngActiveProfileObserver.h>
+#include <MProEngProfileObserver.h>
+#include <MProEngProfileNameArrayObserver.h>
+
+// FORWARD DECLARATIONS
+class MProEngNotifyHandler;
+class MProEngProfile;
+class MProEngEngine;
+class MT_CProEngActiveIdObserver;
+class MT_CProEngActiveProfileObserver;
+class MT_CProEngProfileObserver;
+class MT_CProEngNameArrayObserver;
+class CPbkContactEngine;
+class CMyDebugObserver;
+class CRepository;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profiles change notification handler.
+*
+*/
+class MT_MProEngNotifyHandler
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngNotifyHandler* NewL();
+        static MT_MProEngNotifyHandler* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngNotifyHandler();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngNotifyHandler();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void SetupL(  );
+
+        void SetupRequestProfileActivationNotificationsTestL();
+
+        void SetupRequestActiveProfileNotificationsTestL(  );
+
+        void SetupRequestProfileNotificationsTestL();
+
+        void SetupRequestProfileNotificationsTest0L();
+
+        void SetupRequestProfileNotificationsTest1L();
+
+        void SetupRequestProfileNotificationsTest2L();
+
+        void SetupRequestProfileNotificationsTest3L();
+
+        void SetupRequestProfileNotificationsTest4L();
+
+        void SetupRequestProfileNotificationsTest5L();
+
+        void SetupRequestProfileNameArrayNotificationsTestL(  );
+
+        void SetupRequestProfileNameArrayNotificationsTest0L(  );
+
+        void SetupRequestProfileNameArrayNotificationsTest1L(  );
+
+        void SetupRequestProfileNameArrayNotificationsTest2L(  );
+
+        void SetupRequestProfileNameArrayNotificationsTest3L(  );
+
+        void SetupRequestProfileNameArrayNotificationsTest4L(  );
+
+        void SetupRequestProfileNameArrayNotificationsTest5L(  );
+
+        void SetupCancelAllTestL();
+
+    private: // Teardown functions
+
+        void TeardownCommon(  );
+
+        void TeardownRequestProfileActivationNotificationsTest(  );
+
+        void TeardownRequestActiveProfileNotificationsTest(  );
+
+        void TeardownRequestProfileNotificationsTest(  );
+
+        void TeardownRequestProfileNameArrayNotificationsTest(  );
+
+        void TeardownCancelAllTest();
+
+    private: // Test functions
+
+        void RequestProfileActivationNotificationsTestL();
+
+        void RequestActiveProfileNotificationsTestL();
+
+        void RequestProfileNotificationsTestL();
+
+        void RequestProfileNameArrayNotificationsTestL();
+
+        void CancelProfileActivationNotificationsTestL();
+
+        void CancelActiveProfileNotificationsTestL();
+
+        void CancelProfileNotificationsTestL();
+
+        void CancelProfileNameArrayNotificationsTestL();
+
+        void CancelAllTestL();
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        MProEngNotifyHandler* iHandler;
+        MProEngProfile* iProfile;
+        MProEngEngine* iEngine;
+        TInt iProfileId;
+        MT_CProEngActiveIdObserver* iActiveIdObserver;
+        MT_CProEngActiveProfileObserver* iActiveProfileObserver;
+        MT_CProEngProfileObserver* iProfileObserver;
+        MT_CProEngNameArrayObserver* iNameArrayObserver;
+        RArray<TContactItemId> iContactGroups;
+        TProfileRingingVolume iOrigVolume;
+        CPbkContactEngine* iContactEngine;
+        RFs iFs;
+        CMyDebugObserver* iDebugObs;
+
+    };
+
+// Helper classes to test notifications:
+//
+
+class MT_CProEngActiveIdObserver: public CBase,
+                                  public MProEngProfileActivationObserver
+    {
+    public:
+        static MT_CProEngActiveIdObserver* NewL()
+            {return new (ELeave) MT_CProEngActiveIdObserver;}
+        ~MT_CProEngActiveIdObserver() {};
+        void HandleProfileActivatedL( TInt aProfileId )
+            { iError = KErrNone; iProfileId = aProfileId; MT_CSchedulerUtility::InstanceL()->Stop();}
+    
+        void HandleProfileActivationNotificationError( TInt aError )
+            { iError = aError; MT_CSchedulerUtility::InstanceL()->Stop();}
+
+        TInt iProfileId;
+        TInt iError;
+    };
+
+class MT_CProEngActiveProfileObserver: public CBase,
+                                       public MProEngActiveProfileObserver
+    {
+    public:
+        static MT_CProEngActiveProfileObserver* NewL()
+            {return new (ELeave) MT_CProEngActiveProfileObserver;}
+        ~MT_CProEngActiveProfileObserver() {};
+        void HandleActiveProfileModifiedL()
+            { iError = KErrNone; iNotified = ETrue; MT_CSchedulerUtility::InstanceL()->Stop();}
+        void HandleActiveProfileNotificationError( TInt aError )
+            { iError = aError; MT_CSchedulerUtility::InstanceL()->Stop();}
+
+        TBool iNotified;
+        TInt iError;
+    };
+
+class MT_CProEngProfileObserver: public CBase,
+                                 public MProEngProfileObserver
+    {
+    public:
+        static MT_CProEngProfileObserver* NewL()
+            {return new (ELeave) MT_CProEngProfileObserver;}
+        ~MT_CProEngProfileObserver() {};
+        void HandleProfileModifiedL( TInt aProfileId )
+            { iError = KErrNone; iProfileId = aProfileId; MT_CSchedulerUtility::InstanceL()->Stop();}
+        void HandleProfileNotificationError( TInt aError )
+            { iError = aError; MT_CSchedulerUtility::InstanceL()->Stop();}
+
+        TInt iProfileId;
+        TInt iError;
+    };
+
+class MT_CProEngNameArrayObserver: public CBase,
+                                   public MProEngProfileNameArrayObserver
+    {
+    public:
+        static MT_CProEngNameArrayObserver* NewL()
+            {return new (ELeave) MT_CProEngNameArrayObserver;}
+        ~MT_CProEngNameArrayObserver() {};
+        void HandleProfileNameArrayModificationL()
+            { iError = KErrNone; iNotified = ETrue; MT_CSchedulerUtility::InstanceL()->Stop();}
+        void HandleProfileNameArrayNotificationError( TInt aError )
+            { iError = aError; MT_CSchedulerUtility::InstanceL()->Stop();}
+
+        TBool iNotified;
+        TInt iError;
+    };
+
+class CMyDebugObserver: public CActive
+    {
+    public:
+        static CMyDebugObserver* NewL();
+        ~CMyDebugObserver();
+        void RunL();
+        TInt RunError( TInt aError );
+        void DoCancel();
+        void NotifyReqL();
+
+    private:
+        CMyDebugObserver();
+        void ConstructL();
+        CRepository* iRep;
+    };
+
+#endif      // MT_MPROENGNOTIFYHANDLER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngProfile.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,185 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Module tests for Profile name array wrapper.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngProfile.h
+//
+
+#ifndef MT_MPROENGPROFILE_H
+#define MT_MPROENGPROFILE_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <f32file.h>
+#include <bamdesca.h>
+#include <cntdef.h>
+#include "MT_CSchedulerUtility.h"
+#include <CEUnitTestSuiteClass.h>
+#include <MProEngProfileObserver.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfile;
+class MProEngEngine;
+class MProfileEngineExtended;
+class MProfileExtended;
+class MT_CProEngProfileObserver;
+class CPbkContactEngine;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profiles alert tone seeker.
+*
+*/
+class MT_MProEngProfile
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngProfile* NewL();
+        static MT_MProEngProfile* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngProfile();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngProfile();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void EmptySetup();
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+#ifdef __OFFLINE_MODE
+        void Setup5L();
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+        void Setup6L();
+#endif // __DRIVE_MODE
+
+        void SetupSetAlertForTestL();
+
+        void SetupAlertForTestL();
+
+        void SetupAlertForTest0L();
+
+        void SetupSetAlertForTest0L();
+
+        void SetupCommitChangeTest0L();
+
+
+        void SetupAlertForTest1L();
+
+        void SetupSetAlertForTest1L();
+
+        void SetupCommitChangeTest1L();
+
+
+        void SetupAlertForTest2L();
+
+        void SetupSetAlertForTest2L();
+
+        void SetupCommitChangeTest2L();
+
+
+        void SetupAlertForTest3L();
+
+        void SetupSetAlertForTest3L();
+
+        void SetupCommitChangeTest3L();
+
+
+        void SetupAlertForTest4L();
+
+        void SetupSetAlertForTest4L();
+
+        void SetupCommitChangeTest4L();
+
+#ifdef __OFFLINE_MODE
+        void SetupAlertForTest5L();
+
+        void SetupSetAlertForTest5L();
+
+        void SetupCommitChangeTest5L();
+#endif // __OFFLINE_MODE
+
+
+#ifdef __DRIVE_MODE
+        void SetupAlertForTest6L();
+
+        void SetupSetAlertForTest6L();
+
+        void SetupCommitChangeTest6L();
+#endif // __DRIVE_MODE
+
+    private: // Teardown functions
+
+        void EmptyTeardown();
+
+        void Teardown();
+
+        void TeardownAlertForGroups();
+
+    private: // Test functions
+
+        void ReleaseTestL();
+
+        void AlertForTestL();
+
+        void SetAlertForTestL();
+
+        void IsSilentTestL();
+
+        void ProfileNameTestL();
+
+        void ProfileTonesTestL();
+
+        void ToneSettingsTestL();
+
+        void CommitChangeTestL();
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        TInt iProfileId;
+        MProfileEngineExtended* iInternalEngine;
+        MProfileExtended* iInternalProfile;
+        MProEngEngine* iEngine;
+        MProEngProfile* iProfile;
+        RArray<TContactItemId> iContactGroups;
+        CPbkContactEngine* iContactEngine;
+        RFs iFs;
+
+    };
+
+#endif      // MT_MPROENGPROFILE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngProfileName.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Module tests for Profiles alert tone seeker.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngProfileName.h
+//
+
+#ifndef MT_MPROENGPROFILENAME_H
+#define MT_MPROENGPROFILENAME_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <f32file.h>
+#include <bamdesca.h>
+#include <cntdef.h>
+#include "MT_CSchedulerUtility.h"
+#include <CEUnitTestSuiteClass.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileName;
+class MProEngProfile;
+class MProEngEngine;
+class MProfileEngineExtended;
+class MProfile;
+class MT_CProEngProfileObserver;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profiles alert tone seeker.
+*
+*/
+class MT_MProEngProfileName
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngProfileName* NewL();
+        static MT_MProEngProfileName* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngProfileName();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngProfileName();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+#ifdef __OFFLINE_MODE
+        void Setup5L();
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+        void Setup6L();
+#endif // __DRIVE_MODE
+
+    private: // Teardown functions
+
+        void Teardown();
+
+    private: // Test functions
+
+        void GetIdTestL();
+
+        void GetNameTestL();
+
+        void SetNameTestL();
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        TInt iProfileId;
+        // owned
+        MProfileEngineExtended* iInternalEngine;
+        // owned
+        MProfile* iInternalProfile;
+        // owned
+        MProEngEngine* iEngine;
+        // owned
+        MProEngProfile* iProfile;
+
+    };
+
+#endif      // MT_MPROENGPROFILENAME_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngProfileNameArray.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Module tests for Profile name array wrapper.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngProfileNameArray.h
+//
+
+#ifndef MT_MPROENGPROFILENAMEARRAY_H
+#define MT_MPROENGPROFILENAMEARRAY_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <f32file.h>
+#include <bamdesca.h>
+#include <cntdef.h>
+#include "MT_CSchedulerUtility.h"
+#include <CEUnitTestSuiteClass.h>
+
+// FORWARD DECLARATIONS
+class MProEngProfileNameArray;
+class MProEngProfile;
+class MProEngEngine;
+class MProfileEngineExtended;
+class MProfilesNamesArray;
+class MProfile;
+class MT_CProEngProfileObserver;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profile name array wrapper.
+*
+*/
+class MT_MProEngProfileNameArray
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngProfileNameArray* NewL();
+        static MT_MProEngProfileNameArray* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngProfileNameArray();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngProfileNameArray();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void SetupL();
+
+        void SetupDynamicProfilesL();
+
+    private: // Teardown functions
+
+        void Teardown();
+
+        void TeardownDynamicProfiles();
+
+    private: // Test functions
+
+        void ProfileIdTestL();
+
+        void FindByIdTestL();
+
+        void FindByNameTestL();
+
+        void FindByIdDynamicProfileTestL();
+
+        void FindByNameDynamicProfileTestL();
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        TInt iProfileId;
+        // owned
+        MProfileEngineExtended* iInternalEngine;
+        // owned
+        MProEngEngine* iEngine;
+        // owned
+        MProEngProfileNameArray* iArray;
+        // owned
+        MProfilesNamesArray* iInternalArray;
+    };
+
+#endif      // MT_MPROENGPROFILENAMEARRAY_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngToneSettings.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Module tests for Profiles Tones Wrapper interface.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngToneSettings.h
+//
+
+#ifndef MT_MPROENGTONESETTINGS_H
+#define MT_MPROENGTONESETTINGS_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <f32file.h>
+#include <bamdesca.h>
+#include <cntdef.h>
+#include "MT_CSchedulerUtility.h"
+#include <CEUnitTestSuiteClass.h>
+
+// FORWARD DECLARATIONS
+class MProEngToneSettings;
+class MProEngProfile;
+class MProEngEngine;
+class MProfileEngineExtended;
+class MProfile;
+class MT_CProEngProfileObserver;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profiles Tones Wrapper interface.
+*
+*/
+class MT_MProEngToneSettings
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngToneSettings* NewL();
+        static MT_MProEngToneSettings* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngToneSettings();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngToneSettings();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+#ifdef __OFFLINE_MODE
+        void Setup5L();
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+        void Setup6L();
+#endif // __DRIVE_MODE
+
+    private: // Teardown functions
+
+        void Teardown();
+
+    private: // Test functions
+
+        void GetRingingTypeTestL();
+        void GetKeypadVolumeTestL();
+        void GetRingingVolumeTestL();
+        void GetVibraTestL();
+        void GetWarningAndGameTonesTestL();
+        void GetTextToSpeechTestL();
+
+        void SetRingingTypeTestL();
+        void SetKeypadVolumeTestL();
+        void SetRingingVolumeTestL();
+        void SetVibraTestL();
+        void SetWarningAndGameTonesTestL();
+        void SetTextToSpeechTestL();
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        TInt iProfileId;
+        // owned
+        MProfileEngineExtended* iInternalEngine;
+        // owned
+        MProfile* iInternalProfile;
+        // owned
+        MProEngEngine* iEngine;
+        // owned
+        MProEngProfile* iProfile;
+
+    };
+
+#endif      // MT_MPROENGTONESETTINGS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngTones.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Module tests for Profiles Tones Wrapper interface.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngTones.h
+//
+
+#ifndef MT_MPROENGTONES_H
+#define MT_MPROENGTONES_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <f32file.h>
+#include <bamdesca.h>
+#include <cntdef.h>
+#include "MT_CSchedulerUtility.h"
+#include <CEUnitTestSuiteClass.h>
+
+// FORWARD DECLARATIONS
+class MProEngTones;
+class MProEngProfile;
+class MProEngEngine;
+class MProfileEngineExtended;
+class MProfile;
+class MT_CProEngProfileObserver;
+
+// CLASS DECLARATION
+
+/**
+* Module tests for Profiles Tones Wrapper interface.
+*
+*/
+class MT_MProEngTones
+     : public CEUnitTestSuiteClass
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static MT_MProEngTones* NewL();
+        static MT_MProEngTones* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~MT_MProEngTones();
+
+    private:    // Constructors and destructors
+
+        MT_MProEngTones();
+        void ConstructL();
+
+    private: // Setup functions
+
+        void SetupL();
+        void Setup0L();
+        void Setup1L();
+        void Setup2L();
+        void Setup3L();
+        void Setup4L();
+#ifdef __OFFLINE_MODE
+        void Setup5L();
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+        void Setup6L();
+#endif // __DRIVE_MODE
+
+    private: // Teardown functions
+
+        void Teardown();
+
+    private: // Test functions
+
+        void GetRingingTone1TestL();
+        void GetRingingTone2TestL();
+        void GetMessageAlertToneTestL();
+        void GetEmailAlertToneTestL();
+        void GetVideoCallRingingToneTestL();
+
+        void SetRingingTone1TestL();
+        void SetRingingTone2TestL();
+        void SetMessageAlertToneTestL();
+        void SetEmailAlertToneTestL();
+        void SetVideoCallRingingToneTestL();
+        //void SetDRMRingingTone1TestL();
+        //void SetRingingToneSizeLimitTestL();
+        //int GetToneSizeLimitL();
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE;
+
+    private:    // Data
+
+        TInt iProfileId;
+        // owned
+        MProfileEngineExtended* iInternalEngine;
+        // owned
+        MProfile* iInternalProfile;
+        // owned
+        MProEngEngine* iEngine;
+        // owned
+        MProEngProfile* iProfile;
+
+    };
+
+#endif      // MT_MPROENGTONES_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_ProEngFactory.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: EUnitWizard generated test class.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_ProEngFactory.h
+//
+
+#ifndef MT_PROENGFACTORY_H
+#define MT_PROENGFACTORY_H
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <f32file.h>
+
+//  INTERNAL INCLUDES
+
+
+//  FORWARD DECLARATIONS
+class ProEngFactory;
+
+//  CLASS DEFINITION
+/**
+ *
+ * EUnitWizard generated test class. 
+ *
+ */
+class MT_ProEngFactory
+     : public CEUnitTestSuiteClass
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static MT_ProEngFactory* NewL();
+        static MT_ProEngFactory* NewLC();
+        /**
+         * Destructor
+         */
+        ~MT_ProEngFactory();
+
+    private:    // Constructors and destructors
+
+        MT_ProEngFactory();
+        void ConstructL();
+
+	public: 	// From observer interface
+		
+		
+
+    private:    // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         void MT_ProEngFactory_NewEngineLL();
+        
+        
+         void MT_ProEngFactory_NewEngineLCL();
+        
+        
+         void MT_ProEngFactory_NewEngineL_1L();
+        
+        
+         void MT_ProEngFactory_NewEngineLC_1L();
+        
+        
+         void MT_ProEngFactory_NewNotifyHandlerLL();
+        
+        
+         void MT_ProEngFactory_NewAlertToneSeekerLL();
+        
+
+    private:    // Implementation
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    private:    // Data
+
+        RFs iFs;
+    };
+
+#endif      //  MT_PROENGFACTORY_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_ProfileEngine.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: EUnitWizard generated test class.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_ProEngFactory.h
+//
+
+#ifndef MT_PROENGFACTORY_H
+#define MT_PROENGFACTORY_H
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+//  INTERNAL INCLUDES
+
+
+//  FORWARD DECLARATIONS
+class ProEngFactory;
+
+//  CLASS DEFINITION
+/**
+ *
+ * EUnitWizard generated test class. 
+ *
+ */
+class MT_ProEngFactory
+     : public CEUnitTestSuiteClass
+    {
+    public:     // Constructors and destructors
+
+        /**
+         * Two phase construction
+         */
+        static MT_ProEngFactory* NewL();
+        static MT_ProEngFactory* NewLC();
+        /**
+         * Destructor
+         */
+        ~MT_ProEngFactory();
+
+    private:    // Constructors and destructors
+
+        MT_ProEngFactory();
+        void ConstructL();
+
+	public: 	// From observer interface
+		
+		
+
+    private:    // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         void MT_ProEngFactory_NewEngineLL();
+        
+        
+         void MT_ProEngFactory_NewEngineLCL();
+        
+        
+         void MT_ProEngFactory_NewEngineL_1L();
+        
+        
+         void MT_ProEngFactory_NewEngineLC_1L();
+        
+        
+         void MT_ProEngFactory_NewNotifyHandlerLL();
+        
+        
+         void MT_ProEngFactory_NewAlertToneSeekerLL();
+        
+
+    private:    // Data
+
+		EUNIT_DECLARE_TEST_TABLE; 
+		
+    };
+
+#endif      //  MT_PROENGFACTORY_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/T_ProfileTestTools.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Test Tools.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// T_ProfileTestTools.h
+//
+
+// INCLUDES
+#include <e32std.h>
+#include <CNTDEF.H>
+#include <Profile.hrh>
+
+//CONSTS
+
+// default profile names
+_LIT( KProfileGeneralName, "General" );
+_LIT( KProfileSilentName,  "Silent" );
+_LIT( KProfileMeetingName, "Meeting" );
+_LIT( KProfileOutdoorName, "Outdoor" );
+_LIT( KProfilePagerName,   "Pager" );
+#ifdef __OFFLINE_MODE
+_LIT( KProfileOfflineName,   "Off-line" );
+#endif
+#ifdef __DRIVE_MODE
+_LIT( KProfileDriveName,   "Drive" );
+#endif
+_LIT( KProfileInvalidName,   "Invalid" );
+_LIT( KProfileDynamicName,   "New profile" );
+
+// default tone settings
+_LIT( KProfileNokiaTune, "z:\\data\\sounds\\digital\\nokia tune.aac" );
+_LIT( KProfileMessageTone, "z:\\data\\sounds\\digital\\message 1.aac" );
+_LIT( KProfileIMMessageTone, "z:\\data\\sounds\\digital\\Chat alert.aac" );
+_LIT( KProfileBeep, "z:\\data\\sounds\\simple\\beep.rng" );
+_LIT( KProfileBeepTwice, "z:\\data\\sounds\\simple\\beep twice.rng" );
+_LIT( KProfileNoSound, "z:\\resource\\no_sound.wav" );
+
+// Tone size limit testing uses two different sized files.
+// They should be selected according to currently used limit. Initially 600kB.
+_LIT( KProEngMTTestToneSizeOk,     "C:\\data\\sounds\\digital\\mt_below_limit.mp3" );
+_LIT( KProEngMTTestToneSizeTooBig, "C:\\data\\sounds\\digital\\mt_over_limit.mp3" );
+
+#ifdef __WINS__
+_LIT( KProEngMTTestTone, "C:\\Data\\Sounds\\Digital\\flow.aac" );
+#else
+_LIT( KProEngMTTestTone, "Z:\\Data\\Sounds\\Digital\\flow.aac" );
+#endif
+
+#ifdef __WINS__
+// combined delivery
+_LIT( KProEngMTTestDRM_CD_StartEndTone, "C:\\Data\\encrypted\\bee-boogie_start_end.dm" );
+_LIT( KProEngMTTestDRM_CD_5TimesTone, "C:\\Data\\encrypted\\bee-boogie_5times.dm" );
+_LIT( KProEngMTTestDRM_CD_FutureTone, "C:\\Data\\encrypted\\bee-boogie_future.dm" );
+_LIT( KProEngMTTestDRM_CD_1YearTone, "C:\\Data\\encrypted\\bee-boogie_1year.dm" );
+// separate delivery
+_LIT( KProEngMTTestDRM_SD_StartEndTone, "C:\\Data\\encrypted\\bee-boogie_sd_start_end.dcf" );
+_LIT( KProEngMTTestDRM_SD_5TimesTone, "C:\\Data\\encrypted\\bee-boogie_sd_5times.dcf" );
+_LIT( KProEngMTTestDRM_SD_1YearTone, "C:\\Data\\encrypted\\bee-boogie_sd_1year.dcf" );
+_LIT( KProEngMTTestDRM_SD_DisplayOnly, "C:\\Data\\encrypted\\bee-boogie_sd_display_only.dcf" );
+#else
+// Note, that these files must be always downloaded first from
+// http://trsrv42.wirelessfuture.com/content/s60/index.wml 
+// combined delivery
+_LIT( KProEngMTTestDRM_CD_StartEndTone, "C:\\Data\\sounds\\digital\\DDCD_TestTrack2MT.dcf" );
+_LIT( KProEngMTTestDRM_CD_5TimesTone, "C:\\Data\\sounds\\digital\\DDCD_11KHz_55b_MP4_LC.dcf" );
+_LIT( KProEngMTTestDRM_CD_FutureTone, "C:\\Data\\sounds\\digital\\DDCD_mp3FutureRo.dcf" );
+_LIT( KProEngMTTestDRM_CD_1YearTone, "C:\\Data\\sounds\\digital\\DDCD_TestTrack_3_MT.dcf" );
+// separate delivery
+_LIT( KProEngMTTestDRM_SD_StartEndTone, "C:\\Data\\sounds\\digital\\DDSD_TestTrack2MT.dcf" );
+_LIT( KProEngMTTestDRM_SD_5TimesTone, "C:\\Data\\sounds\\digital\\DDSD_11KHz_55b_MP4_LC.dcf" );
+_LIT( KProEngMTTestDRM_SD_1YearTone, "C:\\Data\\sounds\\digital\\DDSD_TestTrack_3_MT.dcf" );
+_LIT( KProEngMTTestDRM_SD_DisplayOnly, "C:\\Data\\sounds\\digital\\SD_unusable_RO.dcf" );
+#endif
+
+_LIT( KProEngMTTestName, "Test Profile" );
+const TProfileRingingType KProEngMTTestRingingType( EProfileRingingTypeAscending );
+const TProfileKeypadVolume KProEngMTTestKeypadVolume( EProfileKeypadVolumeLevel1 );
+const TProfileRingingVolume KProEngMTTestRingingVolume( EProfileRingingVolumeLevel5 );
+
+
+_LIT( KProfileEmpty, "" );
+_LIT( KProfileMinName, "Z" );
+_LIT( KProfileMaxName, "1234567890123456789012345678901234567890123456789012345678901234" ); // 64
+//_LIT( KProfileTooLongProfileName, "1234567890123456789012345678901234567890123456789012345678901234567890" ); // 70
+_LIT( KProfileMaxFileName, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456" ); // 256
+_LIT( KProfileTooLongFileName, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567" ); // 257
+_LIT( KProfileMaxStatusMessage, "1234567890123456789012345678901234567890" );   // 40
+_LIT( KProfileMaxCallObjectText, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" ); // 1000
+_LIT( KProfileTooLongCallObjectText, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901" ); // 1001
+
+const TInt KMaxNumberOfDynamicProfiles( 20 );
+
+
+// FORWARD DECLARATION
+class RFs;
+class MProfile;
+class MProEngProfile;
+class MProEngProfileNameArray;
+class MProfilesNamesArray;
+struct TProfileToneSettings;
+class CPbkContactEngine;
+
+/**
+ * Test Tools
+ */
+class T_ProfileTestTools
+    {
+    public:
+        static void ResetRepository();
+        static TBool CompareArrays( const TArray<TContactItemId>& aArray1, const TArray<TContactItemId>& aArray2 );
+        static TBool CompareNameArrays( const MProEngProfileNameArray& aArray1,
+                                        const MProfilesNamesArray& aArray2 );
+        static TBool CompareProfiles( MProEngProfile& ap1, MProfile& ap2 );
+        static TBool CheckArray( const MProfilesNamesArray& aArray );
+        static const TDesC& ProfileName( TInt aId );
+        static const TDesC& ProfileRingingTone( TInt aId );
+        static const TDesC& ProfileMessageAlertTone( TInt aId );
+        static const TDesC& ProfileIMMessageAlertTone( TInt aId );
+        static const TDesC& ProfileEmailAlertTone( TInt aId );
+        static const TDesC& ProfileVideoCallRingingTone( TInt aId );
+        static TBool CheckToneSettings( TInt aId, const TProfileToneSettings&  aSettings );
+        static void CreateContactGroupsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void DeleteContactGroups( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void CreateContactsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void DeleteContacts( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine );
+        static void WriteAlertForIdsToCenrepL( TInt aProfileId, RArray<TContactItemId>& aArray );
+        static void DeleteAlertForIdsFromCenrep( TInt aProfileId );
+        static TBool IsCenrepFeatureEnabledL( TUid aUid, TUint32 aKey );
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_CSchedulerUtility.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This singleton class takes care of creation of different other
+*                classes needed in PECProfiles.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "MT_CSchedulerUtility.h"
+#include    <e32svr.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// MT_CSchedulerUtility::MT_CSchedulerUtility
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+MT_CSchedulerUtility::MT_CSchedulerUtility()
+    {
+    RDebug::Print( _L( "Digia:MT_CSchedulerUtility::MT_CSchedulerUtility()" ) );
+    }
+
+// -----------------------------------------------------------------------------
+// MT_CSchedulerUtility::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void MT_CSchedulerUtility::ConstructL()
+    {
+    iWait = new ( ELeave ) CActiveSchedulerWait;
+    }
+
+// -----------------------------------------------------------------------------
+// MT_CSchedulerUtility::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+MT_CSchedulerUtility* MT_CSchedulerUtility::NewL()
+    {
+    MT_CSchedulerUtility* self = new( ELeave ) MT_CSchedulerUtility;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+    
+// Destructor
+MT_CSchedulerUtility::~MT_CSchedulerUtility()
+    {
+    Stop();
+    delete iWait;
+    Dll::SetTls( NULL );
+    RDebug::Print( _L( "Digia:MT_CSchedulerUtility::~MT_CSchedulerUtility()" ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// MT_CSchedulerUtility::InstanceL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+MT_CSchedulerUtility* MT_CSchedulerUtility::InstanceL()
+    {
+    TAny* instance = Dll::Tls();
+    if( instance == NULL )
+        {
+        instance = MT_CSchedulerUtility::NewL();
+        TInt err( Dll::SetTls( instance ) );
+        if( err )
+            {
+            delete static_cast<MT_CSchedulerUtility*>( instance );
+            User::Leave( err );
+            }
+        }
+    return static_cast<MT_CSchedulerUtility*>( instance );
+    }
+
+void MT_CSchedulerUtility::Release()
+    {
+    TAny* instance = Dll::Tls();
+    if( instance != NULL )
+        {
+        delete ( static_cast<MT_CSchedulerUtility*>( instance ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// MT_CSchedulerUtility::Start
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void MT_CSchedulerUtility::Start()
+    {
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// MT_CSchedulerUtility::Stop
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void MT_CSchedulerUtility::Stop()
+    {
+    if( iWait->IsStarted() )
+        {
+        iWait->AsyncStop();
+        }
+    }
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngAlertToneSeeker.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngAlertToneSeeker test class.
+*
+*/
+
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngAlertToneSeeker.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngAlertToneSeeker.h"
+
+//  EXTERNAL INCLUDES
+#include <MProEngAlertToneSeeker.h>
+#include <ProEngFactory.h>
+#include <EUnitMacros.h>
+
+MT_MProEngAlertToneSeeker* MT_MProEngAlertToneSeeker::NewL()
+    {
+    MT_MProEngAlertToneSeeker* self = MT_MProEngAlertToneSeeker::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_MProEngAlertToneSeeker* MT_MProEngAlertToneSeeker::NewLC()
+    {
+    MT_MProEngAlertToneSeeker* self = new( ELeave ) MT_MProEngAlertToneSeeker();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+MT_MProEngAlertToneSeeker::~MT_MProEngAlertToneSeeker()
+    {
+    delete iObserver;
+    }
+
+MT_MProEngAlertToneSeeker::MT_MProEngAlertToneSeeker()
+    {
+    }
+
+void MT_MProEngAlertToneSeeker::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    iObserver = MT_CProEngAlertToneSeekerObserver::NewL();
+    }
+
+void MT_MProEngAlertToneSeeker::SetupL()
+    {
+    iSeeker = ProEngFactory::NewAlertToneSeekerL();
+    }
+
+void MT_MProEngAlertToneSeeker::SetupCancelFetchTestL()
+    {
+    SetupL();
+    iObserver->iNotified = EFalse;
+    iSeeker->FetchAlertToneListL( *iObserver );
+    }
+
+void MT_MProEngAlertToneSeeker::Teardown()
+    {
+    delete iObserver->iToneList;
+    iObserver->iToneList = NULL;
+    delete iSeeker;
+    }
+
+void MT_MProEngAlertToneSeeker::FetchAlertToneListTestL()
+    {
+    iSeeker->FetchAlertToneListL( *iObserver );
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iObserver->iNotified );
+    EUNIT_ASSERT( iObserver->iToneList );
+    TInt count( iObserver->iToneList->MdcaCount() );
+    EUNIT_PRINT( _L( "*** Tones: ***" ) );
+    for( TInt i(0); i<count; ++i )
+        {
+        TPtrC tone( iObserver->iToneList->MdcaPoint( i ) );
+        EUNIT_PRINT( _L( "%S" ), &tone );
+        }
+    }
+
+void MT_MProEngAlertToneSeeker::CancelFetchTestL()
+    {
+    EUNIT_PRINT( _L( "CancelFetchTestL begin" ) );
+    if( !iObserver->iNotified )
+        {
+        EUNIT_PRINT( _L( "CancelFetchTestL before seeker->Cancel" ) );
+        iSeeker->CancelFetch();
+        EUNIT_PRINT( _L( "CancelFetchTestL after seeker->Cancel" ) );
+        }
+    EUNIT_ASSERT( ETrue );
+    EUNIT_PRINT( _L( "CancelFetchTestL end" ) );
+    }
+
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_MProEngAlertToneSeeker,
+    "Wrapper API Alert Tone Seeker Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Fetch Alert Tone List - test",
+    "MProEngAlertToneSeeker",
+    "FetchAlertToneListL",
+    "FUNCTIONALITY",
+    SetupL, FetchAlertToneListTestL, Teardown)
+
+EUNIT_TEST(
+    "Cancel Fetch Alert Tone List - test",
+    "MProEngAlertToneSeeker",
+    "CancelFetch",
+    "FUNCTIONALITY",
+    SetupCancelFetchTestL, CancelFetchTestL, Teardown)
+
+EUNIT_END_TEST_TABLE
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngEngine.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1497 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngEngine test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngEngine.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngEngine.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <MProEngEngine.h>
+#include <MProEngProfile.h>
+#include "MProfileEngineExtended.h"
+#include "MProfile.h"
+#include "MProfileExtended.h"
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+#include "ProfileEngineConstants.h"
+
+//  INTERNAL INCLUDES
+#include "T_ProfileTestTools.h"
+
+MT_MProEngEngine* MT_MProEngEngine::NewL()
+    {
+    MT_MProEngEngine* self = MT_MProEngEngine::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_MProEngEngine* MT_MProEngEngine::NewLC()
+    {
+    MT_MProEngEngine* self = new( ELeave ) MT_MProEngEngine();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+
+MT_MProEngEngine::~MT_MProEngEngine()
+    {
+    if( iInternalEngine )
+        {
+        iInternalEngine->Release();
+        iInternalEngine = NULL;
+        }
+    }
+
+
+MT_MProEngEngine::MT_MProEngEngine()
+    {
+    }
+
+void MT_MProEngEngine::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    iInternalEngine = CreateProfileEngineExtendedL();
+    }
+
+
+void MT_MProEngEngine::SetupL()
+    {
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetupL begin" ) );
+    iEngine = ProEngFactory::NewEngineL();
+    iOrigId = iInternalEngine->ActiveProfileId();
+    iInternalEngine->SetActiveProfileL( iActiveId );
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetupL end" ) );
+    }
+
+void MT_MProEngEngine::Setup0L()
+    {
+    iActiveId = 0;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup1L()
+    {
+    iActiveId = 1;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup2L()
+    {
+    iActiveId = 2;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup3L()
+    {
+    iActiveId = 3;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup4L()
+    {
+    iActiveId = 4;
+    SetupL();
+    }
+
+#ifdef __OFFLINE_MODE
+void MT_MProEngEngine::Setup5L()
+    {
+    iActiveId = 5;
+    SetupL();
+    }
+
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+void MT_MProEngEngine::Setup6L()
+    {
+    iActiveId = 6;
+    SetupL();
+    }
+
+#endif // __DRIVE_MODE
+
+#ifdef __DYNAMIC_PROFILES
+void MT_MProEngEngine::SetupDynamicProfilesL()
+    {
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetupDynamicProfilesL begin" ) );
+    const TInt start( KProfileBaseDynamicProfileId );
+    const TInt end( start + KProfilesMaxNumberOfDynamicProfiles );
+    for( TInt i(start); i<end; ++i )
+        {
+        MProfileExtended* p( iInternalEngine->CreateProfileL() );
+        p->Release();
+        }
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetupDynamicProfilesL end" ) );
+    }
+
+void MT_MProEngEngine::Setup30L()
+    {
+    EUNIT_PRINT( _L( "MT_MProEngEngine::Setup30L begin" ) );
+    SetupDynamicProfilesL();
+    iActiveId = 30;
+    SetupL();
+    EUNIT_PRINT( _L( "MT_MProEngEngine::Setup30L end" ) );
+    }
+
+void MT_MProEngEngine::Setup31L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 31;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup32L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 32;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup33L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 33;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup34L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 34;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup35L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 35;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup36L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 36;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup37L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 37;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup38L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 38;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup39L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 39;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup40L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 40;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup41L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 41;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup42L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 42;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup43L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 43;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup44L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 44;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup45L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 45;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup46L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 46;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup47L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 47;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup48L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 48;
+    SetupL();
+    }
+
+void MT_MProEngEngine::Setup49L()
+    {
+    SetupDynamicProfilesL();
+    iActiveId = 49;
+    SetupL();
+    }
+#endif // __DYNAMIC_PROFILES
+
+void MT_MProEngEngine::Teardown()
+    {
+    if( iEngine )
+        {
+        iEngine->Release();
+        iEngine = NULL;
+        }
+    T_ProfileTestTools::ResetRepository();
+    //iInternalEngine->SetActiveProfileL( iOrigId );
+    }
+
+#ifdef __DYNAMIC_PROFILES
+void MT_MProEngEngine::TeardownDynamicProfiles()
+    {
+    Teardown();
+    }
+#endif // __DYNAMIC_PROFILES
+
+void MT_MProEngEngine::ReleaseTestL()
+    {
+    TRAP_IGNORE( ForcedLeaveL() );
+    }
+
+void MT_MProEngEngine::ForcedLeaveL()
+    {
+    MProEngEngine* engine( ProEngFactory::NewEngineL() );
+    CleanupReleasePushL( *engine );
+    User::Leave( KErrGeneral );
+    }
+
+void MT_MProEngEngine::ActiveProfileLCTestL()
+    {
+    MProEngProfile* profile( iEngine->ActiveProfileLC() );
+    MProfile* internalProfile( iInternalEngine->ActiveProfileLC() );
+    TBool result(
+        T_ProfileTestTools::CompareProfiles( *profile, *internalProfile ) );
+    CleanupStack::PopAndDestroy( 2 ); // internalProfile, profile
+    EUNIT_ASSERT( result );
+    }
+
+void MT_MProEngEngine::ActiveProfileTestL()
+    {
+    MProEngProfile* profile( iEngine->ActiveProfileL() );
+    CleanupReleasePushL( *profile );
+    MProfile* internalProfile( iInternalEngine->ActiveProfileL() );
+    TBool result(
+            T_ProfileTestTools::CompareProfiles( *profile, *internalProfile ) );
+    internalProfile->Release();
+    CleanupStack::PopAndDestroy(); // profile
+    EUNIT_ASSERT( result );
+    }
+
+void MT_MProEngEngine::ActiveProfileIdTestL()
+    {
+    TInt id( iEngine->ActiveProfileId() );
+    EUNIT_ASSERT( id == iActiveId );
+    }
+
+void MT_MProEngEngine::ProfileNameArrayLCTestL()
+    {
+    __UHEAP_MARK;
+    MProEngProfileNameArray* array = iEngine->ProfileNameArrayLC();
+    MProfilesNamesArray* array2 = iInternalEngine->ProfilesNamesArrayLC();
+    TBool result( T_ProfileTestTools::CompareNameArrays( *array, *array2 ) );
+    CleanupStack::PopAndDestroy( 2 ); // array2, array
+    __UHEAP_MARKEND;
+    EUNIT_ASSERT( result );
+    }
+
+void MT_MProEngEngine::SetActiveProfileTestL()
+    {
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetActiveProfileTestL begin" ) );
+    TInt lastId( EProfilePagerId + 1 );
+#ifdef __OFFLINE_MODE
+    lastId = EProfileOffLineId + 1;
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+    lastId = EProfileDriveId + 1;
+#endif // __DRIVE_MODE
+    TInt i( 0 );
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetActiveProfileTestL before for-loop" ) );
+    for( ; i<lastId; ++i )
+        {
+        EUNIT_PRINT( _L( "MT_MProEngEngine::SetActiveProfileTestL before iEngine->SetActiveProfileL(%d)" ), i );
+        iEngine->SetActiveProfileL( i );
+        EUNIT_PRINT( _L( "MT_MProEngEngine::SetActiveProfileTestL after iEngine->SetActiveProfileL(%d)" ), i );
+        EUNIT_ASSERT( i == iInternalEngine->ActiveProfileId() );
+        EUNIT_PRINT( _L( "MT_MProEngEngine::SetActiveProfileTestL after ASSERT" ) );
+        }
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetActiveProfileTestL after for before iEngine->SetActiveProfileL(%d)" ), i );
+    TRAPD( err, iEngine->SetActiveProfileL( i ) );
+    EUNIT_PRINT( _L( "MT_MProEngEngine::SetActiveProfileTestL after for after iEngine->SetActiveProfileL(%d)" ), i );
+    EUNIT_ASSERT( err == KErrNotFound );
+    }
+
+void MT_MProEngEngine::ProfileLCTestL()
+    {
+    TInt lastId( EProfilePagerId + 1 );
+#ifdef __OFFLINE_MODE
+    lastId = EProfileOffLineId + 1;
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+    lastId = EProfileDriveId + 1;
+#endif // __DRIVE_MODE
+    TInt i( 0 );
+    EUNIT_PRINT( _L( "MT_MProEngEngine::ProfileLCTestL lastId=%d" ), lastId );
+    for( ; i<lastId; ++i )
+        {
+        EUNIT_PRINT( _L( "MT_MProEngEngine::ProfileLCTestL in for i=%d" ), i );
+        MProEngProfile* p( iEngine->ProfileLC( i ) );
+        MProfileExtended* p2( iInternalEngine->ProfileLC( i ) );
+        TBool result( T_ProfileTestTools::CompareProfiles( *p, *p2 ) );
+        CleanupStack::PopAndDestroy( 2 ); // p2, p
+        EUNIT_ASSERT( result );
+        }
+    EUNIT_PRINT( _L( "MT_MProEngEngine::ProfileLCTestL after for i=%d" ), i );
+    TRAPD( err, MProEngProfile* p = iEngine->ProfileLC( i ) );
+    EUNIT_PRINT( _L( "MT_MProEngEngine::ProfileLCTestL before last assert" ) );
+    EUNIT_ASSERT( err == KErrNotFound );
+    }
+
+void MT_MProEngEngine::ProfileTestL()
+    {
+    TInt lastId( EProfilePagerId + 1 );
+#ifdef __OFFLINE_MODE
+    lastId = EProfileOffLineId + 1;
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+    lastId = EProfileDriveId + 1;
+#endif // __DRIVE_MODE
+    TInt i( 0 );
+    for( ; i<lastId; ++i )
+        {
+        MProEngProfile* p( iEngine->ProfileL( i ) );
+        CleanupReleasePushL( *p );
+        MProfileExtended* p2( iInternalEngine->ProfileL( i ) );
+        TBool result( T_ProfileTestTools::CompareProfiles( *p, *p2 ) );
+        p2->Release();
+        CleanupStack::PopAndDestroy(); // p
+        EUNIT_ASSERT( result );
+        }
+    TRAPD( err, MProEngProfile* p = iEngine->ProfileL( i ) );
+    EUNIT_ASSERT( err == KErrNotFound );
+    }
+
+#ifdef __DYNAMIC_PROFILES
+void MT_MProEngEngine::SetActiveProfileDynamicProfilesTestL()
+    {
+    const TInt start( KProfileBaseDynamicProfileId );
+    const TInt end( start + KProfilesMaxNumberOfDynamicProfiles );
+    TInt i( start );
+    for( ; i<end; ++i )
+        {
+        iEngine->SetActiveProfileL( i );
+        EUNIT_ASSERT( i == iInternalEngine->ActiveProfileId() );
+        }
+    TRAPD( err, iEngine->SetActiveProfileL( i ) );
+    EUNIT_ASSERT( err == KErrNotFound );
+    }
+
+void MT_MProEngEngine::ProfileDynamicProfilesTestL()
+    {
+    const TInt start( KProfileBaseDynamicProfileId );
+    const TInt end( start + KProfilesMaxNumberOfDynamicProfiles );
+    TInt i( start );
+    for( ; i<end; ++i )
+        {
+        MProfileExtended* p2( iInternalEngine->ProfileLC( i ) );
+        MProEngProfile* p( iEngine->ProfileL( i ) );
+        TBool result( T_ProfileTestTools::CompareProfiles( *p, *p2 ) );
+        p->Release();
+        CleanupStack::PopAndDestroy(); // p2
+        EUNIT_ASSERT( result );
+        }
+    TRAPD( err, MProEngProfile* p = iEngine->ProfileLC( i ) );
+    EUNIT_ASSERT( err == KErrNotFound );
+    }
+#endif // __DYNAMIC_PROFILES
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_MProEngEngine,
+    "Profile Engine Wrapper Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Release - test",
+    "MProEngEngine",
+    "Release",
+    "FUNCTIONALITY",
+    Setup0L,
+    ReleaseTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings (object pushed to stack) 0 - test",
+    "MProEngEngine",
+    "ActiveProfileLC",
+    "FUNCTIONALITY",
+    Setup0L,
+    ActiveProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings 0 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup0L,
+    ActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile id 0 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup0L,
+    ActiveProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile name array 0 - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup0L,
+    ProfileNameArrayLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set active profile 0 - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings (object pushed to stack) 0 - test",
+    "MProEngEngine",
+    "ProfileLC",
+    "FUNCTIONALITY",
+    Setup0L,
+    ProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings 0 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup0L,
+    ProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings (object pushed to stack) 1 - test",
+    "MProEngEngine",
+    "ActiveProfileLC",
+    "FUNCTIONALITY",
+    Setup1L,
+    ActiveProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings 1 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup1L,
+    ActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile id 1 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup1L,
+    ActiveProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile name array 1 - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup1L,
+    ProfileNameArrayLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set active profile 1 - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings (object pushed to stack) 1 - test",
+    "MProEngEngine",
+    "ProfileLC",
+    "FUNCTIONALITY",
+    Setup1L,
+    ProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings 1 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup1L,
+    ProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings (object pushed to stack) 2 - test",
+    "MProEngEngine",
+    "ActiveProfileLC",
+    "FUNCTIONALITY",
+    Setup2L,
+    ActiveProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings 2 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup2L,
+    ActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile id 2 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup2L,
+    ActiveProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile name array 2 - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup2L,
+    ProfileNameArrayLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set active profile 2 - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings (object pushed to stack) 2 - test",
+    "MProEngEngine",
+    "ProfileLC",
+    "FUNCTIONALITY",
+    Setup2L,
+    ProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings 2 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup2L,
+    ProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings (object pushed to stack) 3 - test",
+    "MProEngEngine",
+    "ActiveProfileLC",
+    "FUNCTIONALITY",
+    Setup3L,
+    ActiveProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings 3 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup3L,
+    ActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile id 3 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup3L,
+    ActiveProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile name array 3 - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup3L,
+    ProfileNameArrayLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set active profile 3 - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings (object pushed to stack) 3 - test",
+    "MProEngEngine",
+    "ProfileLC",
+    "FUNCTIONALITY",
+    Setup3L,
+    ProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings 3 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup3L,
+    ProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings (object pushed to stack) 4 - test",
+    "MProEngEngine",
+    "ActiveProfileLC",
+    "FUNCTIONALITY",
+    Setup4L,
+    ActiveProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings 4 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup4L,
+    ActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile id 4 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup4L,
+    ActiveProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile name array 4 - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup4L,
+    ProfileNameArrayLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set active profile 4 - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings (object pushed to stack) 4 - test",
+    "MProEngEngine",
+    "ProfileLC",
+    "FUNCTIONALITY",
+    Setup4L,
+    ProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings 4 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup4L,
+    ProfileTestL,
+    Teardown)
+
+#ifdef __OFFLINE_MODE
+EUNIT_TEST(
+    "Get Active profile settings (object pushed to stack) 5 - test",
+    "MProEngEngine",
+    "ActiveProfileLC",
+    "FUNCTIONALITY",
+    Setup5L,
+    ActiveProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings 5 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup5L,
+    ActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile id 5 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup5L,
+    ActiveProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile name array 5 - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup5L,
+    ProfileNameArrayLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set active profile 5 - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings (object pushed to stack) 5 - test",
+    "MProEngEngine",
+    "ProfileLC",
+    "FUNCTIONALITY",
+    Setup5L,
+    ProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings 5 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup5L,
+    ProfileTestL,
+    Teardown)
+
+#endif // __OFFLINE_MODE
+
+#ifdef __DRIVE_MODE
+EUNIT_TEST(
+    "Get Active profile settings (object pushed to stack) 6 - test",
+    "MProEngEngine",
+    "ActiveProfileLC",
+    "FUNCTIONALITY",
+    Setup6L,
+    ActiveProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile settings 6 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup6L,
+    ActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Active profile id 6 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup6L,
+    ActiveProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile name array 6 - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup6L,
+    ProfileNameArrayLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set active profile 6 - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetActiveProfileTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings (object pushed to stack) 6 - test",
+    "MProEngEngine",
+    "ProfileLC",
+    "FUNCTIONALITY",
+    Setup6L,
+    ProfileLCTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get profile settings 6 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup6L,
+    ProfileTestL,
+    Teardown)
+
+#endif // __DRIVE_MODE
+#ifdef __DYNAMIC_PROFILES
+EUNIT_TEST(
+    "Get Profiles name array with user created profiles - test",
+    "MProEngEngine",
+    "ProfileNameArrayLC",
+    "FUNCTIONALITY",
+    Setup30L,
+    ProfileNameArrayLCTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Set Active Profile (user created profile) - test",
+    "MProEngEngine",
+    "SetActiveProfileL",
+    "FUNCTIONALITY",
+    Setup30L,
+    SetActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 30 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup30L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 30 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup30L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 30 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup30L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 31 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup31L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 31 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup31L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 31 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup31L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 32 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup32L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 32 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup32L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 32 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup32L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 33 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup33L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 33 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup33L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 33 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup33L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 34 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup34L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 34 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup34L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 34 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup34L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 35 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup35L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 35 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup35L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 35 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup35L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 36 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup36L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 36 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup36L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 36 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup36L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 37 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup37L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 37 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup37L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 37 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup37L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 38 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup38L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 38 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup38L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 38 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup38L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 39 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup39L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 39 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup39L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 39 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup39L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 40 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup40L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 40 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup40L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 40 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup40L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 41 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup41L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 41 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup41L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 41 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup41L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 42 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup42L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 42 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup42L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 42 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup42L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 43 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup43L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 43 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup43L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 43 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup43L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 44 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup44L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 44 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup44L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 44 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup44L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 45 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup45L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 45 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup45L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 45 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup45L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 46 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup46L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 46 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup46L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 46 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup46L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 47 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup47L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 47 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup47L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 47 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup47L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 48 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup48L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 48 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup48L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 48 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup48L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile ID (user created profile) 49 - test",
+    "MProEngEngine",
+    "ActiveProfileId",
+    "FUNCTIONALITY",
+    Setup49L,
+    ActiveProfileIdTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Active Profile settings (user created profile) 49 - test",
+    "MProEngEngine",
+    "ActiveProfileL",
+    "FUNCTIONALITY",
+    Setup49L,
+    ActiveProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Get Profile settings (user created profile) 49 - test",
+    "MProEngEngine",
+    "ProfileL",
+    "FUNCTIONALITY",
+    Setup49L,
+    ProfileTestL,
+    TeardownDynamicProfiles)
+
+#endif // __DYNAMIC_PROFILES
+
+EUNIT_END_TEST_TABLE
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngNotifyHandler.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,819 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngNotifyHandler test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngNotifyHandler.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngNotifyHandler.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <MProEngNotifyHandler.h>
+#include <MProEngProfile.h>
+#include <MProEngEngine.h>
+#include <MProEngTones.h>
+#include <MProEngProfileName.h>
+#include <MProEngToneSettings.h>
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+#include <CPbkContactEngine.h>
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+
+//  INTERNAL INCLUDES
+#include "T_ProfileTestTools.h"
+
+// CONSTANTS
+namespace
+    {
+    const TInt KProEngUndefinedError = -999;
+    }
+
+// CONSTRUCTION
+MT_MProEngNotifyHandler* MT_MProEngNotifyHandler::NewL()
+    {
+    MT_MProEngNotifyHandler* self = MT_MProEngNotifyHandler::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_MProEngNotifyHandler* MT_MProEngNotifyHandler::NewLC()
+    {
+    MT_MProEngNotifyHandler* self = new( ELeave ) MT_MProEngNotifyHandler();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+MT_MProEngNotifyHandler::~MT_MProEngNotifyHandler()
+    {
+    if( iProfile )
+        {
+        iProfile->Release();
+        }
+    if( iEngine )
+        {
+        iEngine->Release();
+        }
+    delete iActiveIdObserver;
+    iActiveIdObserver = NULL;
+    delete iActiveProfileObserver;
+    iActiveProfileObserver = NULL;
+    delete iProfileObserver;
+    iProfileObserver = NULL;
+    delete iNameArrayObserver;
+    iNameArrayObserver = NULL;
+    MT_CSchedulerUtility::Release();
+    iFs.Close();
+    delete iDebugObs;
+    }
+
+// Default constructor
+MT_MProEngNotifyHandler::MT_MProEngNotifyHandler()
+    {
+    }
+
+// Second phase construct
+void MT_MProEngNotifyHandler::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    User::LeaveIfError( iFs.Connect() );
+    iEngine = ProEngFactory::NewEngineL();
+    MT_CSchedulerUtility::InstanceL();
+    iDebugObs = CMyDebugObserver::NewL(); 
+    }
+
+//  METHODS
+
+
+// Setup methods:
+//
+
+void MT_MProEngNotifyHandler::SetupCancelAllTestL()
+    {
+    iHandler = ProEngFactory::NewNotifyHandlerL();
+    iActiveIdObserver = MT_CProEngActiveIdObserver::NewL();
+    iActiveProfileObserver = MT_CProEngActiveProfileObserver::NewL();
+    iNameArrayObserver = MT_CProEngNameArrayObserver::NewL();
+    iProfileObserver = MT_CProEngProfileObserver::NewL();
+    iProfileId = 0;
+    }
+
+void MT_MProEngNotifyHandler::SetupRequestProfileActivationNotificationsTestL()
+    {
+    iHandler = ProEngFactory::NewNotifyHandlerL();
+    iActiveIdObserver = MT_CProEngActiveIdObserver::NewL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestActiveProfileNotificationsTestL(  )
+    {
+    iHandler = ProEngFactory::NewNotifyHandlerL();
+    iActiveProfileObserver = MT_CProEngActiveProfileObserver::NewL();
+    iProfileId = iEngine->ActiveProfileId();
+    iProfile = iEngine->ActiveProfileL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNotificationsTestL()
+    {
+    iHandler = ProEngFactory::NewNotifyHandlerL();
+    iProfileObserver = MT_CProEngProfileObserver::NewL();
+    iProfile = iEngine->ProfileL( iProfileId );
+    iContactEngine = CPbkContactEngine::NewL( &iFs );
+    T_ProfileTestTools::CreateContactGroupsL( 5, iContactGroups, *iContactEngine );
+    }
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNotificationsTest0L()
+    {
+    iProfileId = 0;
+    SetupRequestProfileNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNotificationsTest1L()
+    {
+    iProfileId = 1;
+    SetupRequestProfileNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNotificationsTest2L()
+    {
+    iProfileId = 2;
+    SetupRequestProfileNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNotificationsTest3L()
+    {
+    iProfileId = 3;
+    SetupRequestProfileNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNotificationsTest4L()
+    {
+    iProfileId = 4;
+    SetupRequestProfileNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNotificationsTest5L()
+    {
+    iProfileId = 5;
+    SetupRequestProfileNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNameArrayNotificationsTestL(  )
+    {
+    iDebugObs->NotifyReqL();
+    iHandler = ProEngFactory::NewNotifyHandlerL();
+    iNameArrayObserver = MT_CProEngNameArrayObserver::NewL();
+    iProfile = iEngine->ProfileL( iProfileId );
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNameArrayNotificationsTest0L(  )
+    {
+    iProfileId = 0;
+    SetupRequestProfileNameArrayNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNameArrayNotificationsTest1L(  )
+    {
+    iProfileId = 1;
+    SetupRequestProfileNameArrayNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNameArrayNotificationsTest2L(  )
+    {
+    iProfileId = 2;
+    SetupRequestProfileNameArrayNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNameArrayNotificationsTest3L(  )
+    {
+    iProfileId = 3;
+    SetupRequestProfileNameArrayNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNameArrayNotificationsTest4L(  )
+    {
+    iProfileId = 4;
+    SetupRequestProfileNameArrayNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupRequestProfileNameArrayNotificationsTest5L(  )
+    {
+    iProfileId = 5;
+    SetupRequestProfileNameArrayNotificationsTestL();
+    } 
+
+void MT_MProEngNotifyHandler::SetupL(  )
+    {
+    }
+
+/// Teardown functions:
+//
+
+void MT_MProEngNotifyHandler::TeardownCommon(  )
+    {
+    delete iHandler;
+    iHandler = NULL;
+
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    T_ProfileTestTools::ResetRepository();
+    }
+
+void MT_MProEngNotifyHandler::TeardownRequestProfileActivationNotificationsTest(  )
+    {
+    iHandler->CancelProfileActivationNotifications();
+    delete iActiveIdObserver;
+    iActiveIdObserver = NULL;
+
+    delete iHandler;
+    iHandler = NULL;
+
+    T_ProfileTestTools::ResetRepository();
+    }
+
+void MT_MProEngNotifyHandler::TeardownRequestActiveProfileNotificationsTest(  )
+    {
+    iHandler->CancelActiveProfileNotifications();
+    delete iActiveProfileObserver;
+    iActiveProfileObserver = NULL;
+    TeardownCommon();
+    T_ProfileTestTools::ResetRepository();
+    }
+
+void MT_MProEngNotifyHandler::TeardownRequestProfileNotificationsTest(  )
+    {
+    iHandler->CancelProfileNotifications( iProfileId );
+    delete iProfileObserver;
+    iProfileObserver = NULL;
+    TeardownCommon();
+    TRAP_IGNORE( T_ProfileTestTools::DeleteContactGroups(
+                iContactGroups, *iContactEngine ) );
+    delete iContactEngine;
+    iContactGroups.Close();
+    }
+
+void MT_MProEngNotifyHandler::TeardownRequestProfileNameArrayNotificationsTest(  )
+    {
+    iDebugObs->Cancel();
+    iHandler->CancelProfileNameArrayNotifications();
+    delete iNameArrayObserver;
+    iNameArrayObserver = NULL;
+    TeardownCommon();
+    }
+
+void MT_MProEngNotifyHandler::TeardownCancelAllTest(  )
+    {
+    delete iActiveIdObserver;
+    iActiveIdObserver = NULL;
+    delete iActiveProfileObserver;
+    iActiveProfileObserver = NULL;
+    delete iProfileObserver;
+    iProfileObserver = NULL;
+    delete iNameArrayObserver;
+    iNameArrayObserver = NULL;
+
+    delete iHandler;
+    iHandler = NULL;
+    }
+
+/// Test functions
+//
+
+void MT_MProEngNotifyHandler::RequestProfileActivationNotificationsTestL(  )
+    {
+    TInt result( iHandler->RequestProfileActivationNotificationsL(
+                 *iActiveIdObserver ) );
+    EUNIT_ASSERT( result == KErrNone );
+    iActiveIdObserver->iProfileId = 0;
+    iActiveIdObserver->iError = KProEngUndefinedError;
+    iEngine->SetActiveProfileL( 2 );
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iActiveIdObserver->iProfileId == 2 );
+    EUNIT_ASSERT( iActiveIdObserver->iError == KErrNone );
+    iHandler->CancelProfileActivationNotifications();
+    }
+
+void MT_MProEngNotifyHandler::RequestActiveProfileNotificationsTestL(  )
+    {
+    TInt result( iHandler->RequestActiveProfileNotificationsL(
+                 *iActiveProfileObserver ) );
+    EUNIT_ASSERT( result == KErrNone );
+    iActiveProfileObserver->iNotified = EFalse;
+    iActiveProfileObserver->iError = KProEngUndefinedError;
+    MProEngToneSettings& ts = iProfile->ToneSettings();
+    ts.SetRingingVolume( EProfileRingingVolumeLevel5 );
+    iProfile->CommitChangeL();
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iActiveProfileObserver->iNotified );
+    EUNIT_ASSERT( iActiveProfileObserver->iError == KErrNone );
+    iHandler->CancelActiveProfileNotifications();
+    }
+
+void MT_MProEngNotifyHandler::RequestProfileNotificationsTestL(  )
+    {
+    EUNIT_PRINT( _L( "RequestProfileNotificationsTestL before req" ) );
+    TInt result( iHandler->RequestProfileNotificationsL(
+                 *iProfileObserver, iProfileId ) );
+    EUNIT_PRINT( _L( "RequestProfileNotificationsTestL result=%d" ), result );
+    EUNIT_PRINT( _L( "RequestProfileNotificationsTestL after req" ) );
+#ifndef __OFFLINE_MODE
+    if( iProfileId == EProfileOffLineId )
+        {
+        EUNIT_ASSERT( result == KErrNotFound );
+        return;
+        }
+#endif // __OFFLINE_MODE
+    EUNIT_ASSERT( result == KErrNone );
+    MProEngTones& tones = iProfile->ProfileTones();
+    MProEngToneSettings& ts = iProfile->ToneSettings();
+
+    if( ( iProfileId != EProfileOffLineId ) )
+        {
+        iProfileObserver->iProfileId = -1;
+        iProfileObserver->iError = KProEngUndefinedError;
+
+        EUNIT_PRINT( _L( "ReqNotificationsTestL rtype before set:%d" ), ts.RingingType() );
+        User::LeaveIfError( ts.SetRingingType( EProfileRingingTypeAscending ) );
+        EUNIT_PRINT( _L( "ReqNotificationsTestL rtype after set:%d" ), ts.RingingType() );
+        iProfile->CommitChangeL();
+        MT_CSchedulerUtility::InstanceL()->Start();
+        EUNIT_PRINT( _L( "ReqNotificationsTestL observer->iProfileId:%d" ), iProfileObserver->iProfileId );
+        EUNIT_PRINT( _L( "ReqNotificationsTestL iProfileId:%d" ), iProfileId );
+        EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+        EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+        }
+
+    iProfileObserver->iProfileId = -1;
+    iProfileObserver->iError = KProEngUndefinedError;
+
+    EUNIT_PRINT( _L( "ReqNotificationsTestL keyvol before set:%d" ), ts.KeypadVolume() );
+    if( ( iProfileId == 4 ) || ( iProfileId == 5 ) )
+        {
+        User::LeaveIfError( ts.SetKeypadVolume( EProfileKeypadVolumeLevel1 ) );
+        }
+    else
+        {
+        User::LeaveIfError( ts.SetKeypadVolume( EProfileKeypadVolumeLevel2 ) );
+        }
+    EUNIT_PRINT( _L( "ReqNotificationsTestL keyvol after set:%d" ), ts.KeypadVolume() );
+    iProfile->CommitChangeL();
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+    EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+    iProfileObserver->iProfileId = -1;
+    iProfileObserver->iError = KProEngUndefinedError;
+
+    EUNIT_PRINT( _L( "ReqNotificationsTestL rvol before set:%d" ), ts.RingingVolume() );
+    User::LeaveIfError( ts.SetRingingVolume( EProfileRingingVolumeLevel5 ) );
+    EUNIT_PRINT( _L( "ReqNotificationsTestL rvol after set:%d" ), ts.RingingVolume() );
+    iProfile->CommitChangeL();
+    EUNIT_PRINT( _L( "ReqNotificationsTestL rvol after CommitChangeL" ) );
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+    EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+    iProfileObserver->iProfileId = -1;
+    iProfileObserver->iError = KProEngUndefinedError;
+
+    EUNIT_PRINT( _L( "ReqNotificationsTestL before vibra" ) );
+    if( ( iProfileId == EProfileOutdoorId ) || ( iProfileId == EProfilePagerId ) )
+        {
+        User::LeaveIfError( ts.SetVibratingAlert( EFalse ) );
+        }
+    else
+        {
+        User::LeaveIfError( ts.SetVibratingAlert( ETrue ) );
+        }
+    EUNIT_PRINT( _L( "ReqNotificationsTestL after vibra" ) );
+    iProfile->CommitChangeL();
+    EUNIT_PRINT( _L( "ReqNotificationsTestL after vibra commit" ) );
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+    EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+    iProfileObserver->iProfileId = -1;
+    iProfileObserver->iError = KProEngUndefinedError;
+
+    EUNIT_PRINT( _L( "ReqNotificationsTestL before warn&games" ) );
+    if( ( iProfileId == EProfileSilentId ) || ( iProfileId == EProfileMeetingId ) )
+        {
+        User::LeaveIfError( ts.SetWarningAndGameTones( ETrue ) );
+        }
+    else
+        {
+        User::LeaveIfError( ts.SetWarningAndGameTones( EFalse ) );
+        }
+    EUNIT_PRINT( _L( "ReqNotificationsTestL after warn&games" ) );
+    iProfile->CommitChangeL();
+    EUNIT_PRINT( _L( "ReqNotificationsTestL after warn&games commit" ) );
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+    EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+    if( ( iProfileId != EProfileOffLineId ) )
+        {
+        iProfileObserver->iProfileId = -1;
+        iProfileObserver->iError = KProEngUndefinedError;
+
+        EUNIT_PRINT( _L( "ReqNotificationsTestL before tts" ) );
+        User::LeaveIfError( ts.SetTextToSpeech( ETrue ) );
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after tts" ) );
+        iProfile->CommitChangeL();
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after tts commit" ) );
+        MT_CSchedulerUtility::InstanceL()->Start();
+        EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+        EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+        iProfileObserver->iProfileId = -1;
+        iProfileObserver->iError = KProEngUndefinedError;
+
+        EUNIT_PRINT( _L( "ReqNotificationsTestL before rtone1" ) );
+        User::LeaveIfError( tones.SetRingingTone1L( KProEngMTTestTone ) );
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after rtone1" ) );
+        iProfile->CommitChangeL();
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after rtone1 commit" ) );
+        MT_CSchedulerUtility::InstanceL()->Start();
+        EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+        EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+        iProfileObserver->iProfileId = -1;
+        iProfileObserver->iError = KProEngUndefinedError;
+
+        EUNIT_PRINT( _L( "ReqNotificationsTestL before rtone2" ) );
+        User::LeaveIfError( tones.SetRingingTone2L( KProEngMTTestTone ) );
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after rtone2" ) );
+        iProfile->CommitChangeL();
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after rtone2 commit" ) );
+        iProfile->CommitChangeL();
+        MT_CSchedulerUtility::InstanceL()->Start();
+        EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+        EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+        }
+
+    iProfileObserver->iProfileId = -1;
+    iProfileObserver->iError = KProEngUndefinedError;
+
+    EUNIT_PRINT( _L( "ReqNotificationsTestL before msgtone" ) );
+    User::LeaveIfError( tones.SetMessageAlertToneL( KProEngMTTestTone ) );
+    EUNIT_PRINT( _L( "ReqNotificationsTestL after msgtone" ) );
+    iProfile->CommitChangeL();
+    EUNIT_PRINT( _L( "ReqNotificationsTestL after msgtone commit" ) );
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+    EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+    if( ( iProfileId != EProfileOffLineId ) )
+        {
+        iProfileObserver->iProfileId = -1;
+        iProfileObserver->iError = KProEngUndefinedError;
+
+        EUNIT_PRINT( _L( "ReqNotificationsTestL before email" ) );
+        User::LeaveIfError( tones.SetEmailAlertToneL( KProEngMTTestTone ) );
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after email" ) );
+        iProfile->CommitChangeL();
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after email commit" ) );
+        MT_CSchedulerUtility::InstanceL()->Start();
+        EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+        EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+
+        iProfileObserver->iProfileId = -1;
+        iProfileObserver->iError = KProEngUndefinedError;
+
+        EUNIT_PRINT( _L( "ReqNotificationsTestL before video" ) );
+        User::LeaveIfError( tones.SetVideoCallRingingToneL( KProEngMTTestTone ) );
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after video" ) );
+        iProfile->CommitChangeL();
+        EUNIT_PRINT( _L( "ReqNotificationsTestL after video commit" ) );
+        MT_CSchedulerUtility::InstanceL()->Start();
+        EUNIT_ASSERT( iProfileObserver->iProfileId == iProfileId );
+        EUNIT_ASSERT( iProfileObserver->iError == KErrNone );
+        }
+
+    iHandler->CancelProfileNotifications( iProfileId );
+    }
+
+void MT_MProEngNotifyHandler::RequestProfileNameArrayNotificationsTestL(  )
+    {
+    EUNIT_PRINT( _L( "CMyDebugObserver::ReqNameArrayNot begin" ) );
+    TInt result( iHandler->RequestProfileNameArrayNotificationsL(
+                 *iNameArrayObserver ) );
+    EUNIT_PRINT( _L( "RequestNameArrayNotif result=%d" ), result );
+    EUNIT_ASSERT( result == KErrNone );
+    iNameArrayObserver->iNotified = EFalse;
+    iNameArrayObserver->iError = KProEngUndefinedError;
+    MProEngProfileName& name = iProfile->ProfileName();
+    const TDesC& n( name.Name() );
+    const TDesC& t( KProEngMTTestName() );
+    EUNIT_PRINT( _L( "RequestNameArrayNotif KProEngMTTestName=%S" ), &t );
+    EUNIT_PRINT( _L( "RequestNameArrayNotif name before set:%S" ), &n );
+    User::LeaveIfError( name.SetNameL( KProEngMTTestName ) );
+    const TDesC& n2( name.Name() );
+    EUNIT_PRINT( _L( "RequestNameArrayNotif name after set:%S" ), &n2 );
+    iProfile->CommitChangeL();
+    MT_CSchedulerUtility::InstanceL()->Start();
+    EUNIT_ASSERT( iNameArrayObserver->iNotified );
+    EUNIT_ASSERT( iNameArrayObserver->iError == KErrNone );
+    iHandler->CancelProfileNameArrayNotifications();
+    }
+
+void MT_MProEngNotifyHandler::CancelProfileActivationNotificationsTestL(  )
+    {
+    __UHEAP_MARK;
+    TInt result( iHandler->RequestProfileActivationNotificationsL(
+                 *iActiveIdObserver ) );
+    EUNIT_ASSERT( result == KErrNone );
+    iHandler->CancelProfileActivationNotifications();
+    EUNIT_ASSERT( ETrue );
+    __UHEAP_MARKEND;
+    }
+
+void MT_MProEngNotifyHandler::CancelActiveProfileNotificationsTestL(  )
+    {
+    __UHEAP_MARK;
+    TInt result( iHandler->RequestActiveProfileNotificationsL(
+                 *iActiveProfileObserver ) );
+    EUNIT_ASSERT( result == KErrNone );
+    iHandler->CancelActiveProfileNotifications();
+    EUNIT_ASSERT( ETrue );
+    __UHEAP_MARKEND;
+    }
+
+void MT_MProEngNotifyHandler::CancelProfileNotificationsTestL(  )
+    {
+    TInt result( iHandler->RequestProfileNotificationsL(
+                 *iProfileObserver, iProfileId ) );
+    EUNIT_ASSERT( result == KErrNone );
+    iHandler->CancelProfileNotifications( iProfileId );
+    EUNIT_ASSERT( ETrue );
+    }
+
+void MT_MProEngNotifyHandler::CancelProfileNameArrayNotificationsTestL(  )
+    {
+    __UHEAP_MARK;
+    TInt result( iHandler->RequestProfileNameArrayNotificationsL(
+                 *iNameArrayObserver ) );
+    EUNIT_ASSERT( result == KErrNone );
+    iHandler->CancelProfileNameArrayNotifications();
+    EUNIT_ASSERT( ETrue );
+    __UHEAP_MARKEND;
+    }
+
+void MT_MProEngNotifyHandler::CancelAllTestL(  )
+    {
+    TInt result( iHandler->RequestProfileActivationNotificationsL(
+                 *iActiveIdObserver ) );
+    EUNIT_ASSERT( result == KErrNone );
+    result = iHandler->RequestActiveProfileNotificationsL(
+                 *iActiveProfileObserver );
+    EUNIT_ASSERT( result == KErrNone );
+    result = iHandler->RequestProfileNotificationsL(
+                 *iProfileObserver, iProfileId );
+    EUNIT_ASSERT( result == KErrNone );
+    result = iHandler->RequestProfileNameArrayNotificationsL(
+                 *iNameArrayObserver );
+    EUNIT_ASSERT( result == KErrNone );
+    iHandler->CancelAll();
+    EUNIT_ASSERT( ETrue );
+    }
+
+CMyDebugObserver::CMyDebugObserver()
+    : CActive( EPriorityStandard )
+    {
+    }
+
+CMyDebugObserver::~CMyDebugObserver()
+    {
+    delete iRep;
+    }
+
+CMyDebugObserver* CMyDebugObserver::NewL()
+    {
+    CMyDebugObserver* self = new ( ELeave ) CMyDebugObserver();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+void CMyDebugObserver::RunL()
+    {
+    NotifyReqL();
+    EUNIT_PRINT( _L( "CMyDebugObserver::RunL: iStatus=%u" ), iStatus.Int() );
+    }
+
+TInt CMyDebugObserver::RunError( TInt aError )
+    {
+    EUNIT_PRINT( _L( "CMyDebugObserver::RunError: aError=%d" ), aError );
+    return KErrNone;
+    }
+
+void CMyDebugObserver::DoCancel()
+    {
+    EUNIT_PRINT( _L( "Docancel: errcode=%d" ), iRep->NotifyCancel( 0x00000002, 0x40FFFFFF ) );
+    }
+
+void CMyDebugObserver::NotifyReqL()
+    {
+    EUNIT_PRINT( _L( "CMyDebugObserver::NotifyReqL" ) );
+    User::LeaveIfError( iRep->NotifyRequest( 0x00000002, 0x40FFFFFF, iStatus ) );
+    SetActive();
+    }
+
+void CMyDebugObserver::ConstructL()
+    {
+    EUNIT_PRINT( _L( "CMyDebugObserver::ConstructL" ) );
+    iRep = CRepository::NewL( KCRUidProfileEngine );
+    CActiveScheduler::Add( this );
+    }
+
+//  TEST TABLE
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_MProEngNotifyHandler,
+    "Wrapper API Notification Handler Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Request profile activation notifications - test",
+    "MProEngNotifyHandler",
+    "RequestProfileActivationNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileActivationNotificationsTestL,
+    RequestProfileActivationNotificationsTestL,
+    TeardownRequestProfileActivationNotificationsTest)
+
+EUNIT_TEST(
+    "Request active profile notifications - test",
+    "MProEngNotifyHandler",
+    "RequestActiveProfileNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestActiveProfileNotificationsTestL,
+    RequestActiveProfileNotificationsTestL,
+    TeardownRequestActiveProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Request profile(0) notifications - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNotificationsTest0L,
+    RequestProfileNotificationsTestL,
+    TeardownRequestProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Request profile(1) notifications - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNotificationsTest1L,
+    RequestProfileNotificationsTestL,
+    TeardownRequestProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Request name array notifications 1 - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNameArrayNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNameArrayNotificationsTest1L,
+    RequestProfileNameArrayNotificationsTestL,
+    TeardownRequestProfileNameArrayNotificationsTest)
+
+EUNIT_TEST(
+    "Request profile(2) notifications - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNotificationsTest2L,
+    RequestProfileNotificationsTestL,
+    TeardownRequestProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Request name array notifications 2 - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNameArrayNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNameArrayNotificationsTest2L,
+    RequestProfileNameArrayNotificationsTestL,
+    TeardownRequestProfileNameArrayNotificationsTest)
+
+EUNIT_TEST(
+    "Request profile(3) notifications - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNotificationsTest3L,
+    RequestProfileNotificationsTestL,
+    TeardownRequestProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Request name array notifications 3 - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNameArrayNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNameArrayNotificationsTest3L,
+    RequestProfileNameArrayNotificationsTestL,
+    TeardownRequestProfileNameArrayNotificationsTest)
+
+EUNIT_TEST(
+    "Request profile(4) notifications - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNotificationsTest4L,
+    RequestProfileNotificationsTestL,
+    TeardownRequestProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Request name array notifications 4 - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNameArrayNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNameArrayNotificationsTest4L,
+    RequestProfileNameArrayNotificationsTestL,
+    TeardownRequestProfileNameArrayNotificationsTest)
+/*
+EUNIT_TEST(
+    "Request profile(5) notifications - test",
+    "MProEngNotifyHandler",
+    "RequestProfileNotificationsL",
+    "FUNCTIONALITY",
+    SetupRequestProfileNotificationsTest5L,
+    RequestProfileNotificationsTestL,
+    TeardownRequestProfileNotificationsTest)
+*/
+EUNIT_TEST(
+    "Cancel profile activation notifications - test",
+    "MProEngNotifyHandler",
+    "CancelProfileActivationNotifications",
+    "FUNCTIONALITY",
+    SetupRequestProfileActivationNotificationsTestL,
+    CancelProfileActivationNotificationsTestL,
+    TeardownRequestProfileActivationNotificationsTest)
+
+EUNIT_TEST(
+    "Cancel active profile notifications - test",
+    "MProEngNotifyHandler",
+    "CancelActiveProfileNotifications",
+    "FUNCTIONALITY",
+    SetupRequestActiveProfileNotificationsTestL,
+    CancelActiveProfileNotificationsTestL,
+    TeardownRequestActiveProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Cancel profile notifications -  test",
+    "MProEngNotifyHandler",
+    "CancelProfileNotifications",
+    "FUNCTIONALITY",
+    SetupRequestProfileNotificationsTest0L,
+    CancelProfileNotificationsTestL,
+    TeardownRequestProfileNotificationsTest)
+
+EUNIT_TEST(
+    "Cancen profile name array notifications - test",
+    "MProEngNotifyHandler",
+    "CancelProfileNameArrayNotifications",
+    "FUNCTIONALITY",
+    SetupRequestProfileNameArrayNotificationsTest1L,
+    CancelProfileNameArrayNotificationsTestL,
+    TeardownRequestProfileNameArrayNotificationsTest)
+
+EUNIT_TEST(
+    "Cancel all notifications - test",
+    "MProEngNotifyHandler",
+    "CancelAll",
+    "FUNCTIONALITY",
+    SetupCancelAllTestL,
+    CancelAllTestL, TeardownCancelAllTest)
+
+
+EUNIT_END_TEST_TABLE
+
+//  END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfile.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,946 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngProfile test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngProfile.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngProfile.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProEngProfile.h>
+#include <MProEngEngine.h>
+#include <MProEngTones.h>
+#include <MProEngProfileName.h>
+#include <MProEngToneSettings.h>
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+#include <MProfileEngineExtended.h>
+#include <MProfileExtended.h>
+#include <CPbkContactEngine.h>
+
+//  INTERNAL INCLUDES
+#include "T_ProfileTestTools.h"
+
+// CONSTRUCTION
+MT_MProEngProfile* MT_MProEngProfile::NewL()
+    {
+    MT_MProEngProfile* self = MT_MProEngProfile::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+MT_MProEngProfile* MT_MProEngProfile::NewLC()
+    {
+    MT_MProEngProfile* self = new( ELeave ) MT_MProEngProfile();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+MT_MProEngProfile::~MT_MProEngProfile()
+    {
+    if( iInternalEngine )
+        {
+        iInternalEngine->Release();
+        }
+    if( iEngine )
+        {
+        iEngine->Release();
+        }
+    }
+
+MT_MProEngProfile::MT_MProEngProfile()
+    {
+    }
+
+void MT_MProEngProfile::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    iInternalEngine = CreateProfileEngineExtendedL();
+    iEngine = ProEngFactory::NewEngineL();
+    }
+
+void MT_MProEngProfile::EmptySetup()
+    {
+    }
+
+void MT_MProEngProfile::SetupL()
+    {
+    T_ProfileTestTools::ResetRepository();
+    iInternalProfile = iInternalEngine->ProfileL( iProfileId );
+    iProfile = iEngine->ProfileL( iProfileId );
+    }
+
+void MT_MProEngProfile::Setup0L()
+    {
+    iProfileId = 0;
+    SetupL();
+    }
+
+void MT_MProEngProfile::Setup1L()
+    {
+    iProfileId = 1;
+    SetupL();
+    }
+
+void MT_MProEngProfile::Setup2L()
+    {
+    iProfileId = 2;
+    SetupL();
+    }
+
+void MT_MProEngProfile::Setup3L()
+    {
+    iProfileId = 3;
+    SetupL();
+    }
+
+void MT_MProEngProfile::Setup4L()
+    {
+    iProfileId = 4;
+    SetupL();
+    }
+
+#ifdef __OFFLINE_MODE
+void MT_MProEngProfile::Setup5L()
+    {
+    iProfileId = 5;
+    SetupL();
+    }
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+void MT_MProEngProfile::Setup6L()
+    {
+    iProfileId = 6;
+    SetupL();
+    }
+#endif // __DRIVE_MODE
+
+void MT_MProEngProfile::SetupSetAlertForTestL()
+    {
+    User::LeaveIfError( iFs.Connect() );
+    iContactEngine = CPbkContactEngine::NewL( &iFs );
+    T_ProfileTestTools::CreateContactGroupsL( 5, iContactGroups, *iContactEngine );
+    }
+
+void MT_MProEngProfile::SetupAlertForTestL()
+    {
+    SetupSetAlertForTestL();
+    User::LeaveIfError( iProfile->SetAlertForL( iContactGroups.Array() ) );
+    }
+
+void MT_MProEngProfile::SetupAlertForTest0L()
+    {
+    Setup0L();
+    SetupAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupSetAlertForTest0L()
+    {
+    Setup0L();
+    SetupSetAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupCommitChangeTest0L()
+    {
+    Setup0L();
+    SetupSetAlertForTestL();
+    }
+
+
+void MT_MProEngProfile::SetupAlertForTest1L()
+    {
+    Setup1L();
+    SetupAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupSetAlertForTest1L()
+    {
+    Setup1L();
+    SetupSetAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupCommitChangeTest1L()
+    {
+    Setup1L();
+    SetupSetAlertForTestL();
+    }
+
+
+void MT_MProEngProfile::SetupAlertForTest2L()
+    {
+    Setup2L();
+    SetupAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupSetAlertForTest2L()
+    {
+    Setup2L();
+    SetupSetAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupCommitChangeTest2L()
+    {
+    Setup2L();
+    SetupSetAlertForTestL();
+    }
+
+
+void MT_MProEngProfile::SetupAlertForTest3L()
+    {
+    Setup3L();
+    SetupAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupSetAlertForTest3L()
+    {
+    Setup3L();
+    SetupSetAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupCommitChangeTest3L()
+    {
+    Setup3L();
+    SetupSetAlertForTestL();
+    }
+
+
+void MT_MProEngProfile::SetupAlertForTest4L()
+    {
+    Setup4L();
+    SetupAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupSetAlertForTest4L()
+    {
+    Setup4L();
+    SetupSetAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupCommitChangeTest4L()
+    {
+    Setup4L();
+    SetupSetAlertForTestL();
+    }
+
+#ifdef __OFFLINE_MODE
+void MT_MProEngProfile::SetupAlertForTest5L()
+    {
+    Setup5L();
+    SetupAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupSetAlertForTest5L()
+    {
+    Setup5L();
+    SetupSetAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupCommitChangeTest5L()
+    {
+    Setup5L();
+    SetupSetAlertForTestL();
+    }
+#endif // __OFFLINE_MODE
+
+
+#ifdef __DRIVE_MODE
+void MT_MProEngProfile::SetupAlertForTest6L()
+    {
+    Setup6L();
+    SetupAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupSetAlertForTest6L()
+    {
+    Setup6L();
+    SetupSetAlertForTestL();
+    }
+
+void MT_MProEngProfile::SetupCommitChangeTest6L()
+    {
+    Setup6L();
+    SetupSetAlertForTestL();
+    }
+#endif // __DRIVE_MODE
+
+void MT_MProEngProfile::EmptyTeardown()
+    {
+    }
+
+void MT_MProEngProfile::Teardown()
+    {
+    iInternalProfile->Release();
+    iProfile->Release();
+    }
+
+void MT_MProEngProfile::TeardownAlertForGroups()
+    {
+    Teardown();
+    TRAP_IGNORE( T_ProfileTestTools::DeleteContactGroups(
+                iContactGroups, *iContactEngine ) );
+    delete iContactEngine;
+    iContactGroups.Close();
+    iFs.Close();
+    }
+
+void MT_MProEngProfile::ReleaseTestL()
+    {
+    MProEngProfile* profile = iEngine->ProfileL( iProfileId );
+    CleanupReleasePushL( *profile );
+    CleanupStack::PopAndDestroy(); // profile
+    }
+
+void MT_MProEngProfile::AlertForTestL()
+    {
+    const TArray<TContactItemId> tids( iProfile->AlertForL() );
+    EUNIT_ASSERT( T_ProfileTestTools::CompareArrays( iContactGroups.Array(), tids ) );
+    }
+
+void MT_MProEngProfile::SetAlertForTestL()
+    {
+    TInt error( iProfile->SetAlertForL( iContactGroups.Array() ) );
+    EUNIT_ASSERT( error == KErrNone );
+    TArray<TContactItemId> tids( iProfile->AlertForL() );
+    EUNIT_ASSERT( T_ProfileTestTools::CompareArrays( iContactGroups.Array(), tids ) );
+    }
+
+void MT_MProEngProfile::IsSilentTestL()
+    {
+    TBool silent( iProfile->IsSilent() );
+    TBool expected( EFalse );
+    switch( iProfileId )
+        {
+        case 1:
+        case 4:
+        case 6:
+            {
+            expected = ETrue;
+            break;
+            }
+        default: // EFalse is already set above
+            {
+            break;
+            }
+        }
+    EUNIT_ASSERT( expected == silent );
+    }
+
+void MT_MProEngProfile::ProfileNameTestL()
+    {
+    MProEngProfileName& name = iProfile->ProfileName();
+    EUNIT_ASSERT( &name );
+    }
+
+void MT_MProEngProfile::ProfileTonesTestL()
+    {
+    MProEngTones& tones = iProfile->ProfileTones();
+    EUNIT_ASSERT( &tones );
+    }
+
+void MT_MProEngProfile::ToneSettingsTestL()
+    {
+    MProEngToneSettings& ts = iProfile->ToneSettings();
+    EUNIT_ASSERT( &ts );
+    }
+
+void MT_MProEngProfile::CommitChangeTestL()
+    {
+    RDebug::Print( _L( "Digia:CommitchangeTest: begin" ) );
+    //////////////////////////////////////////
+    // change  settings and commit changes
+    //////////////////////////////////////////
+    MProEngProfileName& pn1 = iProfile->ProfileName();
+    MProEngTones& pt1 = iProfile->ProfileTones();
+    MProEngToneSettings& pts1 = iProfile->ToneSettings();
+    if( ( iProfileId != EProfileOffLineId ) &&
+        ( iProfileId != EProfileGeneralId ) )
+        {
+        User::LeaveIfError( pn1.SetNameL( KProEngMTTestName ) );
+        }
+    //TInt error( iProfile->SetAlertForL( iContactGroups.Array() ) );
+    TInt error( KErrNone );
+    EUNIT_ASSERT( error == KErrNone );
+    User::LeaveIfError( pt1.SetMessageAlertToneL( KProEngMTTestTone ) );
+    if( iProfileId != EProfileOffLineId )
+        {
+        User::LeaveIfError( pt1.SetRingingTone1L( KProEngMTTestTone ) );
+        User::LeaveIfError( pt1.SetRingingTone2L( KProEngMTTestTone ) );
+        User::LeaveIfError( pt1.SetEmailAlertToneL( KProEngMTTestTone ) );
+        User::LeaveIfError( pt1.SetVideoCallRingingToneL( KProEngMTTestTone ) );
+        User::LeaveIfError( pts1.SetRingingType( KProEngMTTestRingingType ) );
+        User::LeaveIfError( pts1.SetTextToSpeech( !pts1.TextToSpeech() ) );
+        }
+    User::LeaveIfError( pts1.SetKeypadVolume( KProEngMTTestKeypadVolume ) );
+    User::LeaveIfError( pts1.SetRingingVolume( KProEngMTTestRingingVolume ) );
+    User::LeaveIfError( pts1.SetVibratingAlert( !pts1.VibratingAlert() ) );
+    User::LeaveIfError( pts1.SetWarningAndGameTones( !pts1.WarningAndGameTones() ) );
+    RDebug::Print( _L( "Digia:CommitchangeTest: before CommitChangeL" ) );
+    iProfile->CommitChangeL();
+    RDebug::Print( _L( "Digia:CommitchangeTest: after CommitChangeL" ) );
+
+    // read settings
+    MProEngProfile* profile = NULL;
+    profile = iEngine->ProfileL( iProfileId );
+    EUNIT_ASSERT( profile );
+    CleanupReleasePushL( *profile );
+
+    MProEngProfileName& pn2 = profile->ProfileName();
+    MProEngTones& pt2 = profile->ProfileTones();
+    MProEngToneSettings& pts2 = profile->ToneSettings();
+    //const TArray<TContactItemId>& array = profile->AlertForL();
+    
+
+    EUNIT_ASSERT( pn1.Name().Compare( pn2.Name() ) == 0 );
+    EUNIT_ASSERT( pt1.RingingTone1().Compare( pt2.RingingTone1() ) == 0 );
+    EUNIT_ASSERT( pt1.RingingTone2().Compare( pt2.RingingTone2() ) == 0 );
+    EUNIT_ASSERT( pt1.MessageAlertTone().Compare( pt2.MessageAlertTone() ) == 0 );
+    EUNIT_ASSERT( pt1.EmailAlertTone().Compare( pt2.EmailAlertTone() ) == 0 );
+    EUNIT_ASSERT( pts1.RingingType() == pts2.RingingType() );
+    EUNIT_ASSERT( pts1.KeypadVolume() == pts2.KeypadVolume() );
+    EUNIT_ASSERT( pts1.RingingVolume() == pts2.RingingVolume() );
+    EUNIT_ASSERT( pts1.VibratingAlert() == pts2.VibratingAlert() );
+    EUNIT_ASSERT( pts1.WarningAndGameTones() == pts2.WarningAndGameTones() );
+    EUNIT_ASSERT( pts1.TextToSpeech() == pts2.TextToSpeech() );
+    //EUNIT_ASSERT( T_ProfileTestTools::CompareArrays( array, iContactGroups.Array() ) );
+
+    CleanupStack::PopAndDestroy();  //profile->Release
+    RDebug::Print( _L( "Digia:CommitchangeTest: end" ) );
+    }
+
+//  TEST TABLE
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_MProEngProfile,
+    "Profile Settings Wrapper Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Release profile - test",
+    "MProEngProfile",
+    "Release",
+    "FUNCTIONALITY",
+    EmptySetup,
+    ReleaseTestL,
+    EmptyTeardown
+    )
+
+EUNIT_TEST(
+    "Get alert for groups 0 - test",
+    "MProEngProfile",
+    "AlertForL",
+    "FUNCTIONALITY",
+    SetupAlertForTest0L,
+    AlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Set alert for groups 0 - test",
+    "MProEngProfile",
+    "SetAlertForL",
+    "FUNCTIONALITY",
+    SetupSetAlertForTest0L,
+    SetAlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Silence state check 0 - test",
+    "MProEngProfile",
+    "IsSilent",
+    "FUNCTIONALITY",
+    Setup0L,
+    IsSilentTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngProfileName interface getter 0 - test",
+    "MProEngProfile",
+    "ProfileName",
+    "FUNCTIONALITY",
+    Setup0L,
+    ProfileNameTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngTones interface getter 0 - test",
+    "MProEngProfile",
+    "ProfileTones",
+    "FUNCTIONALITY",
+    Setup0L,
+    ProfileTonesTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngToneSettings interface getter 0 - test",
+    "MProEngProfile",
+    "ToneSettings",
+    "FUNCTIONALITY",
+    Setup0L,
+    ToneSettingsTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "Commiting of changes 0 - test",
+    "MProEngProfile",
+    "CommitChangeL",
+    "FUNCTIONALITY",
+    SetupCommitChangeTest0L,
+    CommitChangeTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Get alert for groups 1 - test",
+    "MProEngProfile",
+    "AlertForL",
+    "FUNCTIONALITY",
+    SetupAlertForTest1L,
+    AlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Set alert for groups 1 - test",
+    "MProEngProfile",
+    "SetAlertForL",
+    "FUNCTIONALITY",
+    SetupSetAlertForTest1L,
+    SetAlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Silence state check 1 - test",
+    "MProEngProfile",
+    "IsSilent",
+    "FUNCTIONALITY",
+    Setup1L,
+    IsSilentTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngProfileName interface getter 1 - test",
+    "MProEngProfile",
+    "ProfileName",
+    "FUNCTIONALITY",
+    Setup1L,
+    ProfileNameTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngTones interface getter 1 - test",
+    "MProEngProfile",
+    "ProfileTones",
+    "FUNCTIONALITY",
+    Setup1L,
+    ProfileTonesTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngToneSettings interface getter 1 - test",
+    "MProEngProfile",
+    "ToneSettings",
+    "FUNCTIONALITY",
+    Setup1L,
+    ToneSettingsTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "Commiting of changes 1 - test",
+    "MProEngProfile",
+    "CommitChangeL",
+    "FUNCTIONALITY",
+    SetupCommitChangeTest1L,
+    CommitChangeTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Get alert for groups 2 - test",
+    "MProEngProfile",
+    "AlertForL",
+    "FUNCTIONALITY",
+    SetupAlertForTest2L,
+    AlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Set alert for groups 2 - test",
+    "MProEngProfile",
+    "SetAlertForL",
+    "FUNCTIONALITY",
+    SetupSetAlertForTest2L,
+    SetAlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Silence state check 2 - test",
+    "MProEngProfile",
+    "IsSilent",
+    "FUNCTIONALITY",
+    Setup2L,
+    IsSilentTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngProfileName interface getter 2 - test",
+    "MProEngProfile",
+    "ProfileName",
+    "FUNCTIONALITY",
+    Setup2L,
+    ProfileNameTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngTones interface getter 2 - test",
+    "MProEngProfile",
+    "ProfileTones",
+    "FUNCTIONALITY",
+    Setup2L,
+    ProfileTonesTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngToneSettings interface getter 2 - test",
+    "MProEngProfile",
+    "ToneSettings",
+    "FUNCTIONALITY",
+    Setup2L,
+    ToneSettingsTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "Commiting of changes 2 - test",
+    "MProEngProfile",
+    "CommitChangeL",
+    "FUNCTIONALITY",
+    SetupCommitChangeTest2L,
+    CommitChangeTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Get alert for groups 3 - test",
+    "MProEngProfile",
+    "AlertForL",
+    "FUNCTIONALITY",
+    SetupAlertForTest3L,
+    AlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Set alert for groups 3 - test",
+    "MProEngProfile",
+    "SetAlertForL",
+    "FUNCTIONALITY",
+    SetupSetAlertForTest3L,
+    SetAlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Silence state check 3 - test",
+    "MProEngProfile",
+    "IsSilent",
+    "FUNCTIONALITY",
+    Setup3L,
+    IsSilentTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngProfileName interface getter 3 - test",
+    "MProEngProfile",
+    "ProfileName",
+    "FUNCTIONALITY",
+    Setup3L,
+    ProfileNameTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngTones interface getter 3 - test",
+    "MProEngProfile",
+    "ProfileTones",
+    "FUNCTIONALITY",
+    Setup3L,
+    ProfileTonesTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngToneSettings interface getter 3 - test",
+    "MProEngProfile",
+    "ToneSettings",
+    "FUNCTIONALITY",
+    Setup3L,
+    ToneSettingsTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "Commiting of changes 3 - test",
+    "MProEngProfile",
+    "CommitChangeL",
+    "FUNCTIONALITY",
+    SetupCommitChangeTest3L,
+    CommitChangeTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Get alert for groups 4 - test",
+    "MProEngProfile",
+    "AlertForL",
+    "FUNCTIONALITY",
+    SetupAlertForTest4L,
+    AlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Set alert for groups 4 - test",
+    "MProEngProfile",
+    "SetAlertForL",
+    "FUNCTIONALITY",
+    SetupSetAlertForTest4L,
+    SetAlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Silence state check 4 - test",
+    "MProEngProfile",
+    "IsSilent",
+    "FUNCTIONALITY",
+    Setup4L,
+    IsSilentTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngProfileName interface getter 4 - test",
+    "MProEngProfile",
+    "ProfileName",
+    "FUNCTIONALITY",
+    Setup4L,
+    ProfileNameTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngTones interface getter 4 - test",
+    "MProEngProfile",
+    "ProfileTones",
+    "FUNCTIONALITY",
+    Setup4L,
+    ProfileTonesTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngToneSettings interface getter 4 - test",
+    "MProEngProfile",
+    "ToneSettings",
+    "FUNCTIONALITY",
+    Setup4L,
+    ToneSettingsTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "Commiting of changes 4 - test",
+    "MProEngProfile",
+    "CommitChangeL",
+    "FUNCTIONALITY",
+    SetupCommitChangeTest4L,
+    CommitChangeTestL,
+    TeardownAlertForGroups
+    )
+
+#ifdef __OFFLINE_MODE
+EUNIT_TEST(
+    "Get alert for groups 5 - test",
+    "MProEngProfile",
+    "AlertForL",
+    "FUNCTIONALITY",
+    SetupAlertForTest5L,
+    AlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Set alert for groups 5 - test",
+    "MProEngProfile",
+    "SetAlertForL",
+    "FUNCTIONALITY",
+    SetupSetAlertForTest5L,
+    SetAlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Silence state check 5 - test",
+    "MProEngProfile",
+    "IsSilent",
+    "FUNCTIONALITY",
+    Setup5L,
+    IsSilentTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngProfileName interface getter 5 - test",
+    "MProEngProfile",
+    "ProfileName",
+    "FUNCTIONALITY",
+    Setup5L,
+    ProfileNameTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngTones interface getter 5 - test",
+    "MProEngProfile",
+    "ProfileTones",
+    "FUNCTIONALITY",
+    Setup5L,
+    ProfileTonesTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngToneSettings interface getter 5 - test",
+    "MProEngProfile",
+    "ToneSettings",
+    "FUNCTIONALITY",
+    Setup5L,
+    ToneSettingsTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "Commiting of changes 5 - test",
+    "MProEngProfile",
+    "CommitChangeL",
+    "FUNCTIONALITY",
+    SetupCommitChangeTest5L,
+    CommitChangeTestL,
+    TeardownAlertForGroups
+    )
+#endif // __OFFLINE_MODE
+
+#ifdef __DRIVE_MODE
+EUNIT_TEST(
+    "Get alert for groups 6 - test",
+    "MProEngProfile",
+    "AlertForL",
+    "FUNCTIONALITY",
+    SetupAlertForTest6L,
+    AlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Set alert for groups 6 - test",
+    "MProEngProfile",
+    "SetAlertForL",
+    "FUNCTIONALITY",
+    SetupSetAlertForTest6L,
+    SetAlertForTestL,
+    TeardownAlertForGroups
+    )
+
+EUNIT_TEST(
+    "Silence state check 6 - test",
+    "MProEngProfile",
+    "IsSilent",
+    "FUNCTIONALITY",
+    Setup6L,
+    IsSilentTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngProfileName interface getter 6 - test",
+    "MProEngProfile",
+    "ProfileName",
+    "FUNCTIONALITY",
+    Setup6L,
+    ProfileNameTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngTones interface getter 6 - test",
+    "MProEngProfile",
+    "ProfileTones",
+    "FUNCTIONALITY",
+    Setup6L,
+    ProfileTonesTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "MProEngToneSettings interface getter 6 - test",
+    "MProEngProfile",
+    "ToneSettings",
+    "FUNCTIONALITY",
+    Setup6L,
+    ToneSettingsTestL,
+    Teardown
+    )
+
+EUNIT_TEST(
+    "Commiting of changes 6 - test",
+    "MProEngProfile",
+    "CommitChangeL",
+    "FUNCTIONALITY",
+    SetupCommitChangeTest6L,
+    CommitChangeTestL,
+    TeardownAlertForGroups
+    )
+#endif // __DRIVE_MODE
+
+EUNIT_END_TEST_TABLE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileName.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,392 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngProfileName test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngProfileName.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngProfileName.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <MProEngProfileName.h>
+#include <MProEngProfile.h>
+#include <MProEngEngine.h>
+#include "MProfileEngineExtended.h"
+#include "MProfile.h"
+#include "MProfileName.h"
+#include "MProfileExtended.h"
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+
+//  INTERNAL INCLUDES
+#include "T_ProfileTestTools.h"
+
+MT_MProEngProfileName* MT_MProEngProfileName::NewL()
+    {
+    MT_MProEngProfileName* self = MT_MProEngProfileName::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_MProEngProfileName* MT_MProEngProfileName::NewLC()
+    {
+    MT_MProEngProfileName* self = new( ELeave ) MT_MProEngProfileName();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+
+MT_MProEngProfileName::~MT_MProEngProfileName()
+    {
+    if( iInternalEngine )
+        {
+        iInternalEngine->Release();
+        iInternalEngine = NULL;
+        }
+    if( iEngine )
+        {
+        iEngine->Release();
+        iEngine = NULL;
+        }
+    }
+
+
+MT_MProEngProfileName::MT_MProEngProfileName()
+    {
+    }
+
+void MT_MProEngProfileName::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    iInternalEngine = CreateProfileEngineExtendedL();
+    iEngine = ProEngFactory::NewEngineL();
+    }
+
+
+void MT_MProEngProfileName::SetupL()
+    {
+    iInternalProfile = iInternalEngine->ProfileL( iProfileId );
+    iProfile = iEngine->ProfileL( iProfileId );
+    }
+
+void MT_MProEngProfileName::Setup0L()
+    {
+    iProfileId = 0;
+    SetupL();
+    }
+
+void MT_MProEngProfileName::Setup1L()
+    {
+    iProfileId = 1;
+    SetupL();
+    }
+
+void MT_MProEngProfileName::Setup2L()
+    {
+    iProfileId = 2;
+    SetupL();
+    }
+
+void MT_MProEngProfileName::Setup3L()
+    {
+    iProfileId = 3;
+    SetupL();
+    }
+
+void MT_MProEngProfileName::Setup4L()
+    {
+    iProfileId = 4;
+    SetupL();
+    }
+
+#ifdef __OFFLINE_MODE
+void MT_MProEngProfileName::Setup5L()
+    {
+    iProfileId = 5;
+    SetupL();
+    }
+
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+void MT_MProEngProfileName::Setup6L()
+    {
+    iProfileId = 6;
+    SetupL();
+    }
+
+#endif // __DRIVE_MODE
+
+
+void MT_MProEngProfileName::Teardown()
+    {
+    if( iInternalProfile )
+        {
+        iInternalProfile->Release();
+        iInternalProfile = NULL;
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    }
+
+
+void MT_MProEngProfileName::GetIdTestL()
+    {
+    MProEngProfileName& profileName( iProfile->ProfileName() );
+    const MProfileName& name( iInternalProfile->ProfileName() );
+    EUNIT_ASSERT( profileName.Id() == name.Id() );
+    }
+
+
+void MT_MProEngProfileName::GetNameTestL()
+    {
+    MProEngProfileName& profileName( iProfile->ProfileName() );
+    const MProfileName& name( iInternalProfile->ProfileName() );
+    EUNIT_ASSERT( profileName.Name().Compare( name.Name() ) == 0 );
+    }
+
+
+void MT_MProEngProfileName::SetNameTestL()
+    {
+    MProEngProfileName& profileName( iProfile->ProfileName() );
+    const TDesC& origName( profileName.Name() );
+    TInt err( profileName.SetNameL( KProEngMTTestName ) );
+    if( ( iProfileId != EProfileOffLineId ) &&
+        ( iProfileId != EProfileDriveId ) &&
+        ( iProfileId != EProfileGeneralId ) )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( profileName.Name().Compare( KProEngMTTestName ) == 0 );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( profileName.Name().Compare( origName ) == 0 );
+        }
+    }
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_MProEngProfileName,
+    "Profile Name Wrapper Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Get Profile ID 0 - test",
+    "MProEngProfileName",
+    "Id",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile Name 0 - test",
+    "MProEngProfileName",
+    "Name",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Profile Name 0 - test",
+    "MProEngProfileName",
+    "SetNameL",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile ID 1 - test",
+    "MProEngProfileName",
+    "Id",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile Name 1 - test",
+    "MProEngProfileName",
+    "Name",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Profile Name 1 - test",
+    "MProEngProfileName",
+    "SetNameL",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile ID 2 - test",
+    "MProEngProfileName",
+    "Id",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile Name 2 - test",
+    "MProEngProfileName",
+    "Name",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Profile Name 2 - test",
+    "MProEngProfileName",
+    "SetNameL",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile ID 3 - test",
+    "MProEngProfileName",
+    "Id",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile Name 3 - test",
+    "MProEngProfileName",
+    "Name",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Profile Name 3 - test",
+    "MProEngProfileName",
+    "SetNameL",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile ID 4 - test",
+    "MProEngProfileName",
+    "Id",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile Name 4 - test",
+    "MProEngProfileName",
+    "Name",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Profile Name 4 - test",
+    "MProEngProfileName",
+    "SetNameL",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetNameTestL,
+    Teardown)
+
+#ifdef __OFFLINE_MODE
+EUNIT_TEST(
+    "Get Profile ID 5 - test",
+    "MProEngProfileName",
+    "Id",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile Name 5 - test",
+    "MProEngProfileName",
+    "Name",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Profile Name 5 - test",
+    "MProEngProfileName",
+    "SetNameL",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetNameTestL,
+    Teardown)
+#endif // __OFFLINE_MODE
+
+#ifdef __DRIVE_MODE
+EUNIT_TEST(
+    "Get Profile ID 6 - test",
+    "MProEngProfileName",
+    "Id",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Profile Name 6 - test",
+    "MProEngProfileName",
+    "Name",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Profile Name 6 - test",
+    "MProEngProfileName",
+    "SetNameL",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetNameTestL,
+    Teardown)
+#endif // __DRIVE_MODE
+
+EUNIT_END_TEST_TABLE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileNameArray.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,239 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngProfileNameArray test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngProfileNameArray.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngProfileNameArray.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <MProEngProfileNameArray.h>
+#include <MProEngProfile.h>
+#include <MProEngEngine.h>
+#include "MProfileEngineExtended.h"
+#include "MProfile.h"
+#include "MProfileName.h"
+#include "MProfilesNamesArray.h"
+#include "MProfileExtended.h"
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+
+//  INTERNAL INCLUDES
+#include "T_ProfileTestTools.h"
+
+MT_MProEngProfileNameArray* MT_MProEngProfileNameArray::NewL()
+    {
+    MT_MProEngProfileNameArray* self = MT_MProEngProfileNameArray::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_MProEngProfileNameArray* MT_MProEngProfileNameArray::NewLC()
+    {
+    MT_MProEngProfileNameArray* self = new( ELeave ) MT_MProEngProfileNameArray();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+
+MT_MProEngProfileNameArray::~MT_MProEngProfileNameArray()
+    {
+    if( iInternalEngine )
+        {
+        iInternalEngine->Release();
+        iInternalEngine = NULL;
+        }
+    if( iEngine )
+        {
+        iEngine->Release();
+        iEngine = NULL;
+        }
+    }
+
+
+MT_MProEngProfileNameArray::MT_MProEngProfileNameArray()
+    {
+    }
+
+void MT_MProEngProfileNameArray::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    iInternalEngine = CreateProfileEngineExtendedL();
+    iEngine = ProEngFactory::NewEngineL();
+    }
+
+
+void MT_MProEngProfileNameArray::SetupL()
+    {
+    iArray = iEngine->ProfileNameArrayLC();
+    CleanupStack::Pop(); // iArray
+    iInternalArray = iInternalEngine->ProfilesNamesArrayLC();
+    CleanupStack::Pop(); // iInternalArray
+    }
+
+void MT_MProEngProfileNameArray::SetupDynamicProfilesL()
+    {
+    MProfileExtended* internalProfile( iInternalEngine->CreateProfileL() );
+    if( internalProfile )
+        {
+        iProfileId = ( internalProfile->ProfileName().Id() );
+        internalProfile->Release();
+        }
+    SetupL();
+    }
+
+void MT_MProEngProfileNameArray::Teardown()
+    {
+    delete iArray;
+    delete iInternalArray;
+    }
+
+void MT_MProEngProfileNameArray::TeardownDynamicProfiles()
+    {
+    Teardown();
+    TRAP_IGNORE( iInternalEngine->DeleteProfileL( iProfileId ) );
+    }
+
+
+void MT_MProEngProfileNameArray::ProfileIdTestL()
+    {
+    TInt count( iArray->MdcaCount() );
+    TInt internalCount( iInternalArray->MdcaCount() );
+    EUNIT_ASSERT( count == internalCount );
+    for( TInt i( 0 ); i<internalCount; ++i )
+        {
+        TInt id1( iArray->ProfileId(i) );
+        TInt id2( iInternalArray->ProfileName(i)->Id() );
+        EUNIT_ASSERT( id1 == id2 );
+        }
+    }
+
+
+void MT_MProEngProfileNameArray::FindByIdTestL()
+    {
+    TInt lastId( EProfilePagerId + 1 );
+#ifdef __OFFLINE_MODE
+    lastId = EProfileOffLineId + 1;
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+    lastId = EProfileDriveId + 1;
+#endif // __DRIVE_MODE
+    // i<=lastId: tests also the first id which isn't found
+    for( TInt i( 0 ); i<=lastId; ++i )
+        {
+        EUNIT_ASSERT( iArray->FindById(i) == iInternalArray->FindById(i) );
+        }
+    }
+
+
+void MT_MProEngProfileNameArray::FindByNameTestL()
+    {
+    EUNIT_ASSERT( iArray->FindByName(KProfileGeneralName) ==
+                  iInternalArray->FindByName(KProfileGeneralName) );
+    EUNIT_ASSERT( iArray->FindByName(KProfileSilentName) ==
+                  iInternalArray->FindByName(KProfileSilentName) );
+    EUNIT_ASSERT( iArray->FindByName(KProfileMeetingName) ==
+                  iInternalArray->FindByName(KProfileMeetingName) );
+    EUNIT_ASSERT( iArray->FindByName(KProfileOutdoorName) ==
+                  iInternalArray->FindByName(KProfileOutdoorName) );
+    EUNIT_ASSERT( iArray->FindByName(KProfilePagerName) ==
+                  iInternalArray->FindByName(KProfilePagerName) );
+#ifdef __OFFLINE_MODE
+    EUNIT_ASSERT( iArray->FindByName(KProfileOfflineName) ==
+                  iInternalArray->FindByName(KProfileOfflineName) );
+#endif
+#ifdef __DRIVE_MODE
+    EUNIT_ASSERT( iArray->FindByName(KProfileDriveName) ==
+                  iInternalArray->FindByName(KProfileDriveName) );
+#endif
+    EUNIT_ASSERT( iArray->FindByName(KProfileInvalidName) ==
+                  iInternalArray->FindByName(KProfileInvalidName) );
+    }
+
+void MT_MProEngProfileNameArray::FindByIdDynamicProfileTestL()
+    {
+    EUNIT_ASSERT( iArray->FindById( iProfileId ) ==
+                  iInternalArray->FindById( iProfileId ) );
+    }
+
+void MT_MProEngProfileNameArray::FindByNameDynamicProfileTestL()
+    {
+    EUNIT_ASSERT( iArray->FindByName(KProfileDynamicName) ==
+                  iInternalArray->FindByName(KProfileDynamicName) );
+    }
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_MProEngProfileNameArray,
+    "Profile Name Array Wrapper Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Get Profile Id by index test",
+    "MProEngProfileNameArray",
+    "ProfileId",
+    "FUNCTIONALITY",
+    SetupL,
+    ProfileIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Find index by Profile ID test",
+    "MProEngProfileNameArray",
+    "FindById",
+    "FUNCTIONALITY",
+    SetupL,
+    FindByIdTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Find index by Profile name test",
+    "MProEngProfileNameArray",
+    "FindByName",
+    "FUNCTIONALITY",
+    SetupL,
+    FindByNameTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Find index by Dynamic Profile ID test",
+    "MProEngProfileNameArray",
+    "FindById",
+    "FUNCTIONALITY",
+    SetupDynamicProfilesL,
+    FindByIdDynamicProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_TEST(
+    "Find index by Dynamic Profile name test",
+    "MProEngProfileNameArray",
+    "FindByName",
+    "FUNCTIONALITY",
+    SetupDynamicProfilesL,
+    FindByNameDynamicProfileTestL,
+    TeardownDynamicProfiles)
+
+EUNIT_END_TEST_TABLE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngToneSettings.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1076 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngToneSettings test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngToneSettings.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngToneSettings.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <MProEngToneSettings.h>
+#include <MProEngProfile.h>
+#include <MProEngEngine.h>
+#include "MProfileEngineExtended.h"
+#include "MProfile.h"
+#include "MProfileTones.h"
+#include "TProfileToneSettings.h"
+#include "MProfileExtraTones.h"
+#include "MProfileExtended.h"
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+
+//  INTERNAL INCLUDES
+#include "T_ProfileTestTools.h"
+
+MT_MProEngToneSettings* MT_MProEngToneSettings::NewL()
+    {
+    MT_MProEngToneSettings* self = MT_MProEngToneSettings::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_MProEngToneSettings* MT_MProEngToneSettings::NewLC()
+    {
+    MT_MProEngToneSettings* self = new( ELeave ) MT_MProEngToneSettings();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+
+MT_MProEngToneSettings::~MT_MProEngToneSettings()
+    {
+    if( iInternalEngine )
+        {
+        iInternalEngine->Release();
+        iInternalEngine = NULL;
+        }
+    if( iEngine )
+        {
+        iEngine->Release();
+        iEngine = NULL;
+        }
+    }
+
+
+MT_MProEngToneSettings::MT_MProEngToneSettings()
+    {
+    }
+
+void MT_MProEngToneSettings::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    iInternalEngine = CreateProfileEngineExtendedL();
+    iEngine = ProEngFactory::NewEngineL();
+    }
+
+
+void MT_MProEngToneSettings::SetupL()
+    {
+    iInternalProfile = iInternalEngine->ProfileL( iProfileId );
+    iProfile = iEngine->ProfileL( iProfileId );
+    }
+
+void MT_MProEngToneSettings::Setup0L()
+    {
+    iProfileId = 0;
+    SetupL();
+    }
+
+void MT_MProEngToneSettings::Setup1L()
+    {
+    iProfileId = 1;
+    SetupL();
+    }
+
+void MT_MProEngToneSettings::Setup2L()
+    {
+    iProfileId = 2;
+    SetupL();
+    }
+
+void MT_MProEngToneSettings::Setup3L()
+    {
+    iProfileId = 3;
+    SetupL();
+    }
+
+void MT_MProEngToneSettings::Setup4L()
+    {
+    iProfileId = 4;
+    SetupL();
+    }
+
+#ifdef __OFFLINE_MODE
+void MT_MProEngToneSettings::Setup5L()
+    {
+    iProfileId = 5;
+    SetupL();
+    }
+
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+void MT_MProEngToneSettings::Setup6L()
+    {
+    iProfileId = 6;
+    SetupL();
+    }
+
+#endif // __DRIVE_MODE
+
+
+void MT_MProEngToneSettings::Teardown()
+    {
+    if( iInternalProfile )
+        {
+        iInternalProfile->Release();
+        iInternalProfile = NULL;
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    }
+
+void MT_MProEngToneSettings::GetRingingTypeTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    const TProfileToneSettings& tones2( iInternalProfile->ProfileTones().ToneSettings() );
+    EUNIT_ASSERT( tones.RingingType() == tones2.iRingingType );
+    }
+
+void MT_MProEngToneSettings::GetKeypadVolumeTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    const TProfileToneSettings& tones2( iInternalProfile->ProfileTones().ToneSettings() );
+    EUNIT_ASSERT( tones.KeypadVolume() == tones2.iKeypadVolume );
+    }
+
+void MT_MProEngToneSettings::GetRingingVolumeTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    const TProfileToneSettings& tones2( iInternalProfile->ProfileTones().ToneSettings() );
+    EUNIT_ASSERT( tones.RingingVolume() == tones2.iRingingVolume );
+    }
+
+void MT_MProEngToneSettings::GetVibraTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    const TProfileToneSettings& tones2( iInternalProfile->ProfileTones().ToneSettings() );
+    EUNIT_ASSERT( tones.VibratingAlert() == tones2.iVibratingAlert );
+    }
+
+void MT_MProEngToneSettings::GetWarningAndGameTonesTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    const TProfileToneSettings& tones2( iInternalProfile->ProfileTones().ToneSettings() );
+    EUNIT_ASSERT( tones.WarningAndGameTones() == tones2.iWarningAndGameTones );
+    }
+
+void MT_MProEngToneSettings::GetTextToSpeechTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    const TProfileToneSettings& tones2( iInternalProfile->ProfileTones().ToneSettings() );
+    EUNIT_ASSERT( tones.TextToSpeech() == tones2.iTextToSpeech );
+    }
+
+void MT_MProEngToneSettings::SetRingingTypeTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    TProfileRingingType origValue( tones.RingingType() );
+    TInt err( tones.SetRingingType( KProEngMTTestRingingType ) );
+    if( ( iProfileId != EProfileOffLineId ) &&
+        ( iProfileId != EProfileDriveId ) )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.RingingType() == KProEngMTTestRingingType );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.RingingType() == origValue );
+        }
+    }
+
+void MT_MProEngToneSettings::SetKeypadVolumeTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    TProfileKeypadVolume origValue( tones.KeypadVolume() );
+    TInt err( tones.SetKeypadVolume( KProEngMTTestKeypadVolume ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.KeypadVolume() == KProEngMTTestKeypadVolume );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.KeypadVolume() == origValue );
+        }
+    }
+
+void MT_MProEngToneSettings::SetRingingVolumeTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    TProfileRingingVolume origValue( tones.RingingVolume() );
+    TInt err( tones.SetRingingVolume( KProEngMTTestRingingVolume ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.RingingVolume() == KProEngMTTestRingingVolume );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.RingingVolume() == origValue );
+        }
+    }
+
+void MT_MProEngToneSettings::SetVibraTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    TBool origValue( tones.VibratingAlert() );
+    TInt err( tones.SetVibratingAlert( !origValue ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.VibratingAlert() != origValue );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.VibratingAlert() == origValue );
+        }
+    }
+
+void MT_MProEngToneSettings::SetWarningAndGameTonesTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    TBool origValue( tones.WarningAndGameTones() );
+    TInt err( tones.SetWarningAndGameTones( !origValue ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.WarningAndGameTones() != origValue );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.WarningAndGameTones() == origValue );
+        }
+    }
+
+void MT_MProEngToneSettings::SetTextToSpeechTestL()
+    {
+    MProEngToneSettings& tones( iProfile->ToneSettings() );
+    TBool origValue( tones.TextToSpeech() );
+    TInt err( tones.SetTextToSpeech( !origValue ) );
+    if( ( iProfileId != EProfileOffLineId ) &&
+        ( iProfileId != EProfileDriveId ) )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.TextToSpeech() != origValue );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.TextToSpeech() == origValue );
+        }
+    }
+
+
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_MProEngToneSettings,
+    "Profile Tone Settings Wrapper Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Get Ringing type 0 - test",
+    "MProEngToneSettings",
+    "RingingType",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Keypad volume 0 - test",
+    "MProEngToneSettings",
+    "KeypadVolume",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing Volume 0 - test",
+    "MProEngToneSettings",
+    "RingingVolume",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Vibrating alert 0 - test",
+    "MProEngToneSettings",
+    "VibratingAlert",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Warning And Game tones 0 - test",
+    "MProEngToneSettings",
+    "WarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Text-to-Speech tone 0 - test",
+    "MProEngToneSettings",
+    "TextToSpeech",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing type 0 - test",
+    "MProEngToneSettings",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Keypad volume 0 - test",
+    "MProEngToneSettings",
+    "SetKeypadVolume",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing Volume 0 - test",
+    "MProEngToneSettings",
+    "SetRingingVolume",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Vibrating alert 0 - test",
+    "MProEngToneSettings",
+    "SetVibratingAlert",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Warning And Game tones 0 - test",
+    "MProEngToneSettings",
+    "SetWarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Text-to-Speech tone 0 - test",
+    "MProEngToneSettings",
+    "SetTextToSpeech",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing type 1 - test",
+    "MProEngToneSettings",
+    "RingingType",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Keypad volume 1 - test",
+    "MProEngToneSettings",
+    "KeypadVolume",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing Volume 1 - test",
+    "MProEngToneSettings",
+    "RingingVolume",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Vibrating alert 1 - test",
+    "MProEngToneSettings",
+    "VibratingAlert",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Warning And Game tones 1 - test",
+    "MProEngToneSettings",
+    "WarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Text-to-Speech tone 1 - test",
+    "MProEngToneSettings",
+    "TextToSpeech",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing type 1 - test",
+    "MProEngToneSettings",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Keypad volume 1 - test",
+    "MProEngToneSettings",
+    "SetKeypadVolume",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing Volume 1 - test",
+    "MProEngToneSettings",
+    "SetRingingVolume",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Vibrating alert 1 - test",
+    "MProEngToneSettings",
+    "SetVibratingAlert",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Warning And Game tones 1 - test",
+    "MProEngToneSettings",
+    "SetWarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Text-to-Speech tone 1 - test",
+    "MProEngToneSettings",
+    "SetTextToSpeech",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing type 2 - test",
+    "MProEngToneSettings",
+    "RingingType",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Keypad volume 2 - test",
+    "MProEngToneSettings",
+    "KeypadVolume",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing Volume 2 - test",
+    "MProEngToneSettings",
+    "RingingVolume",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Vibrating alert 2 - test",
+    "MProEngToneSettings",
+    "VibratingAlert",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Warning And Game tones 2 - test",
+    "MProEngToneSettings",
+    "WarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Text-to-Speech tone 2 - test",
+    "MProEngToneSettings",
+    "TextToSpeech",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing type 2 - test",
+    "MProEngToneSettings",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Keypad volume 2 - test",
+    "MProEngToneSettings",
+    "SetKeypadVolume",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing Volume 2 - test",
+    "MProEngToneSettings",
+    "SetRingingVolume",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Vibrating alert 2 - test",
+    "MProEngToneSettings",
+    "SetVibratingAlert",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Warning And Game tones 2 - test",
+    "MProEngToneSettings",
+    "SetWarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Text-to-Speech tone 2 - test",
+    "MProEngToneSettings",
+    "SetTextToSpeech",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing type 3 - test",
+    "MProEngToneSettings",
+    "RingingType",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Keypad volume 3 - test",
+    "MProEngToneSettings",
+    "KeypadVolume",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing Volume 3 - test",
+    "MProEngToneSettings",
+    "RingingVolume",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Vibrating alert 3 - test",
+    "MProEngToneSettings",
+    "VibratingAlert",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Warning And Game tones 3 - test",
+    "MProEngToneSettings",
+    "WarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Text-to-Speech tone 3 - test",
+    "MProEngToneSettings",
+    "TextToSpeech",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing type 3 - test",
+    "MProEngToneSettings",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Keypad volume 3 - test",
+    "MProEngToneSettings",
+    "SetKeypadVolume",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing Volume 3 - test",
+    "MProEngToneSettings",
+    "SetRingingVolume",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Vibrating alert 3 - test",
+    "MProEngToneSettings",
+    "SetVibratingAlert",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Warning And Game tones 3 - test",
+    "MProEngToneSettings",
+    "SetWarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Text-to-Speech tone 3 - test",
+    "MProEngToneSettings",
+    "SetTextToSpeech",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing type 4 - test",
+    "MProEngToneSettings",
+    "RingingType",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Keypad volume 4 - test",
+    "MProEngToneSettings",
+    "KeypadVolume",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing Volume 4 - test",
+    "MProEngToneSettings",
+    "RingingVolume",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Vibrating alert 4 - test",
+    "MProEngToneSettings",
+    "VibratingAlert",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Warning And Game tones 4 - test",
+    "MProEngToneSettings",
+    "WarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Text-to-Speech tone 4 - test",
+    "MProEngToneSettings",
+    "TextToSpeech",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing type 4 - test",
+    "MProEngToneSettings",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Keypad volume 4 - test",
+    "MProEngToneSettings",
+    "SetKeypadVolume",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing Volume 4 - test",
+    "MProEngToneSettings",
+    "SetRingingVolume",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Vibrating alert 4 - test",
+    "MProEngToneSettings",
+    "SetVibratingAlert",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Warning And Game tones 4 - test",
+    "MProEngToneSettings",
+    "SetWarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Text-to-Speech tone 4 - test",
+    "MProEngToneSettings",
+    "SetTextToSpeech",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetTextToSpeechTestL,
+    Teardown)
+
+#ifdef __OFFLINE_MODE
+EUNIT_TEST(
+    "Get Ringing type 5 - test",
+    "MProEngToneSettings",
+    "RingingType",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Keypad volume 5 - test",
+    "MProEngToneSettings",
+    "KeypadVolume",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing Volume 5 - test",
+    "MProEngToneSettings",
+    "RingingVolume",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Vibrating alert 5 - test",
+    "MProEngToneSettings",
+    "VibratingAlert",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Warning And Game tones 5 - test",
+    "MProEngToneSettings",
+    "WarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Text-to-Speech tone 5 - test",
+    "MProEngToneSettings",
+    "TextToSpeech",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing type 5 - test",
+    "MProEngToneSettings",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Keypad volume 5 - test",
+    "MProEngToneSettings",
+    "SetKeypadVolume",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing Volume 5 - test",
+    "MProEngToneSettings",
+    "SetRingingVolume",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Vibrating alert 5 - test",
+    "MProEngToneSettings",
+    "SetVibratingAlert",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Warning And Game tones 5 - test",
+    "MProEngToneSettings",
+    "SetWarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Text-to-Speech tone 5 - test",
+    "MProEngToneSettings",
+    "SetTextToSpeech",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetTextToSpeechTestL,
+    Teardown)
+
+#endif // __OFFLINE_MODE
+
+#ifdef __DRIVE_MODE
+EUNIT_TEST(
+    "Get Ringing type 6 - test",
+    "MProEngToneSettings",
+    "RingingType",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Keypad volume 6 - test",
+    "MProEngToneSettings",
+    "KeypadVolume",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Ringing Volume 6 - test",
+    "MProEngToneSettings",
+    "RingingVolume",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Vibrating alert 6 - test",
+    "MProEngToneSettings",
+    "VibratingAlert",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Warning And Game tones 6 - test",
+    "MProEngToneSettings",
+    "WarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Text-to-Speech tone 6 - test",
+    "MProEngToneSettings",
+    "TextToSpeech",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetTextToSpeechTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing type 6 - test",
+    "MProEngToneSettings",
+    "SetRingingType",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetRingingTypeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Keypad volume 6 - test",
+    "MProEngToneSettings",
+    "SetKeypadVolume",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetKeypadVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Ringing Volume 6 - test",
+    "MProEngToneSettings",
+    "SetRingingVolume",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetRingingVolumeTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Vibrating alert 6 - test",
+    "MProEngToneSettings",
+    "SetVibratingAlert",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetVibraTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Warning And Game tones 6 - test",
+    "MProEngToneSettings",
+    "SetWarningAndGameTones",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetWarningAndGameTonesTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Text-to-Speech tone 6 - test",
+    "MProEngToneSettings",
+    "SetTextToSpeech",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetTextToSpeechTestL,
+    Teardown)
+
+#endif // __DRIVE_MODE
+
+EUNIT_END_TEST_TABLE
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngTones.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1062 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_MProEngTones test class.
+*
+*/
+
+////////////////////////////////////////////////////////////////////////
+// MT_MProEngTones.cpp
+//
+
+//  CLASS HEADER
+#include "MT_MProEngTones.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <MProEngTones.h>
+#include <MProEngProfile.h>
+#include <MProEngEngine.h>
+#include "MProfileEngineExtended.h"
+#include "MProfile.h"
+#include "MProfileTones.h"
+#include "MProfileExtraTones.h"
+#include "MProfileExtended.h"
+#include <ProEngFactory.h>
+#include <Profile.hrh>
+#include <centralrepository.h>
+#include <ProfileEngineInternalCRKeys.h>
+
+//  INTERNAL INCLUDES
+#include "T_ProfileTestTools.h"
+
+MT_MProEngTones* MT_MProEngTones::NewL()
+    {
+    MT_MProEngTones* self = MT_MProEngTones::NewLC();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_MProEngTones* MT_MProEngTones::NewLC()
+    {
+    MT_MProEngTones* self = new( ELeave ) MT_MProEngTones();
+    CleanupStack::PushL( self );
+
+	self->ConstructL();
+
+    return self;
+    }
+
+
+MT_MProEngTones::~MT_MProEngTones()
+    {
+    if( iInternalEngine )
+        {
+        iInternalEngine->Release();
+        iInternalEngine = NULL;
+        }
+    if( iEngine )
+        {
+        iEngine->Release();
+        iEngine = NULL;
+        }
+    }
+
+
+MT_MProEngTones::MT_MProEngTones()
+    {
+    }
+
+void MT_MProEngTones::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    iInternalEngine = CreateProfileEngineExtendedL();
+    iEngine = ProEngFactory::NewEngineL();
+    }
+
+
+void MT_MProEngTones::SetupL()
+    {
+    iInternalProfile = iInternalEngine->ProfileL( iProfileId );
+    iProfile = iEngine->ProfileL( iProfileId );
+    }
+
+void MT_MProEngTones::Setup0L()
+    {
+    iProfileId = 0;
+    SetupL();
+    }
+
+void MT_MProEngTones::Setup1L()
+    {
+    iProfileId = 1;
+    SetupL();
+    }
+
+void MT_MProEngTones::Setup2L()
+    {
+    iProfileId = 2;
+    SetupL();
+    }
+
+void MT_MProEngTones::Setup3L()
+    {
+    iProfileId = 3;
+    SetupL();
+    }
+
+void MT_MProEngTones::Setup4L()
+    {
+    iProfileId = 4;
+    SetupL();
+    }
+
+#ifdef __OFFLINE_MODE
+void MT_MProEngTones::Setup5L()
+    {
+    iProfileId = 5;
+    SetupL();
+    }
+
+#endif // __OFFLINE_MODE
+#ifdef __DRIVE_MODE
+void MT_MProEngTones::Setup6L()
+    {
+    iProfileId = 6;
+    SetupL();
+    }
+
+#endif // __DRIVE_MODE
+
+
+void MT_MProEngTones::Teardown()
+    {
+    if( iInternalProfile )
+        {
+        iInternalProfile->Release();
+        iInternalProfile = NULL;
+        }
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    }
+
+void MT_MProEngTones::GetRingingTone1TestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const MProfileTones& tones2( iInternalProfile->ProfileTones() );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( tones2.RingingTone1() ) == 0 );
+    }
+
+void MT_MProEngTones::GetRingingTone2TestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const MProfileTones& tones2( iInternalProfile->ProfileTones() );
+    EUNIT_ASSERT( tones.RingingTone2().Compare( tones2.RingingTone2() ) == 0 );
+    }
+
+void MT_MProEngTones::GetMessageAlertToneTestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const MProfileTones& tones2( iInternalProfile->ProfileTones() );
+    EUNIT_ASSERT( tones.MessageAlertTone().Compare( tones2.MessageAlertTone() ) == 0 );
+    }
+
+void MT_MProEngTones::GetEmailAlertToneTestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const MProfileExtraTones& tones2( iInternalProfile->ProfileExtraTones() );
+    EUNIT_ASSERT( tones.EmailAlertTone().Compare( tones2.EmailAlertTone() ) == 0 );
+    }
+
+void MT_MProEngTones::GetVideoCallRingingToneTestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const MProfileExtraTones& tones2( iInternalProfile->ProfileExtraTones() );
+    EUNIT_ASSERT( tones.VideoCallRingingTone().Compare( tones2.VideoCallRingingTone() ) == 0 );
+    }
+
+
+void MT_MProEngTones::SetRingingTone1TestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const TDesC& origTone( tones.RingingTone1() );
+    TInt err( tones.SetRingingTone1L( KProEngMTTestTone ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestTone ) == 0 );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.RingingTone1().Compare( origTone ) == 0 );
+        }
+    }
+
+void MT_MProEngTones::SetRingingTone2TestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const TDesC& origTone( tones.RingingTone2() );
+    TInt err( tones.SetRingingTone2L( KProEngMTTestTone ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.RingingTone2().Compare( KProEngMTTestTone ) == 0 );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.RingingTone2().Compare( origTone ) == 0 );
+        }
+    }
+
+void MT_MProEngTones::SetMessageAlertToneTestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const TDesC& origTone( tones.MessageAlertTone() );
+    TInt err( tones.SetMessageAlertToneL( KProEngMTTestTone ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.MessageAlertTone().Compare( KProEngMTTestTone ) == 0 );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.MessageAlertTone().Compare( origTone ) == 0 );
+        }
+    }
+
+void MT_MProEngTones::SetEmailAlertToneTestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const TDesC& origTone( tones.EmailAlertTone() );
+    TInt err( tones.SetEmailAlertToneL( KProEngMTTestTone ) );
+    if( iProfileId != EProfileDriveId )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.EmailAlertTone().Compare( KProEngMTTestTone ) == 0 );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.EmailAlertTone().Compare( origTone ) == 0 );
+        }
+    }
+
+void MT_MProEngTones::SetVideoCallRingingToneTestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const TDesC& origTone( tones.VideoCallRingingTone() );
+    TInt err( tones.SetVideoCallRingingToneL( KProEngMTTestTone ) );
+    if( ( iProfileId != EProfileOffLineId ) &&
+        ( iProfileId != EProfileDriveId ) )
+        {
+        EUNIT_ASSERT( err == KErrNone );
+        EUNIT_ASSERT( tones.VideoCallRingingTone().Compare( KProEngMTTestTone ) == 0 );
+        }
+    else
+        {
+        EUNIT_ASSERT( err == KErrAccessDenied );
+        EUNIT_ASSERT( tones.VideoCallRingingTone().Compare( origTone ) == 0 );
+        }
+    }
+
+/*
+void MT_MProEngTones::SetDRMRingingTone1TestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const TDesC& origTone( tones.RingingTone1() );
+
+    // combined delivery tests:
+    TInt err( tones.SetRingingTone1L( KProEngMTTestDRM_CD_StartEndTone ) );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_CD_StartEndTone ) == 0 );
+    TInt error( KErrNone );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error == KErrNone );
+
+    err = tones.SetRingingTone1L( KProEngMTTestDRM_CD_5TimesTone );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_CD_5TimesTone ) == 0 );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error != KErrNone );
+
+    err = tones.SetRingingTone1L( KProEngMTTestDRM_CD_FutureTone );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_CD_FutureTone ) == 0 );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error != KErrNone );
+
+    err = tones.SetRingingTone1L( KProEngMTTestDRM_CD_1YearTone );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_CD_1YearTone ) == 0 );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error == KErrNone );
+
+    // separate delivery tests:
+    err = tones.SetRingingTone1L( KProEngMTTestDRM_SD_StartEndTone );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_SD_StartEndTone ) == 0 );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error == KErrNone );
+
+    err = tones.SetRingingTone1L( KProEngMTTestDRM_SD_5TimesTone );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_SD_5TimesTone ) == 0 );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error != KErrNone );
+
+    err = tones.SetRingingTone1L( KProEngMTTestDRM_SD_1YearTone );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_SD_1YearTone ) == 0 );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error == KErrNone );
+
+    err = tones.SetRingingTone1L( KProEngMTTestDRM_SD_DisplayOnly );
+    EUNIT_ASSERT( err == KErrNone );
+    EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestDRM_SD_DisplayOnly ) == 0 );
+    TRAP( error, iProfile->CommitChangeL() );
+    EUNIT_ASSERT( error != KErrNone );
+
+    }
+*/
+
+/*
+void MT_MProEngTones::SetRingingToneSizeLimitTestL()
+    {
+    MProEngTones& tones( iProfile->ProfileTones() );
+    const TDesC& origTone( tones.RingingTone1() );
+    TInt nToneLimitKB = GetToneSizeLimitL();
+    // Is tone file size limit enabled?
+    if ( nToneLimitKB )
+		{
+		// Yes, this should succeed
+		TInt err( tones.SetRingingTone1L( KProEngMTTestToneSizeOk ) );
+		EUNIT_ASSERT( err == KErrNone );
+	    TRAP( err, iProfile->CommitChangeL() );
+		EUNIT_ASSERT( err == KErrNone );
+		EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestToneSizeOk ) == 0 );
+		
+		// This should fail			
+		err = tones.SetRingingTone1L( KProEngMTTestToneSizeTooBig );
+		EUNIT_ASSERT( err == KErrNone );
+	    TRAP( err, iProfile->CommitChangeL() );
+		EUNIT_ASSERT( err == KErrTooBig );
+		}
+	else
+		{
+		// Because checking feature is OFF, setting both files should succeed
+		TInt err( tones.SetRingingTone1L( KProEngMTTestToneSizeOk ) );
+		EUNIT_ASSERT( err == KErrNone );
+	    TRAP( err, iProfile->CommitChangeL() );
+		EUNIT_ASSERT( err == KErrNone );	    
+		EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestToneSizeOk ) == 0 );
+		
+		err = tones.SetRingingTone1L( KProEngMTTestToneSizeTooBig );
+		EUNIT_ASSERT( err == KErrNone );
+	    TRAP( err, iProfile->CommitChangeL() );
+		EUNIT_ASSERT( err == KErrNone );	    
+		EUNIT_ASSERT( tones.RingingTone1().Compare( KProEngMTTestToneSizeTooBig ) == 0 );
+		}
+    }
+
+
+// Read tone file size limit from cenrep    
+int MT_MProEngTones::GetToneSizeLimitL()
+    {
+    // Set file size limit if configured ON.
+	TInt sizeLimitKB( 0 );
+	CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+	CleanupStack::PushL( cenrep );
+	User::LeaveIfError( cenrep->Get( KProEngRingingToneMaxSize,
+                                     sizeLimitKB ) );
+	CleanupStack::PopAndDestroy(); // cenrep
+	if ( sizeLimitKB < 0 )
+	    {
+	    sizeLimitKB = 0;
+	    }
+    return sizeLimitKB;
+    }    
+*/
+    
+//-------------------------------------------------------------    
+
+EUNIT_BEGIN_TEST_TABLE(
+    MT_MProEngTones,
+    "Profile Tones Wrapper Test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Get Line1 Ringing Tone 0 - test",
+    "MProEngTones",
+    "RingingTone1",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line2 Ringing Tone 0 - test",
+    "MProEngTones",
+    "RingingTone2",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Message Alert Tone 0 - test",
+    "MProEngTones",
+    "MessageAlertTone",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Email Alert Tone 0 - test",
+    "MProEngTones",
+    "EmailAlertTone",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Video Call Ringing Tone 0 - test",
+    "MProEngTones",
+    "VideoCallRingingTone",
+    "FUNCTIONALITY",
+    Setup0L,
+    GetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line1 Ringing Tone 0 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line2 Ringing Tone 0 - test",
+    "MProEngTones",
+    "SetRingingTone2",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Message Alert Tone 0 - test",
+    "MProEngTones",
+    "SetMessageAlertToneL",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Email Alert Tone 0 - test",
+    "MProEngTones",
+    "SetEmailAlertToneL",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Video Call Ringing Tone 0 - test",
+    "MProEngTones",
+    "SetVideoCallRingingToneL",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line1 Ringing Tone 1 - test",
+    "MProEngTones",
+    "RingingTone1",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line2 Ringing Tone 1 - test",
+    "MProEngTones",
+    "RingingTone2",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Message Alert Tone 1 - test",
+    "MProEngTones",
+    "MessageAlertTone",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Email Alert Tone 1 - test",
+    "MProEngTones",
+    "EmailAlertTone",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Video Call Ringing Tone 1 - test",
+    "MProEngTones",
+    "VideoCallRingingTone",
+    "FUNCTIONALITY",
+    Setup1L,
+    GetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line1 Ringing Tone 1 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line2 Ringing Tone 1 - test",
+    "MProEngTones",
+    "SetRingingTone2",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Message Alert Tone 1 - test",
+    "MProEngTones",
+    "SetMessageAlertToneL",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Email Alert Tone 1 - test",
+    "MProEngTones",
+    "SetEmailAlertToneL",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Video Call Ringing Tone 1 - test",
+    "MProEngTones",
+    "SetVideoCallRingingToneL",
+    "FUNCTIONALITY",
+    Setup1L,
+    SetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line1 Ringing Tone 2 - test",
+    "MProEngTones",
+    "RingingTone1",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line2 Ringing Tone 2 - test",
+    "MProEngTones",
+    "RingingTone2",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Message Alert Tone 2 - test",
+    "MProEngTones",
+    "MessageAlertTone",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Email Alert Tone 2 - test",
+    "MProEngTones",
+    "EmailAlertTone",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Video Call Ringing Tone 2 - test",
+    "MProEngTones",
+    "VideoCallRingingTone",
+    "FUNCTIONALITY",
+    Setup2L,
+    GetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line1 Ringing Tone 2 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line2 Ringing Tone 2 - test",
+    "MProEngTones",
+    "SetRingingTone2",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Message Alert Tone 2 - test",
+    "MProEngTones",
+    "SetMessageAlertToneL",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Email Alert Tone 2 - test",
+    "MProEngTones",
+    "SetEmailAlertToneL",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Video Call Ringing Tone 2 - test",
+    "MProEngTones",
+    "SetVideoCallRingingToneL",
+    "FUNCTIONALITY",
+    Setup2L,
+    SetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line1 Ringing Tone 3 - test",
+    "MProEngTones",
+    "RingingTone1",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line2 Ringing Tone 3 - test",
+    "MProEngTones",
+    "RingingTone2",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Message Alert Tone 3 - test",
+    "MProEngTones",
+    "MessageAlertTone",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Email Alert Tone 3 - test",
+    "MProEngTones",
+    "EmailAlertTone",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Video Call Ringing Tone 3 - test",
+    "MProEngTones",
+    "VideoCallRingingTone",
+    "FUNCTIONALITY",
+    Setup3L,
+    GetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line1 Ringing Tone 3 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line2 Ringing Tone 3 - test",
+    "MProEngTones",
+    "SetRingingTone2",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Message Alert Tone 3 - test",
+    "MProEngTones",
+    "SetMessageAlertToneL",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Email Alert Tone 3 - test",
+    "MProEngTones",
+    "SetEmailAlertToneL",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Video Call Ringing Tone 3 - test",
+    "MProEngTones",
+    "SetVideoCallRingingToneL",
+    "FUNCTIONALITY",
+    Setup3L,
+    SetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line1 Ringing Tone 4 - test",
+    "MProEngTones",
+    "RingingTone1",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line2 Ringing Tone 4 - test",
+    "MProEngTones",
+    "RingingTone2",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Message Alert Tone 4 - test",
+    "MProEngTones",
+    "MessageAlertTone",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Email Alert Tone 4 - test",
+    "MProEngTones",
+    "EmailAlertTone",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Video Call Ringing Tone 4 - test",
+    "MProEngTones",
+    "VideoCallRingingTone",
+    "FUNCTIONALITY",
+    Setup4L,
+    GetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line1 Ringing Tone 4 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line2 Ringing Tone 4 - test",
+    "MProEngTones",
+    "SetRingingTone2",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Message Alert Tone 4 - test",
+    "MProEngTones",
+    "SetMessageAlertToneL",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Email Alert Tone 4 - test",
+    "MProEngTones",
+    "SetEmailAlertToneL",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Video Call Ringing Tone 4 - test",
+    "MProEngTones",
+    "SetVideoCallRingingToneL",
+    "FUNCTIONALITY",
+    Setup4L,
+    SetVideoCallRingingToneTestL,
+    Teardown)
+
+#ifdef __OFFLINE_MODE
+EUNIT_TEST(
+    "Get Line1 Ringing Tone 5 - test",
+    "MProEngTones",
+    "RingingTone1",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line2 Ringing Tone 5 - test",
+    "MProEngTones",
+    "RingingTone2",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Message Alert Tone 5 - test",
+    "MProEngTones",
+    "MessageAlertTone",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Email Alert Tone 5 - test",
+    "MProEngTones",
+    "EmailAlertTone",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Video Call Ringing Tone 5 - test",
+    "MProEngTones",
+    "VideoCallRingingTone",
+    "FUNCTIONALITY",
+    Setup5L,
+    GetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line1 Ringing Tone 5 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line2 Ringing Tone 5 - test",
+    "MProEngTones",
+    "SetRingingTone2",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Message Alert Tone 5 - test",
+    "MProEngTones",
+    "SetMessageAlertToneL",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Email Alert Tone 5 - test",
+    "MProEngTones",
+    "SetEmailAlertToneL",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Video Call Ringing Tone 5 - test",
+    "MProEngTones",
+    "SetVideoCallRingingToneL",
+    "FUNCTIONALITY",
+    Setup5L,
+    SetVideoCallRingingToneTestL,
+    Teardown)
+#endif // __OFFLINE_MODE
+
+#ifdef __DRIVE_MODE
+EUNIT_TEST(
+    "Get Line1 Ringing Tone 6 - test",
+    "MProEngTones",
+    "RingingTone1",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Line2 Ringing Tone 6 - test",
+    "MProEngTones",
+    "RingingTone2",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Message Alert Tone 6 - test",
+    "MProEngTones",
+    "MessageAlertTone",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Email Alert Tone 6 - test",
+    "MProEngTones",
+    "EmailAlertTone",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Get Video Call Ringing Tone 6 - test",
+    "MProEngTones",
+    "VideoCallRingingTone",
+    "FUNCTIONALITY",
+    Setup6L,
+    GetVideoCallRingingToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line1 Ringing Tone 6 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetRingingTone1TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Line2 Ringing Tone 6 - test",
+    "MProEngTones",
+    "SetRingingTone2",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetRingingTone2TestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Message Alert Tone 6 - test",
+    "MProEngTones",
+    "SetMessageAlertToneL",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetMessageAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Email Alert Tone 6 - test",
+    "MProEngTones",
+    "SetEmailAlertToneL",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetEmailAlertToneTestL,
+    Teardown)
+
+EUNIT_TEST(
+    "Set Video Call Ringing Tone 6 - test",
+    "MProEngTones",
+    "SetVideoCallRingingToneL",
+    "FUNCTIONALITY",
+    Setup6L,
+    SetVideoCallRingingToneTestL,
+    Teardown)
+#endif // __DRIVE_MODE
+
+/*
+EUNIT_TEST(
+    "DRM Set Line1 Ringing Tone 0 - test",
+    "MProEngTones",
+    "SetRingingTone1L",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetDRMRingingTone1TestL,
+    Teardown)
+*/
+/*
+EUNIT_TEST(
+    "FileSizeLimit, Line1 Set Ringing Tone 0 - test",
+    "MProEngTones",
+    "SetRingingToneSizeLimitL",
+    "FUNCTIONALITY",
+    Setup0L,
+    SetRingingToneSizeLimitTestL,
+    Teardown)
+*/
+EUNIT_END_TEST_TABLE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_ProEngFactory.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the MT_ProEngFactory test class.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// MT_ProEngFactory.cpp
+//
+
+//  CLASS HEADER
+#include "MT_ProEngFactory.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+#include <ProEngFactory.h>
+#include <MProEngEngine.h>
+#include <MProEngAlertToneSeeker.h>
+#include <MProEngNotifyHandler.h>
+
+//  INTERNAL INCLUDES
+
+
+// CONSTRUCTION
+MT_ProEngFactory* MT_ProEngFactory::NewL()
+    {
+    MT_ProEngFactory* self = MT_ProEngFactory::NewLC(); 
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+MT_ProEngFactory* MT_ProEngFactory::NewLC()
+    {
+    MT_ProEngFactory* self = new( ELeave ) MT_ProEngFactory();
+    CleanupStack::PushL( self );
+
+	self->ConstructL(); 
+
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+MT_ProEngFactory::~MT_ProEngFactory()
+    {
+    iFs.Close();
+    }
+
+// Default constructor
+MT_ProEngFactory::MT_ProEngFactory()
+    {
+    }
+
+// Second phase construct
+void MT_ProEngFactory::ConstructL()
+    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+    CEUnitTestSuiteClass::ConstructL();
+    User::LeaveIfError( iFs.Connect() );
+    }
+
+//  METHODS
+
+
+
+void MT_ProEngFactory::SetupL(  )
+    {
+
+    } 
+
+void MT_ProEngFactory::Teardown(  )
+    {
+
+    }
+
+void MT_ProEngFactory::MT_ProEngFactory_NewEngineLL(  )
+    {
+    MProEngEngine* engine = ProEngFactory::NewEngineL();
+    EUNIT_ASSERT( engine );
+    engine->Release();
+    engine = NULL;
+
+    // Test deletion through destructor:
+    engine = ProEngFactory::NewEngineL();
+    EUNIT_ASSERT( engine );
+    delete engine;
+    }
+
+void MT_ProEngFactory::MT_ProEngFactory_NewEngineLCL(  )
+    {
+    MProEngEngine* engine = ProEngFactory::NewEngineLC();
+    CleanupStack::Pop(); // engine
+    EUNIT_ASSERT( engine );
+    engine->Release();
+    }
+
+void MT_ProEngFactory::MT_ProEngFactory_NewEngineL_1L(  )
+    {
+    MProEngEngine* engine = ProEngFactory::NewEngineL( iFs );
+    EUNIT_ASSERT( engine );
+    engine->Release();
+    }
+
+void MT_ProEngFactory::MT_ProEngFactory_NewEngineLC_1L(  )
+    {
+    MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
+    CleanupStack::Pop(); // engine
+    EUNIT_ASSERT( engine );
+    engine->Release();
+    }
+
+void MT_ProEngFactory::MT_ProEngFactory_NewNotifyHandlerLL(  )
+    {
+    MProEngNotifyHandler* handler = ProEngFactory::NewNotifyHandlerL();
+    EUNIT_ASSERT( handler );
+    delete handler;
+    }
+
+void MT_ProEngFactory::MT_ProEngFactory_NewAlertToneSeekerLL(  )
+    {
+    MProEngAlertToneSeeker* seeker = ProEngFactory::NewAlertToneSeekerL();
+    EUNIT_ASSERT( seeker );
+    delete seeker;
+    }
+
+//  TEST TABLE
+
+EUNIT_BEGIN_TEST_TABLE( 
+    MT_ProEngFactory,
+    "Profiles Wrapper Factory test cases.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "NewEngineL - test ",
+    "ProEngFactory",
+    "NewEngineL",
+    "FUNCTIONALITY",
+    SetupL, MT_ProEngFactory_NewEngineLL, Teardown)
+
+EUNIT_TEST(
+    "NewEngineLC - test ",
+    "ProEngFactory",
+    "NewEngineLC",
+    "FUNCTIONALITY",
+    SetupL, MT_ProEngFactory_NewEngineLCL, Teardown)
+
+EUNIT_TEST(
+    "NewEngineL - test ",
+    "ProEngFactory",
+    "NewEngineL",
+    "FUNCTIONALITY",
+    SetupL, MT_ProEngFactory_NewEngineL_1L, Teardown)
+
+EUNIT_TEST(
+    "NewEngineLC - test ",
+    "ProEngFactory",
+    "NewEngineLC",
+    "FUNCTIONALITY",
+    SetupL, MT_ProEngFactory_NewEngineLC_1L, Teardown)
+
+EUNIT_TEST(
+    "NewNotifyHandlerL - test ",
+    "ProEngFactory",
+    "NewNotifyHandlerL",
+    "FUNCTIONALITY",
+    SetupL, MT_ProEngFactory_NewNotifyHandlerLL, Teardown)
+
+EUNIT_TEST(
+    "NewAlertToneSeekerL - test ",
+    "ProEngFactory",
+    "NewAlertToneSeekerL",
+    "FUNCTIONALITY",
+    SetupL, MT_ProEngFactory_NewAlertToneSeekerLL, Teardown)
+
+
+EUNIT_END_TEST_TABLE
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_ProfileEngineDllMain.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ProfileEngine wrapper test suite.
+*
+*/
+
+//  CLASS HEADER
+#include "MT_ProEngFactory.h"
+#include "MT_MProEngNotifyHandler.h"
+#include "MT_MProEngEngine.h"
+#include "MT_MProEngProfile.h"
+#include "MT_MProEngProfileName.h"
+#include "MT_MProEngProfileNameArray.h"
+#include "MT_MProEngTones.h"
+#include "MT_MProEngToneSettings.h"
+#include "MT_MProEngAlertToneSeeker.h"
+#include "T_ProfileTestTools.h"
+
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+
+/**
+ * Test suite factory function.
+ */
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    // First, make sure there are default settings in all profiles:
+    T_ProfileTestTools::ResetRepository();
+
+    CEUnitTestSuite* mainSuite = CEUnitTestSuite::NewLC(_L("T_ProfileEngineWrapper API Tests"));
+
+    // NewLC leaves the pointer to cleanupstack until AddL finishes
+    mainSuite->AddL( MT_ProEngFactory::NewLC() );
+    mainSuite->AddL( MT_MProEngNotifyHandler::NewLC() );
+    mainSuite->AddL( MT_MProEngAlertToneSeeker::NewLC() );
+    mainSuite->AddL( MT_MProEngEngine::NewLC() );
+    mainSuite->AddL( MT_MProEngProfile::NewLC() );
+    mainSuite->AddL( MT_MProEngProfileName::NewLC() );
+    mainSuite->AddL( MT_MProEngProfileNameArray::NewLC() );
+    mainSuite->AddL( MT_MProEngTones::NewLC() );
+    mainSuite->AddL( MT_MProEngToneSettings::NewLC() );
+
+    CleanupStack::Pop( 9 );
+
+    CleanupStack::Pop( mainSuite );
+    return mainSuite;
+    }
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/T_ProfileTestTools.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,498 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the T_ProfileTestTools.
+*
+*/
+////////////////////////////////////////////////////////////////////////
+// T_ProfileTestTools.cpp
+//
+
+// INCLUDES
+#include "T_ProfileTestTools.h"
+
+#include <F32FILE.H>
+#include <bautils.h>
+#include <CNTITEM.H>
+#include "TProfileToneSettings.h"
+#include "MProfilesNamesArray.h"
+#include "MProfileName.h"
+#include "MProfile.h"
+#include "MProfileTones.h"
+#include "MProfileExtraTones.h"
+#include <CPbkContactEngine.h>
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+#include <HWRMVibraSDKCRKeys.h>
+#include "ProfileEnginePrivateCRKeys.h"
+#include <CPbkContactItem.h>
+#include <MProEngProfile.h>
+#include <MProEngProfileName.h>
+#include <MProEngProfileNameArray.h>
+#include <MProEngTones.h>
+#include <MProEngToneSettings.h>
+#include <EUnitMacros.h>
+
+TBool T_ProfileTestTools::CompareArrays( const TArray<TContactItemId>& aArray1, const TArray<TContactItemId>& aArray2 )
+    {
+    TInt count = aArray1.Count();
+    if( count != aArray2.Count() )
+        {
+        return EFalse;
+        }
+    for( TInt i = 0 ; i < count ; ++i )
+        {
+        if( aArray1[i] != aArray2[i] ) return EFalse;
+        }
+    return ETrue;
+    }
+
+TBool T_ProfileTestTools::CompareNameArrays(
+        const MProEngProfileNameArray& aArray1,
+        const MProfilesNamesArray& aArray2 )
+    {
+    TInt count1( aArray1.MdcaCount() );
+    TInt count2( aArray2.MdcaCount() );
+    if( count1 != count2 )
+        {
+        return EFalse;
+        }
+    for( TInt i(0); i<count1; ++i )
+        {
+        if( aArray1.MdcaPoint( i ).Compare( aArray2.MdcaPoint( i ) ) != 0 )
+            {
+            return EFalse;
+            }
+        }
+    return ETrue;
+    }
+
+TBool T_ProfileTestTools::CompareProfiles( MProEngProfile& ap1, MProfile& ap2 )
+    {
+    EUNIT_PRINT( _L( "CompareProfiles 1" ) );
+    MProEngProfileName& pn1( ap1.ProfileName() );
+    const MProfileName& pn2( ap2.ProfileName() );
+    EUNIT_PRINT( _L( "CompareProfiles id1=%d, id2=%d" ), pn1.Id(), pn2.Id() );
+    if( pn1.Id() != pn2.Id() )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 2" ) );
+    if( pn1.Name().Compare( pn2.Name() ) != 0 )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 3" ) );
+    MProEngTones& pt1( ap1.ProfileTones() );
+    MProEngToneSettings& pts1( ap1.ToneSettings() );
+    const MProfileTones& pt2( ap2.ProfileTones() );
+    const MProfileExtraTones& pet2( ap2.ProfileExtraTones() );
+    const TProfileToneSettings& pts2( pt2.ToneSettings() );
+
+    if( pt1.RingingTone1().Compare( pt2.RingingTone1() ) != 0 )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 4" ) );
+    if( pt1.RingingTone2().Compare( pt2.RingingTone2() ) != 0 )
+        {
+        return EFalse;
+        }
+    const TDesC& msgTone1( pt1.MessageAlertTone() );
+    const TDesC& msgTone2( pt2.MessageAlertTone() );
+    EUNIT_PRINT( _L( "CompareProfiles 5 msgt1=%S, msgt2=%S" ), &msgTone1, &msgTone2 );
+    if( pt1.MessageAlertTone().Compare( pt2.MessageAlertTone() ) != 0 )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 6" ) );
+    if( pt1.EmailAlertTone().Compare( pet2.EmailAlertTone() ) != 0 )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 7" ) );
+    if( pt1.VideoCallRingingTone().Compare( pet2.VideoCallRingingTone() ) != 0 )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 8" ) );
+    if( pts1.RingingType() != pts2.iRingingType )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 9" ) );
+    if( pts1.KeypadVolume() != pts2.iKeypadVolume )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 10" ) );
+    if( pts1.RingingVolume() != pts2.iRingingVolume )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 11" ) );
+    if( pts1.VibratingAlert() != pts2.iVibratingAlert )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 12" ) );
+    if( pts1.WarningAndGameTones() != pts2.iWarningAndGameTones )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 13" ) );
+    if( pts1.TextToSpeech() != pts2.iTextToSpeech )
+        {
+        return EFalse;
+        }
+    EUNIT_PRINT( _L( "CompareProfiles 14" ) );
+    const TArray<TContactItemId> cids1( ap1.AlertForL() );
+    const TArray<TContactItemId> cids2( ap2.AlertForL() );
+    TBool result( CompareArrays( cids1, cids2 ) );
+    EUNIT_PRINT( _L( "CompareProfiles 15 result=%d" ), result );
+    return result;
+    }
+
+TBool T_ProfileTestTools::CheckArray( const MProfilesNamesArray& aArray )
+    {
+    TInt count = aArray.MdcaCount();
+    TInt correctCount( 5 );
+#ifdef __OFFLINE_MODE
+    ++correctCount;
+#endif
+#ifdef __DRIVE_MODE
+    ++correctCount;
+#endif
+    if( count != correctCount )
+        {
+        return EFalse;
+        }
+    for( TInt i = 0 ; i < count ; ++i )
+        {
+        const MProfileName* pn = aArray.ProfileName( i );
+        if( !pn )
+            {
+            return EFalse;
+            }
+        if( pn->Name().Compare( T_ProfileTestTools::ProfileName( i ) ) != 0 ||
+            pn->Id() != i )
+            {
+            return EFalse;
+            }
+        }
+    return ETrue;
+    }
+
+
+const TDesC& T_ProfileTestTools::ProfileName( TInt aId )
+    {
+    switch( aId )
+        {
+        case 2:
+            {
+            return KProfileMeetingName;
+            }
+        case 1:
+            {
+            return KProfileSilentName;
+            }
+        case 3:
+            {
+            return KProfileOutdoorName;
+            }
+        case 4:
+            {
+            return KProfilePagerName;
+            }
+#ifdef __OFFLINE_MODE
+        case 5:
+            {
+            return KProfileOfflineName;
+            }
+#endif
+#ifdef __DRIVE_MODE
+        case 6:
+            {
+            return KProfileDriveName;
+            }
+#endif
+        case 0:
+        default:
+            {
+            return KProfileGeneralName;
+            }
+        }
+    }
+
+const TDesC& T_ProfileTestTools::ProfileMessageAlertTone( TInt aId )
+    {
+    switch( aId )
+        {
+        case 2:
+            {
+            return KProfileBeepTwice;
+            }
+        case 1:
+            {
+            return KProfileNoSound;
+            }
+        case 3:
+        case 4:
+        case 0:
+        default:
+            {
+            return KProfileMessageTone;
+            }
+        }
+    }
+
+const TDesC& T_ProfileTestTools::ProfileRingingTone( TInt aId )
+    {
+    switch( aId )
+        {
+        case 2:
+            {
+            return KProfileBeep;
+            }
+        case 1:
+        case 3:
+        case 4:
+        case 0:
+        default:
+            {
+            return KProfileNokiaTune;
+            }
+        }
+    }
+
+const TDesC& T_ProfileTestTools::ProfileIMMessageAlertTone( TInt aId )
+    {
+    switch( aId )
+        {
+        case 1:
+            {
+            return KProfileNoSound;
+            }
+        case 2:
+            {
+            return KProfileBeepTwice;
+            }
+        case 3:
+        case 4:
+        case 0:
+        default:
+            {
+            return KProfileIMMessageTone;
+            }
+        }
+    }
+
+const TDesC& T_ProfileTestTools::ProfileEmailAlertTone( TInt aId )
+    {
+    switch( aId )
+        {
+        case 1:
+            {
+            return KProfileNoSound;
+            }
+        case 2:
+            {
+            return KProfileBeepTwice;
+            }
+        case 3:
+        case 4:
+        case 0:
+        default:
+            {
+            return KProfileMessageTone;
+            }
+        }
+    }
+
+const TDesC& T_ProfileTestTools::ProfileVideoCallRingingTone( TInt /* aId */ )
+    {
+    return KProfileNokiaTune;
+    }
+
+TBool T_ProfileTestTools::CheckToneSettings( TInt aId, const TProfileToneSettings&  aSettings )
+    {
+    switch( aId )
+        {
+        case 1:
+            {
+            if ( aSettings.iRingingType == EProfileRingingTypeSilent &&
+                 aSettings.iKeypadVolume == EProfileKeypadVolumeOff &&
+                 aSettings.iRingingVolume == 1 &&
+                 !( aSettings.iVibratingAlert ) &&
+                 !( aSettings.iWarningAndGameTones ) )
+                {
+                return ETrue;
+                }
+            else
+                return EFalse;
+            }
+        case 2:
+            {
+            if ( aSettings.iRingingType == EProfileRingingTypeBeepOnce &&
+                 aSettings.iKeypadVolume == EProfileKeypadVolumeOff &&
+                 aSettings.iRingingVolume == 1 &&
+                 !( aSettings.iVibratingAlert ) &&
+                 !( aSettings.iWarningAndGameTones ) )
+                {
+                return ETrue;
+                }
+            else
+                return EFalse;
+            }
+        case 3:
+            {
+            if ( aSettings.iRingingType == EProfileRingingTypeRinging &&
+                 aSettings.iKeypadVolume == EProfileKeypadVolumeLevel3 &&
+                 aSettings.iRingingVolume == 10 &&
+                 aSettings.iVibratingAlert &&
+                 aSettings.iWarningAndGameTones )
+                {
+                return ETrue;
+                }
+            else
+                return EFalse;
+            }
+        case 4:
+            {
+            if ( aSettings.iRingingType == EProfileRingingTypeSilent &&
+                 aSettings.iKeypadVolume == EProfileKeypadVolumeLevel2 &&
+                 aSettings.iRingingVolume == 7 &&
+                 aSettings.iVibratingAlert &&
+                 aSettings.iWarningAndGameTones )
+                {
+                return ETrue;
+                }
+            else
+                return EFalse;
+            }
+        case 0:
+        default:
+            {
+            if ( aSettings.iRingingType == EProfileRingingTypeRinging &&
+                 aSettings.iKeypadVolume == EProfileKeypadVolumeLevel2 &&
+                 aSettings.iRingingVolume == 7 &&
+                 !( aSettings.iVibratingAlert ) &&
+                 aSettings.iWarningAndGameTones )
+                {
+                return ETrue;
+                }
+            else
+                return EFalse;
+            }
+        }
+    }
+
+void T_ProfileTestTools::CreateContactGroupsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine )
+    {
+    for( TInt i = 0 ; i < aNumber ; ++i )
+        {
+        CContactGroup* tmp = aContactEngine.CreateContactGroupL( _L( "ProfileTestGroup" ) );
+        CleanupStack::PushL( tmp );
+        User::LeaveIfError( aArray.Append( tmp->Id() ) );
+        CleanupStack::PopAndDestroy();  // tmp;
+        }
+    }
+
+void T_ProfileTestTools::DeleteContactGroups( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine )
+    {
+    TInt count = aArray.Count();
+    for( TInt i = 0 ; i < count ; ++i )
+        {
+        TRAP_IGNORE( aContactEngine.DeleteContactGroupL( aArray[i] ) );
+        }
+    }
+
+void T_ProfileTestTools::CreateContactsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine )
+    {
+    for( TInt i = 0 ; i < aNumber ; ++i )
+        {
+        CPbkContactItem* tmp = aContactEngine.CreateEmptyContactL();
+        CleanupStack::PushL( tmp );
+        aContactEngine.AddNewContactL( *tmp );
+        User::LeaveIfError( aArray.Append( tmp->Id() ) );
+        CleanupStack::PopAndDestroy();  // tmp;
+        }
+    }
+
+void T_ProfileTestTools::DeleteContacts( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine )
+    {
+    TInt count = aArray.Count();
+    for( TInt i = 0 ; i < count ; ++i )
+        {
+        TRAP_IGNORE( aContactEngine.DeleteContactL( aArray[i] ) );
+        }
+    }
+
+void T_ProfileTestTools::WriteAlertForIdsToCenrepL( TInt aProfileId, RArray<TContactItemId>& aArray )
+    {
+    CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+    CleanupStack::PushL( cenrep );
+    TBuf8< 40 > alertForBuf; // max 10 ids
+    TInt count( aArray.Count() );
+    for( TInt i( 0 ) ; i < count ; ++i )
+        {
+        TContactItemId id( aArray[i] );
+        TUint8 pieceOfId( ( aArray[i] >> 24 ) & 0x000000FF );
+        alertForBuf.Append( pieceOfId );
+        pieceOfId = ( aArray[i] >> 16 & 0x000000FF );
+        alertForBuf.Append( pieceOfId );
+        pieceOfId = ( aArray[i] >> 8 & 0x000000FF );
+        alertForBuf.Append( pieceOfId );
+        pieceOfId = ( aArray[i] & 0x000000FF );
+        alertForBuf.Append( pieceOfId );
+        }
+    User::LeaveIfError(
+            cenrep->Set( ( aProfileId << 24 ) | KProEngAlertForGroups,
+                         alertForBuf ) );
+
+    CleanupStack::PopAndDestroy(); // cenrep
+    }
+
+void T_ProfileTestTools::DeleteAlertForIdsFromCenrep( TInt aProfileId )
+    {
+    TRAP_IGNORE(
+           CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+           TBuf8< 1 > alertForBuf;
+           alertForBuf.Zero();
+
+           cenrep->Set( ( aProfileId << 24 ) | KProEngAlertForGroups,
+                        alertForBuf );
+
+           delete cenrep;
+         );
+    }
+
+void T_ProfileTestTools::ResetRepository()
+    {
+    TRAP_IGNORE(
+        CRepository* cr = CRepository::NewL( KCRUidProfileEngine );
+        cr->Reset();
+        delete cr;
+        );
+    }
+
+TBool T_ProfileTestTools::IsCenrepFeatureEnabledL( TUid aUid, TUint32 aKey )
+    {
+    CRepository* cenrep = CRepository::NewLC( aUid );
+    TInt value( 0 );
+    User::LeaveIfError( cenrep->Get( aKey, value ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    return value;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building the
+*    Profile Engine (and wrapper) tests
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+
+#include "../EngineMdlTest/group/bld.inf"
+#include "../WrapperMdlTest/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/ProfileEngine/tsrc/public/basic/rom/ProfileEngine_ats3.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  ROM image definition for ProfileEngine automated tests
+*       
+*
+*/
+
+#ifndef __PROFILEENGINE_ATS3_IBY__
+#define __PROFILEENGINE_ATS3_IBY__
+
+// INCLUDED IN PROFILESAPPLICATION_ATS3_IBY
+
+//file=ABI_DIR\BUILD_DIR\T_ProfileEngine.dll		SHARED_LIB_DIR\T_ProfileEngine.dll
+//file=ABI_DIR\BUILD_DIR\T_ProfileEngineWrapper.dll	SHARED_LIB_DIR\T_ProfileEngineWrapper.dll
+
+#endif
\ No newline at end of file
Binary file profilesservices/RingingTone3DPlugin/data/cenrep/10208ADF.txt has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/data/patterns/1circular.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,386 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Circle pattern generated by write_circle_pattern.m-->
+<pattern-3d>
+  <initialization doppler="false" reverb="Forest" name="Circle">
+    <position x="0" y="0" z="-1000" />
+  </initialization>
+  <script>
+    <loop>
+      <update dTime="40">
+        <position x="50" y="0" z="-999" />
+      </update>
+      <update dTime="40">
+        <position x="100" y="0" z="-995" />
+      </update>
+      <update dTime="40">
+        <position x="150" y="0" z="-989" />
+      </update>
+      <update dTime="40">
+        <position x="200" y="0" z="-980" />
+      </update>
+      <update dTime="40">
+        <position x="249" y="0" z="-969" />
+      </update>
+      <update dTime="40">
+        <position x="297" y="0" z="-955" />
+      </update>
+      <update dTime="40">
+        <position x="345" y="0" z="-939" />
+      </update>
+      <update dTime="40">
+        <position x="391" y="0" z="-920" />
+      </update>
+      <update dTime="40">
+        <position x="437" y="0" z="-899" />
+      </update>
+      <update dTime="40">
+        <position x="482" y="0" z="-876" />
+      </update>
+      <update dTime="40">
+        <position x="525" y="0" z="-851" />
+      </update>
+      <update dTime="40">
+        <position x="567" y="0" z="-824" />
+      </update>
+      <update dTime="40">
+        <position x="608" y="0" z="-794" />
+      </update>
+      <update dTime="40">
+        <position x="647" y="0" z="-762" />
+      </update>
+      <update dTime="40">
+        <position x="685" y="0" z="-729" />
+      </update>
+      <update dTime="40">
+        <position x="720" y="0" z="-694" />
+      </update>
+      <update dTime="40">
+        <position x="754" y="0" z="-657" />
+      </update>
+      <update dTime="40">
+        <position x="786" y="0" z="-618" />
+      </update>
+      <update dTime="40">
+        <position x="816" y="0" z="-578" />
+      </update>
+      <update dTime="40">
+        <position x="844" y="0" z="-536" />
+      </update>
+      <update dTime="40">
+        <position x="870" y="0" z="-493" />
+      </update>
+      <update dTime="40">
+        <position x="894" y="0" z="-448" />
+      </update>
+      <update dTime="40">
+        <position x="915" y="0" z="-403" />
+      </update>
+      <update dTime="40">
+        <position x="934" y="0" z="-356" />
+      </update>
+      <update dTime="40">
+        <position x="951" y="0" z="-309" />
+      </update>
+      <update dTime="40">
+        <position x="965" y="0" z="-261" />
+      </update>
+      <update dTime="40">
+        <position x="977" y="0" z="-212" />
+      </update>
+      <update dTime="40">
+        <position x="987" y="0" z="-163" />
+      </update>
+      <update dTime="40">
+        <position x="994" y="0" z="-113" />
+      </update>
+      <update dTime="40">
+        <position x="998" y="0" z="-63" />
+      </update>
+      <update dTime="40">
+        <position x="1000" y="0" z="-13" />
+      </update>
+      <update dTime="40">
+        <position x="999" y="0" z="38" />
+      </update>
+      <update dTime="40">
+        <position x="996" y="0" z="88" />
+      </update>
+      <update dTime="40">
+        <position x="990" y="0" z="138" />
+      </update>
+      <update dTime="40">
+        <position x="982" y="0" z="187" />
+      </update>
+      <update dTime="40">
+        <position x="972" y="0" z="236" />
+      </update>
+      <update dTime="40">
+        <position x="959" y="0" z="285" />
+      </update>
+      <update dTime="40">
+        <position x="943" y="0" z="333" />
+      </update>
+      <update dTime="40">
+        <position x="925" y="0" z="380" />
+      </update>
+      <update dTime="40">
+        <position x="905" y="0" z="426" />
+      </update>
+      <update dTime="40">
+        <position x="882" y="0" z="471" />
+      </update>
+      <update dTime="40">
+        <position x="858" y="0" z="514" />
+      </update>
+      <update dTime="40">
+        <position x="831" y="0" z="557" />
+      </update>
+      <update dTime="40">
+        <position x="802" y="0" z="598" />
+      </update>
+      <update dTime="40">
+        <position x="771" y="0" z="637" />
+      </update>
+      <update dTime="40">
+        <position x="738" y="0" z="675" />
+      </update>
+      <update dTime="40">
+        <position x="703" y="0" z="712" />
+      </update>
+      <update dTime="40">
+        <position x="666" y="0" z="746" />
+      </update>
+      <update dTime="40">
+        <position x="628" y="0" z="778" />
+      </update>
+      <update dTime="40">
+        <position x="588" y="0" z="809" />
+      </update>
+      <update dTime="40">
+        <position x="546" y="0" z="838" />
+      </update>
+      <update dTime="40">
+        <position x="504" y="0" z="864" />
+      </update>
+      <update dTime="40">
+        <position x="460" y="0" z="888" />
+      </update>
+      <update dTime="40">
+        <position x="414" y="0" z="910" />
+      </update>
+      <update dTime="40">
+        <position x="368" y="0" z="930" />
+      </update>
+      <update dTime="40">
+        <position x="321" y="0" z="947" />
+      </update>
+      <update dTime="40">
+        <position x="273" y="0" z="962" />
+      </update>
+      <update dTime="40">
+        <position x="224" y="0" z="975" />
+      </update>
+      <update dTime="40">
+        <position x="175" y="0" z="985" />
+      </update>
+      <update dTime="40">
+        <position x="125" y="0" z="992" />
+      </update>
+      <update dTime="40">
+        <position x="75" y="0" z="997" />
+      </update>
+      <update dTime="40">
+        <position x="25" y="0" z="1000" />
+      </update>
+      <update dTime="40">
+        <position x="-25" y="0" z="1000" />
+      </update>
+      <update dTime="40">
+        <position x="-75" y="0" z="997" />
+      </update>
+      <update dTime="40">
+        <position x="-125" y="0" z="992" />
+      </update>
+      <update dTime="40">
+        <position x="-175" y="0" z="985" />
+      </update>
+      <update dTime="40">
+        <position x="-224" y="0" z="975" />
+      </update>
+      <update dTime="40">
+        <position x="-273" y="0" z="962" />
+      </update>
+      <update dTime="40">
+        <position x="-321" y="0" z="947" />
+      </update>
+      <update dTime="40">
+        <position x="-368" y="0" z="930" />
+      </update>
+      <update dTime="40">
+        <position x="-414" y="0" z="910" />
+      </update>
+      <update dTime="40">
+        <position x="-460" y="0" z="888" />
+      </update>
+      <update dTime="40">
+        <position x="-504" y="0" z="864" />
+      </update>
+      <update dTime="40">
+        <position x="-546" y="0" z="838" />
+      </update>
+      <update dTime="40">
+        <position x="-588" y="0" z="809" />
+      </update>
+      <update dTime="40">
+        <position x="-628" y="0" z="778" />
+      </update>
+      <update dTime="40">
+        <position x="-666" y="0" z="746" />
+      </update>
+      <update dTime="40">
+        <position x="-703" y="0" z="712" />
+      </update>
+      <update dTime="40">
+        <position x="-738" y="0" z="675" />
+      </update>
+      <update dTime="40">
+        <position x="-771" y="0" z="637" />
+      </update>
+      <update dTime="40">
+        <position x="-802" y="0" z="598" />
+      </update>
+      <update dTime="40">
+        <position x="-831" y="0" z="557" />
+      </update>
+      <update dTime="40">
+        <position x="-858" y="0" z="514" />
+      </update>
+      <update dTime="40">
+        <position x="-882" y="0" z="471" />
+      </update>
+      <update dTime="40">
+        <position x="-905" y="0" z="426" />
+      </update>
+      <update dTime="40">
+        <position x="-925" y="0" z="380" />
+      </update>
+      <update dTime="40">
+        <position x="-943" y="0" z="333" />
+      </update>
+      <update dTime="40">
+        <position x="-959" y="0" z="285" />
+      </update>
+      <update dTime="40">
+        <position x="-972" y="0" z="236" />
+      </update>
+      <update dTime="40">
+        <position x="-982" y="0" z="187" />
+      </update>
+      <update dTime="40">
+        <position x="-990" y="0" z="138" />
+      </update>
+      <update dTime="40">
+        <position x="-996" y="0" z="88" />
+      </update>
+      <update dTime="40">
+        <position x="-999" y="0" z="38" />
+      </update>
+      <update dTime="40">
+        <position x="-1000" y="0" z="-13" />
+      </update>
+      <update dTime="40">
+        <position x="-998" y="0" z="-63" />
+      </update>
+      <update dTime="40">
+        <position x="-994" y="0" z="-113" />
+      </update>
+      <update dTime="40">
+        <position x="-987" y="0" z="-163" />
+      </update>
+      <update dTime="40">
+        <position x="-977" y="0" z="-212" />
+      </update>
+      <update dTime="40">
+        <position x="-965" y="0" z="-261" />
+      </update>
+      <update dTime="40">
+        <position x="-951" y="0" z="-309" />
+      </update>
+      <update dTime="40">
+        <position x="-934" y="0" z="-356" />
+      </update>
+      <update dTime="40">
+        <position x="-915" y="0" z="-403" />
+      </update>
+      <update dTime="40">
+        <position x="-894" y="0" z="-448" />
+      </update>
+      <update dTime="40">
+        <position x="-870" y="0" z="-493" />
+      </update>
+      <update dTime="40">
+        <position x="-844" y="0" z="-536" />
+      </update>
+      <update dTime="40">
+        <position x="-816" y="0" z="-578" />
+      </update>
+      <update dTime="40">
+        <position x="-786" y="0" z="-618" />
+      </update>
+      <update dTime="40">
+        <position x="-754" y="0" z="-657" />
+      </update>
+      <update dTime="40">
+        <position x="-720" y="0" z="-694" />
+      </update>
+      <update dTime="40">
+        <position x="-685" y="0" z="-729" />
+      </update>
+      <update dTime="40">
+        <position x="-647" y="0" z="-762" />
+      </update>
+      <update dTime="40">
+        <position x="-608" y="0" z="-794" />
+      </update>
+      <update dTime="40">
+        <position x="-567" y="0" z="-824" />
+      </update>
+      <update dTime="40">
+        <position x="-525" y="0" z="-851" />
+      </update>
+      <update dTime="40">
+        <position x="-482" y="0" z="-876" />
+      </update>
+      <update dTime="40">
+        <position x="-437" y="0" z="-899" />
+      </update>
+      <update dTime="40">
+        <position x="-391" y="0" z="-920" />
+      </update>
+      <update dTime="40">
+        <position x="-345" y="0" z="-939" />
+      </update>
+      <update dTime="40">
+        <position x="-297" y="0" z="-955" />
+      </update>
+      <update dTime="40">
+        <position x="-249" y="0" z="-969" />
+      </update>
+      <update dTime="40">
+        <position x="-200" y="0" z="-980" />
+      </update>
+      <update dTime="40">
+        <position x="-150" y="0" z="-989" />
+      </update>
+      <update dTime="40">
+        <position x="-100" y="0" z="-995" />
+      </update>
+      <update dTime="40">
+        <position x="-50" y="0" z="-999" />
+      </update>
+      <update dTime="40">
+        <position x="0" y="0" z="-1000" />
+      </update>
+    </loop>
+  </script>
+</pattern-3d>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/data/patterns/2flyby.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1012 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Flyby pattern generated by write_flyby_pattern.m-->
+<pattern-3d>
+  <initialization doppler="true" reverb="Forest" name="Flyby">
+    <position x="10000" y="750" z="-750" />
+    <velocity x="0" y="0" z="0" />
+  </initialization>
+  <script>
+    <loop>
+      <update dTime="500">
+        <position x="9840" y="750" z="-750" />
+        <velocity x="-800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9680" y="750" z="-750" />
+        <velocity x="-1600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9520" y="750" z="-750" />
+        <velocity x="-2400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9360" y="750" z="-750" />
+        <velocity x="-3200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9200" y="750" z="-750" />
+        <velocity x="-4000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9040" y="750" z="-750" />
+        <velocity x="-4800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8880" y="750" z="-750" />
+        <velocity x="-5600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8720" y="750" z="-750" />
+        <velocity x="-6400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8560" y="750" z="-750" />
+        <velocity x="-7200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8400" y="750" z="-750" />
+        <velocity x="-8000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8240" y="750" z="-750" />
+        <velocity x="-8800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8080" y="750" z="-750" />
+        <velocity x="-9600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7920" y="750" z="-750" />
+        <velocity x="-10400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7760" y="750" z="-750" />
+        <velocity x="-11200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7600" y="750" z="-750" />
+        <velocity x="-12000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7440" y="750" z="-750" />
+        <velocity x="-12800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7280" y="750" z="-750" />
+        <velocity x="-13600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7120" y="750" z="-750" />
+        <velocity x="-14400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6960" y="750" z="-750" />
+        <velocity x="-15200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6800" y="750" z="-750" />
+        <velocity x="-16000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6640" y="750" z="-750" />
+        <velocity x="-16800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6480" y="750" z="-750" />
+        <velocity x="-17600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6320" y="750" z="-750" />
+        <velocity x="-18400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6160" y="750" z="-750" />
+        <velocity x="-19200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6000" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5840" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5680" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5520" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5360" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5200" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5040" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4880" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4720" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4560" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4400" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4240" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4080" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3920" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3760" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3600" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3440" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3280" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3120" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2960" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2800" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2640" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2480" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2320" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2160" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2000" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1840" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1680" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1520" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1360" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1200" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1040" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="880" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="720" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="560" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="400" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="240" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="80" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-80" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-240" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-400" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-560" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-720" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-880" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1040" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1200" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1360" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1520" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1680" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1840" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2000" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2160" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2320" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2480" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2640" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2800" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2960" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3120" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3280" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3440" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3600" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3760" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3920" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4080" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4240" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4400" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4560" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4720" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4880" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5040" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5200" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5360" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5520" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5680" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5840" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6000" y="750" z="-750" />
+        <velocity x="-20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6160" y="750" z="-750" />
+        <velocity x="-19200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6320" y="750" z="-750" />
+        <velocity x="-18400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6480" y="750" z="-750" />
+        <velocity x="-17600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6640" y="750" z="-750" />
+        <velocity x="-16800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6800" y="750" z="-750" />
+        <velocity x="-16000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6960" y="750" z="-750" />
+        <velocity x="-15200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7120" y="750" z="-750" />
+        <velocity x="-14400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7280" y="750" z="-750" />
+        <velocity x="-13600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7440" y="750" z="-750" />
+        <velocity x="-12800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7600" y="750" z="-750" />
+        <velocity x="-12000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7760" y="750" z="-750" />
+        <velocity x="-11200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7920" y="750" z="-750" />
+        <velocity x="-10400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8080" y="750" z="-750" />
+        <velocity x="-9600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8240" y="750" z="-750" />
+        <velocity x="-8800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8400" y="750" z="-750" />
+        <velocity x="-8000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8560" y="750" z="-750" />
+        <velocity x="-7200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8720" y="750" z="-750" />
+        <velocity x="-6400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8880" y="750" z="-750" />
+        <velocity x="-5600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9040" y="750" z="-750" />
+        <velocity x="-4800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9200" y="750" z="-750" />
+        <velocity x="-4000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9360" y="750" z="-750" />
+        <velocity x="-3200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9520" y="750" z="-750" />
+        <velocity x="-2400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9680" y="750" z="-750" />
+        <velocity x="-1600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9840" y="750" z="-750" />
+        <velocity x="-800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-10000" y="750" z="-750" />
+        <velocity x="0" y="0" z="0" />
+      </update>
+      <update dTime="500">
+        <position x="-9840" y="750" z="-750" />
+        <velocity x="800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9680" y="750" z="-750" />
+        <velocity x="1600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9520" y="750" z="-750" />
+        <velocity x="2400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9360" y="750" z="-750" />
+        <velocity x="3200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9200" y="750" z="-750" />
+        <velocity x="4000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-9040" y="750" z="-750" />
+        <velocity x="4800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8880" y="750" z="-750" />
+        <velocity x="5600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8720" y="750" z="-750" />
+        <velocity x="6400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8560" y="750" z="-750" />
+        <velocity x="7200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8400" y="750" z="-750" />
+        <velocity x="8000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8240" y="750" z="-750" />
+        <velocity x="8800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-8080" y="750" z="-750" />
+        <velocity x="9600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7920" y="750" z="-750" />
+        <velocity x="10400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7760" y="750" z="-750" />
+        <velocity x="11200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7600" y="750" z="-750" />
+        <velocity x="12000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7440" y="750" z="-750" />
+        <velocity x="12800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7280" y="750" z="-750" />
+        <velocity x="13600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-7120" y="750" z="-750" />
+        <velocity x="14400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6960" y="750" z="-750" />
+        <velocity x="15200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6800" y="750" z="-750" />
+        <velocity x="16000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6640" y="750" z="-750" />
+        <velocity x="16800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6480" y="750" z="-750" />
+        <velocity x="17600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6320" y="750" z="-750" />
+        <velocity x="18400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6160" y="750" z="-750" />
+        <velocity x="19200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-6000" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5840" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5680" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5520" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5360" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5200" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-5040" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4880" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4720" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4560" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4400" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4240" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-4080" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3920" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3760" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3600" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3440" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3280" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-3120" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2960" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2800" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2640" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2480" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2320" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2160" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-2000" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1840" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1680" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1520" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1360" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1200" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-1040" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-880" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-720" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-560" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-400" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-240" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="-80" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="80" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="240" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="400" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="560" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="720" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="880" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1040" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1200" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1360" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1520" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1680" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="1840" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2000" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2160" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2320" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2480" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2640" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2800" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="2960" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3120" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3280" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3440" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3600" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3760" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="3920" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4080" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4240" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4400" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4560" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4720" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="4880" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5040" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5200" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5360" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5520" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5680" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="5840" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6000" y="750" z="-750" />
+        <velocity x="20000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6160" y="750" z="-750" />
+        <velocity x="19200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6320" y="750" z="-750" />
+        <velocity x="18400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6480" y="750" z="-750" />
+        <velocity x="17600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6640" y="750" z="-750" />
+        <velocity x="16800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6800" y="750" z="-750" />
+        <velocity x="16000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="6960" y="750" z="-750" />
+        <velocity x="15200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7120" y="750" z="-750" />
+        <velocity x="14400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7280" y="750" z="-750" />
+        <velocity x="13600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7440" y="750" z="-750" />
+        <velocity x="12800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7600" y="750" z="-750" />
+        <velocity x="12000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7760" y="750" z="-750" />
+        <velocity x="11200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="7920" y="750" z="-750" />
+        <velocity x="10400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8080" y="750" z="-750" />
+        <velocity x="9600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8240" y="750" z="-750" />
+        <velocity x="8800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8400" y="750" z="-750" />
+        <velocity x="8000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8560" y="750" z="-750" />
+        <velocity x="7200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8720" y="750" z="-750" />
+        <velocity x="6400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="8880" y="750" z="-750" />
+        <velocity x="5600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9040" y="750" z="-750" />
+        <velocity x="4800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9200" y="750" z="-750" />
+        <velocity x="4000" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9360" y="750" z="-750" />
+        <velocity x="3200" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9520" y="750" z="-750" />
+        <velocity x="2400" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9680" y="750" z="-750" />
+        <velocity x="1600" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="9840" y="750" z="-750" />
+        <velocity x="800" y="0" z="0" />
+      </update>
+      <update dTime="40">
+        <position x="10000" y="750" z="-750" />
+        <velocity x="0" y="0" z="0" />
+      </update>
+    </loop>
+  </script>
+</pattern-3d>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/data/patterns/3zigzag.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,479 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Zigzag pattern generated by write_zigzag_pattern.m-->
+<pattern-3d>
+  <initialization doppler="false" reverb="Cave" name="Zigzag">
+    <position x="1000" y="0" z="-4000" />
+  </initialization>
+  <script>
+    <loop>
+      <update dTime="500">
+        <position x="846" y="0" z="-2923" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="-2846" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="-2769" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="-2692" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="-2615" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="-2538" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="-2462" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="-2385" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="-2308" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="-2231" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="-2154" />
+      </update>
+      <update dTime="40">
+        <position x="-846" y="0" z="-2077" />
+      </update>
+      <update dTime="40">
+        <position x="-1000" y="0" z="-2000" />
+      </update>
+      <update dTime="500">
+        <position x="-846" y="0" z="-1923" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="-1846" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="-1769" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="-1692" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="-1615" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="-1538" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="-1462" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="-1385" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="-1308" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="-1231" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="-1154" />
+      </update>
+      <update dTime="40">
+        <position x="846" y="0" z="-1077" />
+      </update>
+      <update dTime="40">
+        <position x="1000" y="0" z="-1000" />
+      </update>
+      <update dTime="500">
+        <position x="846" y="0" z="-923" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="-846" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="-769" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="-692" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="-615" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="-538" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="-462" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="-385" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="-308" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="-231" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="-154" />
+      </update>
+      <update dTime="40">
+        <position x="-846" y="0" z="-77" />
+      </update>
+      <update dTime="40">
+        <position x="-1000" y="0" z="0" />
+      </update>
+      <update dTime="500">
+        <position x="-846" y="0" z="77" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="154" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="231" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="308" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="385" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="462" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="538" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="615" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="692" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="769" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="846" />
+      </update>
+      <update dTime="40">
+        <position x="846" y="0" z="923" />
+      </update>
+      <update dTime="40">
+        <position x="1000" y="0" z="1000" />
+      </update>
+      <update dTime="500">
+        <position x="846" y="0" z="1077" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="1154" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="1231" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="1308" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="1385" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="1462" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="1538" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="1615" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="1692" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="1769" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="1846" />
+      </update>
+      <update dTime="40">
+        <position x="-846" y="0" z="1923" />
+      </update>
+      <update dTime="40">
+        <position x="-1000" y="0" z="2000" />
+      </update>
+      <update dTime="500">
+        <position x="-846" y="0" z="2077" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="2154" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="2231" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="2308" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="2385" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="2462" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="2538" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="2615" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="2692" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="2769" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="2846" />
+      </update>
+      <update dTime="40">
+        <position x="846" y="0" z="2923" />
+      </update>
+      <update dTime="40">
+        <position x="1000" y="0" z="3000" />
+      </update>
+      <update dTime="500">
+        <position x="846" y="0" z="2923" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="2846" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="2769" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="2692" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="2615" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="2538" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="2462" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="2385" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="2308" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="2231" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="2154" />
+      </update>
+      <update dTime="40">
+        <position x="-846" y="0" z="2077" />
+      </update>
+      <update dTime="40">
+        <position x="-1000" y="0" z="2000" />
+      </update>
+      <update dTime="500">
+        <position x="-846" y="0" z="1923" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="1846" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="1769" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="1692" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="1615" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="1538" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="1462" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="1385" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="1308" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="1231" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="1154" />
+      </update>
+      <update dTime="40">
+        <position x="846" y="0" z="1077" />
+      </update>
+      <update dTime="40">
+        <position x="1000" y="0" z="1000" />
+      </update>
+      <update dTime="500">
+        <position x="846" y="0" z="923" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="846" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="769" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="692" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="615" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="538" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="462" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="385" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="308" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="231" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="154" />
+      </update>
+      <update dTime="40">
+        <position x="-846" y="0" z="77" />
+      </update>
+      <update dTime="40">
+        <position x="-1000" y="0" z="0" />
+      </update>
+      <update dTime="500">
+        <position x="-846" y="0" z="-77" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="-154" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="-231" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="-308" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="-385" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="-462" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="-538" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="-615" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="-692" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="-769" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="-846" />
+      </update>
+      <update dTime="40">
+        <position x="846" y="0" z="-923" />
+      </update>
+      <update dTime="40">
+        <position x="1000" y="0" z="-1000" />
+      </update>
+      <update dTime="500">
+        <position x="846" y="0" z="-1077" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="-1154" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="-1231" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="-1308" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="-1385" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="-1462" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="-1538" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="-1615" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="-1692" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="-1769" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="-1846" />
+      </update>
+      <update dTime="40">
+        <position x="-846" y="0" z="-1923" />
+      </update>
+      <update dTime="40">
+        <position x="-1000" y="0" z="-2000" />
+      </update>
+      <update dTime="500">
+        <position x="-846" y="0" z="-2077" />
+      </update>
+      <update dTime="40">
+        <position x="-692" y="0" z="-2154" />
+      </update>
+      <update dTime="40">
+        <position x="-538" y="0" z="-2231" />
+      </update>
+      <update dTime="40">
+        <position x="-385" y="0" z="-2308" />
+      </update>
+      <update dTime="40">
+        <position x="-231" y="0" z="-2385" />
+      </update>
+      <update dTime="40">
+        <position x="-77" y="0" z="-2462" />
+      </update>
+      <update dTime="40">
+        <position x="77" y="0" z="-2538" />
+      </update>
+      <update dTime="40">
+        <position x="231" y="0" z="-2615" />
+      </update>
+      <update dTime="40">
+        <position x="385" y="0" z="-2692" />
+      </update>
+      <update dTime="40">
+        <position x="538" y="0" z="-2769" />
+      </update>
+      <update dTime="40">
+        <position x="692" y="0" z="-2846" />
+      </update>
+      <update dTime="40">
+        <position x="846" y="0" z="-2923" />
+      </update>
+      <update dTime="40">
+        <position x="1000" y="0" z="-3000" />
+      </update>
+    </loop>
+  </script>
+</pattern-3d>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/data/patterns/4meander.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,731 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Meander pattern generated by write_meander_pattern.m-->
+<pattern-3d>
+  <initialization doppler="false" reverb="Forest" name="Meander">
+    <position x="0" y="0" z="-1000" />
+  </initialization>
+  <script>
+    <loop>
+      <update dTime="200">
+        <position x="-154" y="0" z="-1170" />
+      </update>
+      <update dTime="200">
+        <position x="-165" y="0" z="-1060" />
+      </update>
+      <update dTime="200">
+        <position x="77" y="0" z="-1113" />
+      </update>
+      <update dTime="200">
+        <position x="285" y="0" z="-1072" />
+      </update>
+      <update dTime="200">
+        <position x="500" y="0" z="-1163" />
+      </update>
+      <update dTime="200">
+        <position x="597" y="0" z="-1234" />
+      </update>
+      <update dTime="200">
+        <position x="758" y="0" z="-1121" />
+      </update>
+      <update dTime="200">
+        <position x="804" y="0" z="-838" />
+      </update>
+      <update dTime="200">
+        <position x="938" y="0" z="-885" />
+      </update>
+      <update dTime="200">
+        <position x="1074" y="0" z="-673" />
+      </update>
+      <update dTime="200">
+        <position x="977" y="0" z="-878" />
+      </update>
+      <update dTime="200">
+        <position x="1177" y="0" z="-813" />
+      </update>
+      <update dTime="200">
+        <position x="1193" y="0" z="-1064" />
+      </update>
+      <update dTime="200">
+        <position x="1347" y="0" z="-1028" />
+      </update>
+      <update dTime="200">
+        <position x="1367" y="0" z="-762" />
+      </update>
+      <update dTime="200">
+        <position x="1381" y="0" z="-653" />
+      </update>
+      <update dTime="200">
+        <position x="1592" y="0" z="-599" />
+      </update>
+      <update dTime="200">
+        <position x="1853" y="0" z="-236" />
+      </update>
+      <update dTime="200">
+        <position x="1755" y="0" z="-527" />
+      </update>
+      <update dTime="200">
+        <position x="1982" y="0" z="-172" />
+      </update>
+      <update dTime="200">
+        <position x="1752" y="0" z="-464" />
+      </update>
+      <update dTime="200">
+        <position x="1703" y="0" z="-420" />
+      </update>
+      <update dTime="200">
+        <position x="1871" y="0" z="-178" />
+      </update>
+      <update dTime="200">
+        <position x="1683" y="0" z="8" />
+      </update>
+      <update dTime="200">
+        <position x="1528" y="0" z="-179" />
+      </update>
+      <update dTime="200">
+        <position x="1401" y="0" z="-228" />
+      </update>
+      <update dTime="200">
+        <position x="1299" y="0" z="-3" />
+      </update>
+      <update dTime="200">
+        <position x="1332" y="0" z="155" />
+      </update>
+      <update dTime="200">
+        <position x="1219" y="0" z="276" />
+      </update>
+      <update dTime="200">
+        <position x="1128" y="0" z="60" />
+      </update>
+      <update dTime="200">
+        <position x="933" y="0" z="-61" />
+      </update>
+      <update dTime="200">
+        <position x="1019" y="0" z="-177" />
+      </update>
+      <update dTime="200">
+        <position x="992" y="0" z="-200" />
+      </update>
+      <update dTime="200">
+        <position x="1174" y="0" z="-158" />
+      </update>
+      <update dTime="200">
+        <position x="1169" y="0" z="-66" />
+      </update>
+      <update dTime="200">
+        <position x="1137" y="0" z="-70" />
+      </update>
+      <update dTime="200">
+        <position x="1276" y="0" z="-52" />
+      </update>
+      <update dTime="200">
+        <position x="1281" y="0" z="-123" />
+      </update>
+      <update dTime="200">
+        <position x="1134" y="0" z="-282" />
+      </update>
+      <update dTime="200">
+        <position x="1226" y="0" z="-168" />
+      </update>
+      <update dTime="200">
+        <position x="1372" y="0" z="31" />
+      </update>
+      <update dTime="200">
+        <position x="1180" y="0" z="14" />
+      </update>
+      <update dTime="200">
+        <position x="1253" y="0" z="26" />
+      </update>
+      <update dTime="200">
+        <position x="1203" y="0" z="-56" />
+      </update>
+      <update dTime="200">
+        <position x="1337" y="0" z="-39" />
+      </update>
+      <update dTime="200">
+        <position x="1333" y="0" z="119" />
+      </update>
+      <update dTime="200">
+        <position x="1421" y="0" z="-61" />
+      </update>
+      <update dTime="200">
+        <position x="1387" y="0" z="-140" />
+      </update>
+      <update dTime="200">
+        <position x="1314" y="0" z="74" />
+      </update>
+      <update dTime="200">
+        <position x="1187" y="0" z="105" />
+      </update>
+      <update dTime="200">
+        <position x="1069" y="0" z="-16" />
+      </update>
+      <update dTime="200">
+        <position x="1140" y="0" z="-69" />
+      </update>
+      <update dTime="200">
+        <position x="1060" y="0" z="-82" />
+      </update>
+      <update dTime="200">
+        <position x="1074" y="0" z="-107" />
+      </update>
+      <update dTime="200">
+        <position x="939" y="0" z="-29" />
+      </update>
+      <update dTime="200">
+        <position x="1013" y="0" z="107" />
+      </update>
+      <update dTime="200">
+        <position x="969" y="0" z="53" />
+      </update>
+      <update dTime="200">
+        <position x="1105" y="0" z="145" />
+      </update>
+      <update dTime="200">
+        <position x="1232" y="0" z="242" />
+      </update>
+      <update dTime="200">
+        <position x="1244" y="0" z="353" />
+      </update>
+      <update dTime="200">
+        <position x="1269" y="0" z="245" />
+      </update>
+      <update dTime="200">
+        <position x="1403" y="0" z="374" />
+      </update>
+      <update dTime="200">
+        <position x="1471" y="0" z="577" />
+      </update>
+      <update dTime="200">
+        <position x="1347" y="0" z="932" />
+      </update>
+      <update dTime="200">
+        <position x="1596" y="0" z="755" />
+      </update>
+      <update dTime="200">
+        <position x="1702" y="0" z="672" />
+      </update>
+      <update dTime="200">
+        <position x="1720" y="0" z="403" />
+      </update>
+      <update dTime="200">
+        <position x="1678" y="0" z="125" />
+      </update>
+      <update dTime="200">
+        <position x="1605" y="0" z="210" />
+      </update>
+      <update dTime="200">
+        <position x="1632" y="0" z="1" />
+      </update>
+      <update dTime="200">
+        <position x="1685" y="0" z="361" />
+      </update>
+      <update dTime="200">
+        <position x="1624" y="0" z="273" />
+      </update>
+      <update dTime="200">
+        <position x="1773" y="0" z="181" />
+      </update>
+      <update dTime="200">
+        <position x="1781" y="0" z="318" />
+      </update>
+      <update dTime="200">
+        <position x="1648" y="0" z="611" />
+      </update>
+      <update dTime="200">
+        <position x="1705" y="0" z="688" />
+      </update>
+      <update dTime="200">
+        <position x="1686" y="0" z="780" />
+      </update>
+      <update dTime="200">
+        <position x="1765" y="0" z="503" />
+      </update>
+      <update dTime="200">
+        <position x="1675" y="0" z="925" />
+      </update>
+      <update dTime="200">
+        <position x="1496" y="0" z="1270" />
+      </update>
+      <update dTime="200">
+        <position x="1489" y="0" z="1452" />
+      </update>
+      <update dTime="200">
+        <position x="1309" y="0" z="1845" />
+      </update>
+      <update dTime="200">
+        <position x="1017" y="0" z="2031" />
+      </update>
+      <update dTime="200">
+        <position x="1450" y="0" z="1942" />
+      </update>
+      <update dTime="200">
+        <position x="1248" y="0" z="1923" />
+      </update>
+      <update dTime="200">
+        <position x="1273" y="0" z="2134" />
+      </update>
+      <update dTime="200">
+        <position x="929" y="0" z="2205" />
+      </update>
+      <update dTime="200">
+        <position x="423" y="0" z="2255" />
+      </update>
+      <update dTime="200">
+        <position x="372" y="0" z="2416" />
+      </update>
+      <update dTime="200">
+        <position x="661" y="0" z="2452" />
+      </update>
+      <update dTime="200">
+        <position x="205" y="0" z="2385" />
+      </update>
+      <update dTime="200">
+        <position x="47" y="0" z="2198" />
+      </update>
+      <update dTime="200">
+        <position x="290" y="0" z="2338" />
+      </update>
+      <update dTime="200">
+        <position x="383" y="0" z="2203" />
+      </update>
+      <update dTime="200">
+        <position x="100" y="0" z="2153" />
+      </update>
+      <update dTime="200">
+        <position x="491" y="0" z="2165" />
+      </update>
+      <update dTime="200">
+        <position x="78" y="0" z="2132" />
+      </update>
+      <update dTime="200">
+        <position x="281" y="0" z="2103" />
+      </update>
+      <update dTime="200">
+        <position x="295" y="0" z="1925" />
+      </update>
+      <update dTime="200">
+        <position x="186" y="0" z="2135" />
+      </update>
+      <update dTime="200">
+        <position x="534" y="0" z="2109" />
+      </update>
+      <update dTime="200">
+        <position x="331" y="0" z="2119" />
+      </update>
+      <update dTime="200">
+        <position x="154" y="0" z="2146" />
+      </update>
+      <update dTime="200">
+        <position x="413" y="0" z="2044" />
+      </update>
+      <update dTime="200">
+        <position x="653" y="0" z="1952" />
+      </update>
+      <update dTime="200">
+        <position x="437" y="0" z="1899" />
+      </update>
+      <update dTime="200">
+        <position x="238" y="0" z="1966" />
+      </update>
+      <update dTime="200">
+        <position x="295" y="0" z="2064" />
+      </update>
+      <update dTime="200">
+        <position x="499" y="0" z="2036" />
+      </update>
+      <update dTime="200">
+        <position x="569" y="0" z="2076" />
+      </update>
+      <update dTime="200">
+        <position x="679" y="0" z="1920" />
+      </update>
+      <update dTime="200">
+        <position x="238" y="0" z="1974" />
+      </update>
+      <update dTime="200">
+        <position x="232" y="0" z="2089" />
+      </update>
+      <update dTime="200">
+        <position x="-240" y="0" z="2161" />
+      </update>
+      <update dTime="200">
+        <position x="-363" y="0" z="2128" />
+      </update>
+      <update dTime="200">
+        <position x="-393" y="0" z="2150" />
+      </update>
+      <update dTime="200">
+        <position x="-717" y="0" z="2189" />
+      </update>
+      <update dTime="200">
+        <position x="-775" y="0" z="1981" />
+      </update>
+      <update dTime="200">
+        <position x="-628" y="0" z="2075" />
+      </update>
+      <update dTime="200">
+        <position x="-368" y="0" z="1954" />
+      </update>
+      <update dTime="200">
+        <position x="-770" y="0" z="1796" />
+      </update>
+      <update dTime="200">
+        <position x="-864" y="0" z="1666" />
+      </update>
+      <update dTime="200">
+        <position x="-741" y="0" z="1886" />
+      </update>
+      <update dTime="200">
+        <position x="-428" y="0" z="1781" />
+      </update>
+      <update dTime="200">
+        <position x="-119" y="0" z="1936" />
+      </update>
+      <update dTime="200">
+        <position x="-248" y="0" z="2113" />
+      </update>
+      <update dTime="200">
+        <position x="-129" y="0" z="2320" />
+      </update>
+      <update dTime="200">
+        <position x="-110" y="0" z="2437" />
+      </update>
+      <update dTime="200">
+        <position x="-80" y="0" z="2413" />
+      </update>
+      <update dTime="200">
+        <position x="-272" y="0" z="2399" />
+      </update>
+      <update dTime="200">
+        <position x="113" y="0" z="2297" />
+      </update>
+      <update dTime="200">
+        <position x="455" y="0" z="2313" />
+      </update>
+      <update dTime="200">
+        <position x="747" y="0" z="2159" />
+      </update>
+      <update dTime="200">
+        <position x="636" y="0" z="2386" />
+      </update>
+      <update dTime="200">
+        <position x="149" y="0" z="2555" />
+      </update>
+      <update dTime="200">
+        <position x="-112" y="0" z="2522" />
+      </update>
+      <update dTime="200">
+        <position x="-409" y="0" z="2590" />
+      </update>
+      <update dTime="200">
+        <position x="-264" y="0" z="2516" />
+      </update>
+      <update dTime="200">
+        <position x="-700" y="0" z="2406" />
+      </update>
+      <update dTime="200">
+        <position x="-369" y="0" z="2653" />
+      </update>
+      <update dTime="200">
+        <position x="-198" y="0" z="2745" />
+      </update>
+      <update dTime="200">
+        <position x="-477" y="0" z="2594" />
+      </update>
+      <update dTime="200">
+        <position x="-801" y="0" z="2654" />
+      </update>
+      <update dTime="200">
+        <position x="-578" y="0" z="2765" />
+      </update>
+      <update dTime="200">
+        <position x="-389" y="0" z="2649" />
+      </update>
+      <update dTime="200">
+        <position x="-480" y="0" z="2515" />
+      </update>
+      <update dTime="200">
+        <position x="-1011" y="0" z="2399" />
+      </update>
+      <update dTime="200">
+        <position x="-816" y="0" z="2527" />
+      </update>
+      <update dTime="200">
+        <position x="-1178" y="0" z="2322" />
+      </update>
+      <update dTime="200">
+        <position x="-956" y="0" z="2454" />
+      </update>
+      <update dTime="200">
+        <position x="-1430" y="0" z="2189" />
+      </update>
+      <update dTime="200">
+        <position x="-1032" y="0" z="2202" />
+      </update>
+      <update dTime="200">
+        <position x="-1223" y="0" z="1880" />
+      </update>
+      <update dTime="200">
+        <position x="-1086" y="0" z="1876" />
+      </update>
+      <update dTime="200">
+        <position x="-963" y="0" z="1722" />
+      </update>
+      <update dTime="200">
+        <position x="-1133" y="0" z="1558" />
+      </update>
+      <update dTime="200">
+        <position x="-1120" y="0" z="1657" />
+      </update>
+      <update dTime="200">
+        <position x="-1286" y="0" z="1311" />
+      </update>
+      <update dTime="200">
+        <position x="-1084" y="0" z="1246" />
+      </update>
+      <update dTime="200">
+        <position x="-955" y="0" z="1402" />
+      </update>
+      <update dTime="200">
+        <position x="-1234" y="0" z="1226" />
+      </update>
+      <update dTime="200">
+        <position x="-1026" y="0" z="1156" />
+      </update>
+      <update dTime="200">
+        <position x="-1025" y="0" z="883" />
+      </update>
+      <update dTime="200">
+        <position x="-881" y="0" z="856" />
+      </update>
+      <update dTime="200">
+        <position x="-819" y="0" z="961" />
+      </update>
+      <update dTime="200">
+        <position x="-809" y="0" z="725" />
+      </update>
+      <update dTime="200">
+        <position x="-683" y="0" z="776" />
+      </update>
+      <update dTime="200">
+        <position x="-817" y="0" z="715" />
+      </update>
+      <update dTime="200">
+        <position x="-827" y="0" z="832" />
+      </update>
+      <update dTime="200">
+        <position x="-1005" y="0" z="743" />
+      </update>
+      <update dTime="200">
+        <position x="-790" y="0" z="741" />
+      </update>
+      <update dTime="200">
+        <position x="-822" y="0" z="677" />
+      </update>
+      <update dTime="200">
+        <position x="-795" y="0" z="674" />
+      </update>
+      <update dTime="200">
+        <position x="-810" y="0" z="557" />
+      </update>
+      <update dTime="200">
+        <position x="-710" y="0" z="458" />
+      </update>
+      <update dTime="200">
+        <position x="-793" y="0" z="456" />
+      </update>
+      <update dTime="200">
+        <position x="-770" y="0" z="629" />
+      </update>
+      <update dTime="200">
+        <position x="-969" y="0" z="489" />
+      </update>
+      <update dTime="200">
+        <position x="-889" y="0" z="608" />
+      </update>
+      <update dTime="200">
+        <position x="-955" y="0" z="544" />
+      </update>
+      <update dTime="200">
+        <position x="-895" y="0" z="310" />
+      </update>
+      <update dTime="200">
+        <position x="-911" y="0" z="176" />
+      </update>
+      <update dTime="200">
+        <position x="-978" y="0" z="267" />
+      </update>
+      <update dTime="200">
+        <position x="-1151" y="0" z="218" />
+      </update>
+      <update dTime="200">
+        <position x="-1071" y="0" z="144" />
+      </update>
+      <update dTime="200">
+        <position x="-964" y="0" z="191" />
+      </update>
+      <update dTime="200">
+        <position x="-1096" y="0" z="268" />
+      </update>
+      <update dTime="200">
+        <position x="-1021" y="0" z="20" />
+      </update>
+      <update dTime="200">
+        <position x="-1142" y="0" z="-66" />
+      </update>
+      <update dTime="200">
+        <position x="-1306" y="0" z="47" />
+      </update>
+      <update dTime="200">
+        <position x="-1199" y="0" z="-24" />
+      </update>
+      <update dTime="200">
+        <position x="-1071" y="0" z="-231" />
+      </update>
+      <update dTime="200">
+        <position x="-913" y="0" z="-66" />
+      </update>
+      <update dTime="200">
+        <position x="-745" y="0" z="-46" />
+      </update>
+      <update dTime="200">
+        <position x="-774" y="0" z="-214" />
+      </update>
+      <update dTime="200">
+        <position x="-661" y="0" z="-157" />
+      </update>
+      <update dTime="200">
+        <position x="-752" y="0" z="-319" />
+      </update>
+      <update dTime="200">
+        <position x="-651" y="0" z="-218" />
+      </update>
+      <update dTime="200">
+        <position x="-510" y="0" z="-219" />
+      </update>
+      <update dTime="200">
+        <position x="-711" y="0" z="-246" />
+      </update>
+      <update dTime="200">
+        <position x="-646" y="0" z="-336" />
+      </update>
+      <update dTime="200">
+        <position x="-524" y="0" z="-408" />
+      </update>
+      <update dTime="200">
+        <position x="-375" y="0" z="-455" />
+      </update>
+      <update dTime="200">
+        <position x="-304" y="0" z="-442" />
+      </update>
+      <update dTime="200">
+        <position x="-335" y="0" z="-362" />
+      </update>
+      <update dTime="200">
+        <position x="-359" y="0" z="-390" />
+      </update>
+      <update dTime="200">
+        <position x="-191" y="0" z="-326" />
+      </update>
+      <update dTime="200">
+        <position x="-104" y="0" z="-163" />
+      </update>
+      <update dTime="200">
+        <position x="-113" y="0" z="-136" />
+      </update>
+      <update dTime="200">
+        <position x="-187" y="0" z="-265" />
+      </update>
+      <update dTime="200">
+        <position x="-356" y="0" z="-348" />
+      </update>
+      <update dTime="200">
+        <position x="-280" y="0" z="-291" />
+      </update>
+      <update dTime="200">
+        <position x="-200" y="0" z="-179" />
+      </update>
+      <update dTime="200">
+        <position x="-341" y="0" z="-241" />
+      </update>
+      <update dTime="200">
+        <position x="-276" y="0" z="-147" />
+      </update>
+      <update dTime="200">
+        <position x="-314" y="0" z="-198" />
+      </update>
+      <update dTime="200">
+        <position x="-423" y="0" z="-363" />
+      </update>
+      <update dTime="200">
+        <position x="-373" y="0" z="-500" />
+      </update>
+      <update dTime="200">
+        <position x="-531" y="0" z="-560" />
+      </update>
+      <update dTime="200">
+        <position x="-427" y="0" z="-386" />
+      </update>
+      <update dTime="200">
+        <position x="-253" y="0" z="-348" />
+      </update>
+      <update dTime="200">
+        <position x="-359" y="0" z="-427" />
+      </update>
+      <update dTime="200">
+        <position x="-271" y="0" z="-455" />
+      </update>
+      <update dTime="200">
+        <position x="-237" y="0" z="-644" />
+      </update>
+      <update dTime="200">
+        <position x="-240" y="0" z="-742" />
+      </update>
+      <update dTime="200">
+        <position x="-126" y="0" z="-846" />
+      </update>
+      <update dTime="200">
+        <position x="13" y="0" z="-793" />
+      </update>
+      <update dTime="200">
+        <position x="-68" y="0" z="-656" />
+      </update>
+      <update dTime="200">
+        <position x="-52" y="0" z="-519" />
+      </update>
+      <update dTime="200">
+        <position x="45" y="0" z="-396" />
+      </update>
+      <update dTime="200">
+        <position x="89" y="0" z="-356" />
+      </update>
+      <update dTime="200">
+        <position x="91" y="0" z="-502" />
+      </update>
+      <update dTime="200">
+        <position x="93" y="0" z="-497" />
+      </update>
+      <update dTime="200">
+        <position x="95" y="0" z="-625" />
+      </update>
+      <update dTime="200">
+        <position x="37" y="0" z="-616" />
+      </update>
+      <update dTime="200">
+        <position x="11" y="0" z="-599" />
+      </update>
+      <update dTime="200">
+        <position x="31" y="0" z="-579" />
+      </update>
+      <update dTime="200">
+        <position x="129" y="0" z="-529" />
+      </update>
+      <update dTime="200">
+        <position x="116" y="0" z="-696" />
+      </update>
+      <update dTime="200">
+        <position x="190" y="0" z="-471" />
+      </update>
+    </loop>
+  </script>
+</pattern-3d>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/data/patterns/5random.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Random pattern generated by write_random_pattern.m-->
+<pattern-3d>
+  <initialization doppler="false" reverb="Forest" name="Random">
+    <position x="1318" y="0" z="896" />
+  </initialization>
+  <script>
+    <loop>
+      <update dTime="1000">
+        <position x="1949" y="0" z="-53" />
+      </update>
+      <update dTime="1000">
+        <position x="-923" y="0" z="815" />
+      </update>
+      <update dTime="1000">
+        <position x="-1578" y="0" z="-303" />
+      </update>
+      <update dTime="1000">
+        <position x="-1474" y="0" z="188" />
+      </update>
+      <update dTime="1000">
+        <position x="-980" y="0" z="1617" />
+      </update>
+      <update dTime="1000">
+        <position x="-347" y="0" z="1728" />
+      </update>
+      <update dTime="1000">
+        <position x="-111" y="0" z="1452" />
+      </update>
+      <update dTime="1000">
+        <position x="985" y="0" z="258" />
+      </update>
+      <update dTime="1000">
+        <position x="-1283" y="0" z="-1293" />
+      </update>
+      <update dTime="1000">
+        <position x="-1261" y="0" z="-705" />
+      </update>
+      <update dTime="1000">
+        <position x="-1440" y="0" z="-733" />
+      </update>
+      <update dTime="1000">
+        <position x="823" y="0" z="1592" />
+      </update>
+      <update dTime="1000">
+        <position x="1616" y="0" z="-1040" />
+      </update>
+      <update dTime="1000">
+        <position x="-1364" y="0" z="-1077" />
+      </update>
+      <update dTime="1000">
+        <position x="-94" y="0" z="1173" />
+      </update>
+      <update dTime="1000">
+        <position x="-259" y="0" z="-1382" />
+      </update>
+      <update dTime="1000">
+        <position x="-212" y="0" z="-1924" />
+      </update>
+      <update dTime="1000">
+        <position x="-1601" y="0" z="-1054" />
+      </update>
+      <update dTime="1000">
+        <position x="-753" y="0" z="-1192" />
+      </update>
+      <update dTime="1000">
+        <position x="-1383" y="0" z="1293" />
+      </update>
+      <update dTime="1000">
+        <position x="-43" y="0" z="1057" />
+      </update>
+      <update dTime="1000">
+        <position x="-410" y="0" z="1289" />
+      </update>
+      <update dTime="1000">
+        <position x="1569" y="0" z="-908" />
+      </update>
+      <update dTime="1000">
+        <position x="-765" y="0" z="-659" />
+      </update>
+      <update dTime="1000">
+        <position x="1131" y="0" z="136" />
+      </update>
+      <update dTime="1000">
+        <position x="-889" y="0" z="-811" />
+      </update>
+      <update dTime="1000">
+        <position x="-191" y="0" z="-1183" />
+      </update>
+      <update dTime="1000">
+        <position x="779" y="0" z="1402" />
+      </update>
+      <update dTime="1000">
+        <position x="1267" y="0" z="-119" />
+      </update>
+      <update dTime="1000">
+        <position x="1047" y="0" z="-585" />
+      </update>
+      <update dTime="1000">
+        <position x="-696" y="0" z="739" />
+      </update>
+      <update dTime="1000">
+        <position x="337" y="0" z="1714" />
+      </update>
+      <update dTime="1000">
+        <position x="-332" y="0" z="-1406" />
+      </update>
+      <update dTime="1000">
+        <position x="333" y="0" z="-1903" />
+      </update>
+      <update dTime="1000">
+        <position x="-340" y="0" z="-1426" />
+      </update>
+      <update dTime="1000">
+        <position x="1339" y="0" z="469" />
+      </update>
+      <update dTime="1000">
+        <position x="-1466" y="0" z="-1123" />
+      </update>
+      <update dTime="1000">
+        <position x="1451" y="0" z="469" />
+      </update>
+      <update dTime="1000">
+        <position x="572" y="0" z="1058" />
+      </update>
+      <update dTime="1000">
+        <position x="1370" y="0" z="-958" />
+      </update>
+      <update dTime="1000">
+        <position x="1690" y="0" z="723" />
+      </update>
+      <update dTime="1000">
+        <position x="-512" y="0" z="-882" />
+      </update>
+      <update dTime="1000">
+        <position x="1524" y="0" z="-710" />
+      </update>
+      <update dTime="1000">
+        <position x="546" y="0" z="1267" />
+      </update>
+      <update dTime="1000">
+        <position x="-40" y="0" z="1831" />
+      </update>
+      <update dTime="1000">
+        <position x="433" y="0" z="1439" />
+      </update>
+      <update dTime="1000">
+        <position x="-1118" y="0" z="-1294" />
+      </update>
+      <update dTime="1000">
+        <position x="-780" y="0" z="-1197" />
+      </update>
+      <update dTime="1000">
+        <position x="891" y="0" z="-953" />
+      </update>
+      <update dTime="1000">
+        <position x="1105" y="0" z="-441" />
+      </update>
+      <update dTime="1000">
+        <position x="862" y="0" z="825" />
+      </update>
+      <update dTime="1000">
+        <position x="-1260" y="0" z="-1115" />
+      </update>
+      <update dTime="1000">
+        <position x="1161" y="0" z="592" />
+      </update>
+      <update dTime="1000">
+        <position x="-1424" y="0" z="-591" />
+      </update>
+      <update dTime="1000">
+        <position x="-730" y="0" z="889" />
+      </update>
+      <update dTime="1000">
+        <position x="1636" y="0" z="-455" />
+      </update>
+      <update dTime="1000">
+        <position x="-347" y="0" z="-1334" />
+      </update>
+      <update dTime="1000">
+        <position x="-1530" y="0" z="-1057" />
+      </update>
+      <update dTime="1000">
+        <position x="-1329" y="0" z="1292" />
+      </update>
+      <update dTime="1000">
+        <position x="1318" y="0" z="896" />
+      </update>
+    </loop>
+  </script>
+</pattern-3d>
Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_01.aac has changed
Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_02.aac has changed
Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_03.aac has changed
Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_04.aac has changed
Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_05.aac has changed
Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_motorway.aac has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/group/RingingTone3DPluginExports.inc	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,35 @@
+/*
+* ==============================================================================
+*  Name        : RingingTone3DPluginExports.inc
+*  Part of     : RingingTone3DPlugin
+*  Interface   : ?Interface_category, ?Interface_name
+*  Description : ?Description
+*  Version     : ?Version
+*
+*  Copyright (c) 2007 Nokia Corporation.
+*  This material, including documentation and any related
+*  computer programs, is protected by copyright controlled by
+*  Nokia Corporation. All rights are reserved. Copying,
+*  including reproducing, storing, adapting or translating, any
+*  or all of this material requires the prior written consent of
+*  Nokia Corporation. This material also contains confidential
+*  information which may not be disclosed to others without the
+*  prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+#ifndef RINGINGTONE3DPLUGINEXPORTS_INC
+#define RINGINGTONE3DPLUGINEXPORTS_INC
+
+// 3D patterns for target device
+../data/patterns/1circular.xml	        Z:/resource/3DTones/1circular.xml
+../data/patterns/2flyby.xml		Z:/resource/3DTones/2flyby.xml
+../data/patterns/3zigzag.xml		Z:/resource/3DTones/3zigzag.xml
+../data/patterns/4meander.xml		Z:/resource/3DTones/4meander.xml
+../data/patterns/5random.xml		Z:/resource/3DTones/5random.xml
+
+#endif      // RINGINGTONE3DPLUGINEXPORTS_INC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build info file for Ringing Tone plugin for 3D Audio application.
+*
+*/
+
+
+PRJ_PLATFORMS
+// Defaults
+
+PRJ_EXPORTS
+#include "RingingTone3DPluginExports.inc"
+
+PRJ_MMPFILES
+../group/ringingtone3dplugin.mmp
+
+PRJ_TESTMMPFILES
+// No test programs.
+
+PRJ_TESTEXPORTS
+// No test programs.
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/group/ringingtone3dplugin.mmp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Ringing Tone plug-in for playing 3D ringing tones.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+//OPTION 	ARMCC --interleave
+
+
+TARGET 			RingingTone3DPlugin.dll
+TARGETTYPE 		PLUGIN
+UID 			0x10009D8D 0x10208ADF  // last uid is dll uid
+
+CAPABILITY 		CAP_ECOM_PLUGIN
+VENDORID 		VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE 			C3DAudioPattern.cpp
+SOURCE 			C3DAudioTimeOutTimer.cpp
+SOURCE 			CRingingTone3DPlugin.cpp
+SOURCE 			CRingingTone3DPluginImplementationTable.cpp
+SOURCE 			C3DAudioXMLParser.cpp
+
+
+//ECOM resource definition
+START RESOURCE      10208adf.rss
+TARGET              RingingTone3DPlugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END                 //  ECOM resource definition
+
+//START RESOURCE      RingingTone3DPlugin.rss
+//HEADER
+//TARGETPATH          RESOURCE_FILES_DIR
+//LANG SC
+//END
+
+USERINCLUDE         ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE	/epoc32/include/ecom
+
+
+LIBRARY 		euser.lib
+LIBRARY 		ecom.lib
+LIBRARY 		DopplerBase.lib
+LIBRARY 		SourceDopplerEffect.lib
+LIBRARY 		EnvironmentalReverbUtility.lib
+LIBRARY 		LocationBase.lib
+LIBRARY 		SourceLocationEffect.lib
+LIBRARY 		ListenerLocationEffect.lib
+LIBRARY 		StereoWideningEffect.lib
+LIBRARY 		centralrepository.lib
+LIBRARY 		estor.lib
+LIBRARY 		efsrv.lib
+LIBRARY                 xmlframework.lib        // Xml::CParser
+LIBRARY                 bafl.lib                // RString
+LIBRARY                 profileeng.lib // Profile Engine
+LIBRARY                 ProfileEngine.lib // Profile engine wrapper api
+
+LIBRARY		        DrmAudioPlayUtility.lib
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+LIBRARY		        mediaclientvideo.lib
+#endif
+
+LIBRARY                 PlatformEnv.lib  // DriveInfo
+
+DEBUGLIBRARY            flogger.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/inc/C3DAudioPattern.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Handles accessing 3D motion pattern data.
+*
+*/
+
+
+#ifndef C3DAUDIOPATTERN_H
+#define C3DAUDIOPATTERN_H
+
+//  INCLUDES
+#include <e32base.h>	// CBase
+
+// FORWARD DECLARATIONS
+class RReadStream;
+class RWriteStream;
+
+// DATA TYPES
+
+// Struct representing position in three dimensional space.
+struct T3DPosition 
+    {
+    // X-coordinate
+    TInt iX;
+    // Y-coordinate
+    TInt iY;
+    // Z-coordinate
+    TInt iZ;
+    };
+
+// Struct representing velocity.
+struct T3DVelocity
+	{
+	// Boolean indicating is scalar velocity in use
+	TBool iScalar;
+	// Scalar velocity
+	TInt iScalarVelocity;
+	// Velocity along x-axis.
+	TInt iXVector;
+	// Velocity along y-axis.
+	TInt iYVector;
+	// Velocity along z-axis.
+	TInt iZVector;
+	};
+
+// Struct representing update in motion pattern.
+struct T3DScriptUpdate
+	{
+	// Position of the trajectory.
+	T3DPosition iPosition;
+	// Velocity 
+	T3DVelocity iVelocity;
+	// Time the pattern stays in this position.
+	TInt iDTime;
+	};
+
+// Struct representing loop in pattern.
+struct T3DLoop
+	{
+	// Position where to start the loop.
+	TInt iLoopStart;
+	// Position where to end the loop.
+	TInt iLoopEnd;
+	// How many times the loop is to be gone through.
+	TInt iCount;
+	};
+
+
+// CLASS DECLARATION
+
+/**
+* Handles accessing 3D motion pattern data.
+*
+* @lib RingingTone3DPlugin.dll 
+* @since 5.0
+*/
+NONSHARABLE_CLASS (C3DAudioPattern): public CBase
+    {
+    
+    public:  // Constructors and destructor
+    
+       /**
+        * Two-phased constructor. 
+        */
+        static C3DAudioPattern* NewL();
+        
+       /**
+        * Two-phased constructor.
+        */
+        static C3DAudioPattern* NewLC();
+        
+       /**
+        * Two-phased constructor.
+        * @param aStream Stream used to internalise the pattern.
+        */
+        static C3DAudioPattern* NewL( RReadStream& aStream );
+        
+       /**
+        * Two-phased constructor.
+        * @param aStream Stream used to internalise the pattern.
+        */
+        static C3DAudioPattern* NewLC( RReadStream& aStream );
+        
+       /**
+		* Destructor
+		*/
+        virtual ~C3DAudioPattern();
+        
+    private:
+    	
+    	/**
+        * C++ default constructor.
+        */
+        C3DAudioPattern();
+
+    private:
+    
+	   /**
+        * Internalizes the pattern from readstream.
+        * @param aStream Readstream from which to internalize the pattern.
+        */
+        void InternalizeL( RReadStream& aStream );
+        
+    public:
+
+       /**
+        * Externalizes the pattern.
+        * @param aStream Writestream to externalize the pattern to.
+        */
+	   	void ExternalizeL( RWriteStream& aStream ) const;
+	   	
+	   /**
+        * Sets the name of the pattern.
+        * @param aName Descriptor containing the name of the pattern.
+        */	   	    
+	   	void SetNameL( const TDesC8& aName );
+
+	   /**
+        * Getter for name of the pattern.
+        * @return Descriptor containing name of the pattern.
+        */			
+	    const TDesC8& Name();
+	   	
+	   /**
+        * Sets the doppler of the pattern.
+        * @param aDoppler Boolean whether doppler is available or not.
+        */	   	    
+	   	void SetDoppler( const TBool aDoppler );
+
+	   /**
+        * Queries if doppler-effect is available in the pattern.
+        * @return Boolean indicating whether doppler is available.
+        */
+	   	TBool DopplerAvailable() const;
+
+	   /**
+        * Sets the reververation of pattern.
+        * @param aReverb Index of reverberation used with CEnvironmentalReverbUtility.
+        */	   	    
+	   	void SetReverb( const TUint aReverb );
+
+	   /**
+        * Queries reverberation preset of the pattern.
+        * @return Reverberation preset used in pattern.
+        */
+	   	TInt Reverb() const;
+	   	
+	   /**
+        * Adds a new update to script.
+        * @param aUpdate Update to add to the script.
+        */
+		void AddUpdateL( T3DScriptUpdate& aUpdate );
+		
+	   /**
+        * Used to indicate a start of a loop in pattern.
+        * @param aCount Amount of times the loop takes place.
+        */
+		void StartLoopL( TUint& aCount );
+		
+	   /**
+        * Used to indicate end of a loop in pattern.
+        */
+		void EndLoop();
+		
+	   /**
+        * Getter for script containg motion pattern.
+        * @return Array containing timeframes of pattern.
+        */
+		RArray< T3DScriptUpdate > Script();
+	   
+
+    private:	// Data
+    
+    	// Name of the pattern.
+        HBufC8* iName;
+        // Initial status of doppler-effect.
+        TBool iInitialDoppler;
+        // Initial reverb preset.
+        TUint iInitialReverb;
+        // Array containing indexes of open loops.
+        RArray< TInt > iOpenLoops;
+        // Array containing loops in the pattern.
+        RArray< T3DLoop > iLoops;
+        // Array containing the whole pattern as timeframes.
+        RArray< T3DScriptUpdate > iScript;
+
+    };
+
+#endif // C3DAUDIOPATTERN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/inc/C3DAudioTimeOutTimer.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Timer for reading 3D pattern data.
+*
+*/
+
+
+#ifndef C3DAUDIOTIMEOUTTIMER_H
+#define C3DAUDIOTIMEOUTTIMER_H
+
+// INCLUDES
+#include <e32base.h>	// CTimer
+
+
+// CLASS DECLARATIONS
+
+
+/**
+* This class specifies the function to be called when a timeout occurs.
+* Used in conjunction with C3DAudioTimeOutTimer class.
+*
+* @lib RingingTone3DPlugin.dll
+* @since 5.0
+*/
+NONSHARABLE_CLASS (M3DAudioTimeOutNotifier)
+    {
+    public:
+
+       /**
+        * The function to be called when a timeout occurs.
+        */
+        virtual void TimerExpiredL() = 0;
+    };
+
+
+
+
+/**
+* This class will notify an object after a specified timeout.
+*
+* @lib RingingTone3DPlugin.dll
+* @since 5.0
+*/
+NONSHARABLE_CLASS (C3DAudioTimeOutTimer) : public CTimer
+    {
+    public:
+
+       /**
+        * Two-phased constructor. 
+        * @param aPriority Priority to use for this timer.
+        * @param aTimeOutNotify Object to notify of timeout event.
+        * @return A pointer to the created instance of C3DAudioTimeOutTimer.
+        */
+        static C3DAudioTimeOutTimer* NewL( const TInt aPriority,
+                                    	   M3DAudioTimeOutNotifier* aTimeOutNotify );
+
+       /**
+        * Two-phased constructor. Leaves pointer to object to cleanup stack.
+        * @param aPriority Priority to use for this timer.
+        * @param aTimeOutNotify Object to notify of timeout event.
+        * @return A pointer to the created instance of C3DAudioTimeOutTimer.
+        */
+        static C3DAudioTimeOutTimer* NewLC( const TInt aPriority,
+                                     	   M3DAudioTimeOutNotifier* aTimeOutNotify );
+
+       /**
+        * Destructor.
+        */
+        virtual ~C3DAudioTimeOutTimer();
+
+    private: 
+
+       /**
+        * C++ default constructor.
+        */
+        C3DAudioTimeOutTimer( const TInt aPriority,
+                       		  M3DAudioTimeOutNotifier* aTimeOutNotify );
+
+       /**
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+
+    protected: // from CActive
+
+       /**
+        * From CActive Called when RunL() leaves.
+        */
+        TInt RunError( TInt aError );
+        
+       /**
+        * From CActive Called when operation completes.
+        */
+        void RunL();
+
+
+    private: // Data
+
+        // The observer for this objects events.
+        M3DAudioTimeOutNotifier* iNotify;
+    };
+
+#endif // C3DAUDIOTIMEOUTTIMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/inc/C3DAudioXMLParser.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,512 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  XML-Parser used to parse motion patterns.
+*
+*/
+
+
+#ifndef C3DAUDIOXMLPARSER_H
+#define C3DAUDIOXMLPARSER_H
+
+// INCLUDES
+#include <eikenv.h>
+#include "C3DAudioPattern.h"	// C3DAudioPatter, T3DScriptPosition
+#include <xml/contenthandler.h>	// Xml::MContentHandler
+#include <xml/parser.h>			// Xml::CParser
+
+#include <e32property.h>	    // RProperty
+
+
+//CONSTANTS
+
+// Maximum length for names of element and attribute and for value of attribute.
+const TUint KMaxDataLength = 20;
+const TUint KBufSize32 = 32;
+
+
+// DATA TYPES
+
+// Enumeration to use in determining the last tag.
+enum TLastTag 
+	{
+	EInitialization = 0,
+	EUpdate
+	};
+	
+	
+// Identifiers for reverberation presets. Used in mapping.
+enum TReverbPresets
+	{
+	EReverbNotEnabled = 0,
+	EReverbPresetOne = 14,		// Livingroom
+	EReverbPresetTwo = 5,		// Cave
+    EReverbPresetThree = 26,	// Stone Corridor
+    EReverbPresetFour = 8,		// Forest
+    EReverbPresetFive = 24,		// Sewerpipe
+    EReverbPresetSix = 28		// Underwater
+	};
+	
+
+// FORWARD DECLARATIONS
+
+class C3DPatternPS;
+	
+
+// CLASS DECLARATION
+
+/**
+* XML-parser used to parse motion patterns.
+*
+* @lib RingingTone3DPlugin.dll
+* @since 5.0
+*/ 	
+NONSHARABLE_CLASS (C3DAudioXMLParser) : public CBase, public Xml::MContentHandler
+	{
+    public:
+    
+    enum TPatternAttributeKeys
+        {
+        EKeyPatternId = 1,
+        EKeyDopplerUsed = 2,
+        EKeyVelocity = 3
+        };
+	
+	public:
+		
+	   /**
+        * Two-phased constructor.
+        */
+		static C3DAudioXMLParser* NewL();
+		
+	   /**
+        * Two-phased constructor.
+        */
+		static C3DAudioXMLParser* NewLC();
+		
+	   /**
+        * Destructor.
+        */
+		virtual ~C3DAudioXMLParser();
+		
+	private:
+
+       /**
+        * C++ default constructor.
+        */
+        C3DAudioXMLParser();
+        
+       /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+		
+		
+	public:
+		
+       /**
+        * Parses the motion pattern from XML-file.
+        * @param aPatternNum Motion pattern to be parsed.
+        */
+		void ParseL( TInt aPatternId );
+
+       /**
+        * Parses the motion pattern from XML-file.
+        * @param aPatternNum Motion pattern to be parsed.
+        */
+		void ParseL( const TDesC& aFileName );
+		
+	   /**
+        * Returns single pattern attribute.
+        * @param Pattern attribute key.
+        * @return Pattern attribute value.
+        */
+		TInt Attribute( TInt aKey );
+		
+		const T3DPosition& PositionL( TInt aIndex );
+		const T3DVelocity& VelocityL( TInt aIndex );
+		const TInt& TimeL( TInt aIndex );
+		TInt CountL();
+		
+    private:
+	   /**
+        * Reads 3D ringing tone pattern data from cache (PubSub)
+        * @param aPatternId Pattern id.
+        */
+        TBool ReadFromPatternCacheL( TInt aPatternId );
+
+	   /**
+        * Writes 3D ringing tone pattern data into cache (PubSub)
+        * @param aPatternId Pattern id.
+        */
+        void WriteToPatternCacheL( TInt aPatternId );
+        
+#ifdef _DEBUG
+    public:        
+        void AssertParseDataL( TInt aPatternId );
+        static void GetPatternString(TDes& aText, TInt aPattern);
+        static void FlogPatternsL(TInt aOldPattern, TInt aNewPattern);
+        static void FlogPatternL(TInt aPattern);
+        static void FlogPubSubL(TInt aEcho);
+        static void GetEchoString(TDes& aText, TInt aEcho);
+#endif        
+
+
+	public: // from MContentHandler
+	
+	   /**
+        * From MContentHandler This method is a callback to indicate the start of the document. 
+        * @param aDocParam Specifies the various parameters of the document.
+        * @param aErrorCode The error code.
+        */
+		void OnStartDocumentL( const Xml::RDocumentParameters& aDocParam, TInt aErrorCode );
+		
+       /**
+        * This method is a callback to indicate the end of the document. 
+        * @param aErrorCode The error code.
+        */
+		void OnEndDocumentL( TInt aErrorCode );
+		
+	   /**
+        * This method is a callback to indicate an element has been parsed. 
+        * @param aElement Handle to the element's details.
+        * @param aAttributes Attributes for the element. 
+        * @param aErrorCode The error code.
+        */
+		void OnStartElementL( const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, TInt aErrorCode );
+		
+	   /**
+        * This method is a callback to indicate the end of the element has been reached. 
+        * @param aElement Handle to the element's details.
+        * @param aErrorCode The error code.
+        */
+		void OnEndElementL( const Xml::RTagInfo& aElement, TInt aErrorCode );
+		
+       /**
+        * This method is a callback that sends the content of the element.
+        * @param aBytes Raw content data for the element
+        * @param aErrorCode The error code.
+        */
+		void OnContentL( const TDesC8& aBytes, TInt aErrorCode );
+	
+	   /**
+        * This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping.
+        * @param aPrefix Namespace prefix being declared. 
+        * @param aUri Namespace URI the prefix is mapped to. 
+        * @param aErrorCode The error code.
+        */
+		void OnStartPrefixMappingL( const RString& aPrefix, const RString& aUri, TInt aErrorCode );
+		
+	   /**
+        * This method is a notification of the end of the scope of a prefix-URI mapping.
+        * @param aPrefix Namespace prefix that was mapped. 
+        * @param aErrorCode The error code.
+        */
+		void OnEndPrefixMappingL( const RString& aPrefix, TInt aErrorCode );
+		
+	   /**
+        * This method is a notification of ignorable whitespace in element content. 
+        * @since Series ?XX ?SeriesXX_version
+        * @param aBytes Ignored bytes from the document being parsed. 
+        * @param aErrorCode The error code.
+        */
+		void OnIgnorableWhiteSpaceL( const TDesC8& aBytes, TInt aErrorCode );
+		
+	   /**
+        * This method is a notification of a skipped entity.
+        * @param aName Name of the skipped entity.
+        * @param aErrorCode The error code.
+        */
+		void OnSkippedEntityL( const RString& aName, TInt aErrorCode );
+		
+       /**
+        * This method is a receive notification of a processing instruction. 
+        * @param aTarget Processing instruction target. 
+        * @param aData Processing instruction data. If empty none was supplied.
+        * @param aErrorCode The error code.
+        */
+		void OnProcessingInstructionL( const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode );
+		
+       /**
+        * This method indicates an error has occurred.
+        * @param aErrorCode The error code.
+        */
+		void OnError( TInt aErrorCode );
+	
+	   /**
+        * This method obtains the interface matching the specified uid. 
+        * @param aUid UID identifying the required interface. 
+        */
+		TAny* GetExtendedInterface( const TInt32 aUid );
+		
+		
+	private:
+		
+	   /**
+        * Processes the attributes of initialization-element.
+        * @param aAttributes Array of attributes.
+        */	
+		void ProcessInitAttributesL( const Xml::RAttributeArray& aAttributes );
+		
+	   /**
+		* Processes the attributes of loop-element.
+        * @param aAttributes Array of attributes.
+        */	
+		void ProcessLoopAttributesL( const Xml::RAttributeArray& aAttributes );
+		
+	   /**
+		* Processes the attributes of position-element.
+        * @param aAttributes Array of attributes.
+        */
+		void ProcessPositionAttributesL( const Xml::RAttributeArray& aAttributes );
+		
+	   /**
+		* Processes the attributes of update-element.
+        * @param aAttributes Array of attributes.
+        */
+		void ProcessUpdateAttributesL( const Xml::RAttributeArray& aAttributes );
+		
+	   /**
+		* Processes the attributes of velocity-element.
+        * @param aAttributes Array of attributes.
+        */
+		void ProcessVelocityAttributesL( const Xml::RAttributeArray& aAttributes );
+        
+    private:
+
+	   /**
+		* String copy with length check.
+        * @param aTarget.
+        * @param aSource.
+        */
+        void CopyL( TDes8& aTarget, const TDesC8& aSource );
+        
+	   /**
+        * Panics plugin dll.
+        * @param aReason Panic code.
+        */		        
+        void Panic(TInt aReason);
+        
+        void GetPatternFullPathL(TDes& aText, TInt aPatternId);
+        CBufFlat* ReadPatternFileL( const TDesC& aFullName );
+        CBufFlat* ReadPatternFileL( TInt aPatternId );
+        
+        
+	private:	// Data
+	
+		// Xml::CParser
+		Xml::CParser* iParser;
+		
+		// file server session
+		RFs iFsSession;
+		
+		// Parsed pattern
+		C3DAudioPattern* iParsedPattern;  
+		
+		// element name
+		TBuf8<KMaxDataLength> iElementName;
+		
+		// attribute name
+		TBuf8<KMaxDataLength> iAttributeName;
+		
+		// attribute value
+		TBuf8<KMaxDataLength> iAttributeValue;
+			
+		// Currently parsed pattern update.
+		T3DScriptUpdate iCurrentUpdate;
+		
+		// Last tag occurred.
+		TLastTag iLastTag;
+		
+		// 3DTone file name and path
+		TFileName iFullPath;
+		
+		// Pattern id
+		TInt iPatternId;
+	};
+
+
+
+/**
+* C3DPatternPS is used for storing 3D pattern data in
+* Public and Subcribe. Max pattern size is 65536 bytes.
+*
+* @lib RingingTone3DPlugin.dll
+* @since 5.0
+*/ 	
+NONSHARABLE_CLASS (C3DPatternPS) : public CBase
+	{
+    public:
+    
+    enum TPatternStoreKeys
+        {
+        EKeyPatternId = 1,
+        EKeyDopplerUsed = 2,
+        EKeyVelocity = 3,
+        EKeyDataSize = 4,
+        EKeyPatternData = 5
+        };
+	
+	public:
+		static C3DPatternPS* NewLC( TInt aStoreId );
+		virtual ~C3DPatternPS();
+		
+	private:
+        C3DPatternPS( TInt aStoreId );
+        void ConstructL();
+		
+	public:
+	    void SetIntL( TInt aKey, TInt aValue );
+	    TInt IntL( TInt aKey );
+	    
+	    CBufFlat* DataLC();
+		void GetDataL( TDes8& aData );
+		void SetDataL( const TDesC8& aData );
+		
+		void TestL();
+
+	private:
+	    TBool DefineKeyL( TInt aKeyId, TInt aKeyType );
+        
+	private:
+	    RProperty iProperty;
+	    TUid iStoreUid;
+	};
+
+
+
+////////////////////////////////////// START TEST CODE //////////////////////////
+
+#include <eikenv.h>
+
+const TInt KBufSize128 = 128;
+const TInt KBufSize64 = 64;
+
+
+class T3DPatternData
+    {
+    public:
+        TInt iTime;
+        TInt iX;
+        TInt iY;
+        TInt iZ;
+    };
+
+
+/**
+* C3DPatternParser
+*
+* Used to parse xml files.
+*/
+NONSHARABLE_CLASS (C3DPatternParser) : public CBase, public Xml::MContentHandler 
+    {
+    public:
+        static C3DPatternParser* NewL();
+        virtual ~C3DPatternParser();
+
+    private:
+	    C3DPatternParser();
+        void ConstructL();
+        
+    public:
+        void ParseDocumentL(const TDesC& aFullName);
+        void ParseDocumentL(TInt aPatternId);
+        TInt PositionCount();
+       	T3DPatternData& Position(TInt aIndex);
+       	T3DPatternData& Velocity(TInt aIndex);
+        void GetPatternName(TDes& aText);
+        void GetEchoName(TDes& aText);
+        TBool DopplerEnabled();
+        
+        void AssertPosition(TInt aIndex, TInt aX, TInt aY, TInt aZ);
+        void AssertVelocity(TInt aIndex, TInt aX, TInt aY, TInt aZ);
+        void AssertTime(TInt aIndex, TInt aTime);
+
+        
+        
+    private:
+        void Print();
+        void PrintCoordinates(T3DPatternData& aData, TBool aVelocity);
+        
+    
+    private: // from MContentHandler
+    
+        void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode);
+        void OnEndDocumentL(TInt aErrorCode);
+        void OnStartElementL(const Xml::RTagInfo& aElement, 
+                             const Xml::RAttributeArray& aAttributes, 
+							 TInt aErrorCode);
+		void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode);
+		void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+		void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, 
+								   TInt aErrorCode);
+		void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+		void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+		void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+		void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, 
+		    						  TInt aErrorCode);
+        void OnError(TInt aErrorCode);
+        TAny* GetExtendedInterface(const TInt32 aUid);
+        
+    private:
+        CBufFlat* ReadDocumentL(const TDesC& aFullName);
+        void ReadPositionAttributesL(const Xml::RAttributeArray& aAttributes);
+        void ReadVelocityAttributesL(const Xml::RAttributeArray& aAttributes);
+        void ReadInitAttributesL(const Xml::RAttributeArray& aAttributes);
+        void ReadUpdateAttributesL(const Xml::RAttributeArray& aAttributes);
+        
+    private:
+        void StrCopy(TDes& aTarget, const TDesC8& aSource);
+        void StrCopy(TDes& aTarget, const TDesC& aSource);
+        TInt StrToIntL(const TDesC& aText);
+        void Panic(TInt aReason);
+        void GetPatternFileNameL(TDes& aText, TInt aPatternId);
+        
+    private:
+        
+		// Xml parser
+		Xml::CParser* iParser;
+		
+		// file server session
+		RFs iFsSession;
+		
+		TBuf<KBufSize64> iElementName;
+		TBuf<KBufSize64> iAttributeName;
+		TBuf<KBufSize64> iAttributeValue;
+		TBuf<KBufSize64> iEchoName;
+		TBuf<KBufSize64> iPatternName;
+		
+		TBool iDopplerUsed;
+		TBool iVelocityUsed;
+		
+		T3DPatternData iCurrentPosition;
+		T3DPatternData iCurrentVelocity;
+		
+		T3DPatternData iInitPosition;
+		T3DPatternData iInitVelocity;
+
+		
+		
+		// list for parsed 3d pattern position coordinates
+		RArray<T3DPatternData> iPositionList;
+		
+		// list for parsed 3d pattern velocity coordinates
+		RArray<T3DPatternData> iVelocityList;
+    };
+
+////////////////////////////////////// END TEST CODE ////////////////////////////
+
+
+#endif	// C3DAUDIOXMLPARSER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/inc/CRingingTone3DPlugin.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,356 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Plug-In that implements C3DRingingToneInterface.
+*
+*/
+
+
+#ifndef CRINGINGTONE3DPLUGIN_H
+#define CRINGINGTONE3DPLUGIN_H
+
+//  INCLUDES
+#include    <DrmAudioSamplePlayer.h>
+#include    <mdaaudiotoneplayer.h>
+#include    <videoplayer.h>
+
+#include <c3dringingtoneinterface.h>
+#include "C3DAudioTimeOutTimer.h"
+#include "C3DAudioPattern.h"
+#include "C3DAudioXMLParser.h"
+
+#include <centralrepository.h>
+#include <MProfile.h>
+
+
+// FORWARD DECLARATIONS
+class C3DAudioTimeOutTimer;
+class CEnvironmentalReverbUtility;
+class CSourceDoppler;
+class CSourceLocation;
+class CListenerLocation;
+
+class C3DPatternParser;
+
+#ifdef __STEREO_WIDENING_EFFECT_UI 
+class CStereoWidening;
+#endif
+
+
+// CONSTANTS
+const TInt32 KRingingTone3DAudioEComPluginUID = 0x10208ADF;
+const TInt KBufSize256 = 256;
+
+
+
+// CLASS DECLARATION
+
+
+/**
+* Plug-In implementing C3DRingingToneInterface.
+*
+* Used for playing 3D ringing tones. For playing, plugin uses player utility
+* (eg CDrmPlayerUtility) from calling application. 3D effect is achieved by
+* adding 3D data into normal ringing tone. C3DAudioXMLParser reads this
+* data from .xml files (one file per 3D effect).
+*  
+* @lib RingingTone3DPlugin.dll
+* @since 5.0
+*/
+NONSHARABLE_CLASS (CRingingTone3DPlugin): public C3DRingingToneInterface,
+							              public M3DAudioTimeOutNotifier
+    {
+    private:
+    
+    enum TRingingTonePlayerType
+        {
+        EMdaAudioPlayerUtility,
+        EMdaAudioToneUtility,
+        EDrmPlayerUtility,
+        EVideoPlayerUtility
+        };
+        
+
+    public:
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CRingingTone3DPlugin* NewL( TAny* aParameter );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CRingingTone3DPlugin();
+        
+    private:
+
+       /**
+        * C++ default constructor.
+        */
+        CRingingTone3DPlugin();
+
+       /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( TAny* aParameter );
+        
+
+    public: // Functions from C3DRingingToneInterface
+
+       /**
+        * Set 3D plugin attribute.
+        * @param aAttributeKey
+        * @param aValue
+        * @return System-wide error code.
+        */
+        TInt SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, TInt aValue );
+
+       /**
+        * Set 3D plugin attribute.
+        * @param aAttributeKey
+        * @param aValue
+        * @return System-wide error code.
+        */
+        TInt SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, const TDesC& aValue );
+
+       /**
+        * Set 3D plugin attribute.
+        * @param aAttributeKey
+        * @param aValue
+        * @return System-wide error code.
+        */
+        TInt SetAttr( TInt aAttributeKey, TAny* aValue );
+
+       /**
+        * Plays 3D ringing tone.
+        */
+    	void PlayL();
+
+       /**
+        * Stops playing 3D ringing tone.
+        */
+    	void Stop();
+
+    
+    private:  // from M3DAudioTimeOutNotifier
+
+       /**
+        * Callback initiated from C3DAudioTimeOutTimer.
+        */
+		void TimerExpiredL();
+
+	private:
+		
+       /**
+        * Initializes player utility.
+        * @param aSamplePlayer Player utility.
+        */
+        void Init( CMdaAudioPlayerUtility* aSamplePlayer );
+
+       /**
+        * Initializes player utility.
+        * @param aSamplePlayer Player utility.
+        */
+        void Init( CMdaAudioToneUtility* aSamplePlayer );
+
+       /**
+        * Initializes player utility.
+        * @param aSamplePlayer Player utility.
+        */
+        void Init( CDrmPlayerUtility* aSamplePlayer );
+
+       /**
+        * Initializes player utility.
+        * @param aSamplePlayer Player utility.
+        */
+        void Init( CVideoPlayerUtility* aSamplePlayer  );
+        
+       /**
+        * Plays 3D ringing tone.
+        */        
+        void DoPlayL();
+        
+       /**
+        * Add 3D pattern (effect) data into normal ringing tone.
+        */
+        void SetNext3DPatternPositionL();
+
+	   /**
+        * Plays 3D ringing tone.
+        */		        
+        void PlayRingingTone();
+
+	   /**
+        * Stops playing 3D ringing tone.
+        */		        
+        void StopRingingTone();
+  
+    private:
+    
+	   /**
+        * Calculates the correct dTime according to velocity-value in cenrep.
+        * @param aTime Time from the script to be calculated.
+        */		        
+        void CalculateDTime( TInt& aTime );
+        
+       /**
+        * Plugin initialization.
+        */		        
+        void InitializeL();
+        
+       /**
+        * Plugin uninitialization. Needed in error case when normal ringing 
+        * tone is played.
+        */		        
+        void UnInitialize();
+        
+
+    private:
+    
+	   /**
+        * Gets CEnvironmentalReverbUtility object.
+        * @return CEnvironmentalReverbUtility.
+        */		        
+        CEnvironmentalReverbUtility* EnvironmentalReverbUtilityL();
+
+	   /**
+        * Gets CSourceLocation object.
+        * @return CSourceLocation.
+        */		        
+        CSourceLocation* SourceLocationL();
+        
+	   /**
+        * Gets CListenerLocation object.
+        * @return CListenerLocation.
+        */		        
+        CListenerLocation* ListenerLocationL();
+        
+	   /**
+        * Gets CSourceDoppler object.
+        * @return CSourceDoppler.
+        */		        
+        CSourceDoppler* SourceDopplerL();
+      
+#ifdef __STEREO_WIDENING_EFFECT_UI
+        CStereoWidening* StereoWideningL();
+#endif        
+
+
+    private:
+
+       /**
+        * Read active profile setting from profile engine. Needed in case calling
+        * app does not set 3D effect and echo attributes.
+        */
+        void ReadActiveProfileL();
+        
+       /**
+        * Checks that tone can be used as 3D ringing tone. This check is only
+        * done if calling app explicitly sets ringing tone attribute.
+        */
+        TBool CheckRingingTone();
+
+	   /**
+        * Panics plugin dll.
+        * @param aReason Panic code.
+        */		        
+        void Panic(TInt aReason);
+        
+        
+#ifdef _DEBUG
+    public:
+        void FlogRepositoryL(CRepository* aRepository, TInt aEcho);
+        //void FlogPatternsL(TInt aOldPattern, TInt aNewPattern);
+        void FlogProfileL(MProfile* aProfile);
+        void FlogPlayer(TInt aPlayer);
+        void Check3DEchoL(TInt aEcho);
+        void Check3DPatternL(TInt aPattern);
+        void FlogPositionL(T3DPosition& aPosition, TInt aIndex);
+        void FlogVelocityL(T3DVelocity& aVelocity, TInt aIndex);
+        void FlogTimeL(TInt aTime, TInt aIndex);
+        void FlogPubSubL(TInt aEcho);
+#endif        
+
+
+    private:    // Data
+   	
+    	// 3D Ringing tone velocity
+    	TInt iVelocity;		
+    	
+    	// Doppler status
+    	TBool iDoppler;		
+    	
+    	// 3D effect (pattern)
+    	TInt iProfile3DToneEffect;
+    	
+    	// 3D echo
+    	TInt iProfile3DToneEcho;
+    	
+    	// ringing tone, used only for validity check
+    	TFileName iRingingTone;
+    	
+    	// profile id, currently not used
+    	TInt iProfileId;
+    	
+    	// ringing tone player type
+    	TInt iPlayerType;
+    	
+    	// is ringing tone playing
+    	TInt iPlaying;
+		
+		// 3D pattern parser
+		C3DAudioXMLParser* iParser;
+                
+    	// current position in pattern script
+    	TInt iCurrentUpdate;
+    	
+    	// player utility used for playback
+    	CMdaAudioPlayerUtility* iAudioPlayerUtility;
+
+    	// player utility
+    	CMdaAudioToneUtility* iAudioToneUtility;
+    	
+    	// player utility
+    	CDrmPlayerUtility* iDrmPlayerUtility;
+    	
+    	// player utility
+    	CVideoPlayerUtility* iVideoPlayerUtility; 
+  
+    	// timer for updating 3D pattern position
+    	C3DAudioTimeOutTimer* iTimer;
+    
+    	// reverberation utility used to set reverb presets
+    	CEnvironmentalReverbUtility* iReverbEffect;
+       	
+       	// doppler-effect
+       	CSourceDoppler* iDopplerEffect;
+    	
+    	// source location-effect
+    	CSourceLocation* iSource;
+    	
+    	// listener location-effect
+    	CListenerLocation* iListener;
+     	
+#ifdef __STEREO_WIDENING_EFFECT_UI    	
+    	// stereo widening-effect
+    	CStereoWidening* iStereoWidening;
+#endif
+    };
+
+
+
+
+#endif      // CRINGINGTONE3DPLUGIN_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/inc/RingingTone3DPluginDebug.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Plug-In that implements C3DRingingToneInterface.
+*
+*/
+
+
+
+#ifndef RINGINGTONE_3D_PLUGIN_DEBUG_H
+#define RINGINGTONE_3D_PLUGIN_DEBUG_H
+
+
+#ifdef _DEBUG
+
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFilename,"3d.txt");
+_LIT(KLogDir,"3d");
+
+// Declare the FPrint function
+inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFilename, EFileLoggingModeAppend, aFmt, list);
+    }
+
+
+#ifdef __WINS__
+#define FLOG(arg...)   { FPrint(arg); }
+//#define FLOG(a) { RDebug::Print(a);  }
+#else
+//#define FLOG(arg...) { RDebug::Print(arg);  }
+#define FLOG(arg...)   { FPrint(arg); }
+#endif
+
+#else // _DEBUG
+
+#define FLOG(arg...)  //  No loggings
+
+#endif // _DEBUG
+
+
+
+
+#endif  // RINGINGTONE_3D_PLUGIN_DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/inc/tdaudioconstants.h	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Common constants and enums used in all three implementations.
+*
+*/
+
+
+#ifndef TDAUDIOCONSTANTS_H
+#define TDAUDIOCONSTANTS_H
+
+// CONSTANTS
+// Application UID, same UID is used for Central Repository.
+//const TUid KUid3DAudioRingingTone = { 0x10201AFD };
+//const TUid K3DAudioRepositoryUid = { 0x10201AFD };
+
+const TUid KUid3DAudioRingingTone = { 0x10208ADF };
+const TUid K3DAudioRepositoryUid = { 0x10208ADF };
+
+#ifdef __SERIES60_30__
+// Key to ringing tone in first profile (number 0)
+const TInt KProEngRingingTone = 0x00000004;
+
+// Multiplier for each profile.
+const TInt KProfileMultiplier = 0x01000000;
+
+#endif
+
+// Extension for not supported ringing tones.
+_LIT( KRngType, ".rng" );
+
+// Filename of "No-Sound" ringing tone.
+_LIT( KNoToneFileName, "Z:\\resource\\No_Sound.wav" );
+
+// Default velocity for all motion patterns.
+const TInt KMotionPatternDefaultVelocity = 5;
+
+// DATA TYPES
+// Keys to Central Repository.
+enum T3DAudioRepositoryKeys
+	{
+	E3DAudioRepositoryStatus = 0x1,
+	E3DAudioRepositoryPattern,
+	E3DAudioRepositoryVelocity,
+	E3DAudioRepositoryReverb,
+	E3DAudioRepositoryDoppler,
+	E3DAudioRepositoryDopplerAvailable,
+	E3DAudioRepositoryRingingToneInUse,
+	E3DAudioRepositoryProfileId,
+	
+	E3DAudioRepositoryLoadedPattern = 0x10,
+	E3DAudioRepositoryBlockCount,
+	E3DAudioRepositoryBlockStart = 0x20
+	};
+
+#endif // TDAUDIOCONSTANTS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/src/10208adf.rss	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Ringing Tone plugin for playing 3D ringing tones.
+*
+*/
+
+
+
+// INCLUDES
+#include "registryinfo.rh"
+
+//  RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// Registry information for Ringing Tone plugin for Profiles application.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+	{
+    // UID for the DLL
+    dll_uid = 0x10208ADF;
+    // Declare array of interface info
+    interfaces =
+    	{
+    	INTERFACE_INFO
+        	{
+        	// UID of interface that is implemented
+        	interface_uid = 0x1020299A;
+        	implementations =
+            	{
+            	IMPLEMENTATION_INFO
+                	{
+                	implementation_uid = 0x10208ADF;
+                	version_no = 1;
+                	display_name = "3D Ringing Tone Plugin";
+                	default_data = "default";
+                	opaque_data = "";
+                	}
+            	};
+        	}
+    	};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/src/C3DAudioPattern.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,321 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Handles accessing 3D motion pattern data.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "C3DAudioPattern.h"		// C3DAudioPattern
+#include <s32std.h>				// RReadStream, RWriteStream
+
+// CONSTANTS
+// Granularity for array holding updates.
+const TInt KPatternArrayGranularity = 84;
+
+// Maximum length for name of the pattern.
+const TUint KMaxPatternNameLength = 100;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::NewL
+// Two-phased constructor. 
+// -----------------------------------------------------------------------------
+//
+C3DAudioPattern* C3DAudioPattern::NewL()
+    {
+    C3DAudioPattern * self = C3DAudioPattern::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::NewLC
+// Two-phased constructor. Leaves pointer on cleanup stack.
+// -----------------------------------------------------------------------------
+//
+C3DAudioPattern* C3DAudioPattern::NewLC()
+    {
+    C3DAudioPattern * self = new ( ELeave ) C3DAudioPattern();
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::NewL
+// Two-phased constructor. 
+// -----------------------------------------------------------------------------
+//
+
+C3DAudioPattern* C3DAudioPattern::NewL( RReadStream& aStream )
+	{
+	C3DAudioPattern* self = C3DAudioPattern::NewLC( aStream );
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::NewLC
+// Two-phased constructor. Leaves pointer on cleanup stack.
+// -----------------------------------------------------------------------------
+//
+C3DAudioPattern* C3DAudioPattern::NewLC( RReadStream& aStream )
+	{
+	C3DAudioPattern* self = new ( ELeave ) C3DAudioPattern();
+	CleanupStack::PushL( self );
+	self->InternalizeL( aStream );
+	return self;
+	}
+
+
+// Destructor
+C3DAudioPattern::~C3DAudioPattern()
+    {
+    iScript.Close();
+    iLoops.Close();
+    iOpenLoops.Close();
+    delete iName;
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::ExternalizeL
+// Externalizes pattern to writestream.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioPattern::ExternalizeL(	RWriteStream& aStream ) const
+	{
+	// Name of the pattern
+	aStream << *iName;
+	
+	// Initial doppler and reverb.
+	aStream.WriteInt8L( iInitialDoppler );
+	aStream.WriteUint8L( iInitialReverb );
+
+	// Number of loops
+	aStream.WriteUint8L( iLoops.Count() );
+	// Each loop
+	for ( TInt i = 0; i < iLoops.Count(); ++i )
+		{
+		aStream.WriteUint8L( iLoops[i].iLoopStart );
+		aStream.WriteUint8L( iLoops[i].iLoopEnd );
+		aStream.WriteUint8L( iLoops[i].iCount );
+		}
+
+	// Number of updates in the script		
+	aStream.WriteUint8L( iScript.Count() );
+	// Each update
+	for ( TInt i = 0; i < iScript.Count(); ++i )
+		{
+		// Position of the update
+		aStream.WriteInt16L( iScript[i].iPosition.iX );
+		aStream.WriteInt16L( iScript[i].iPosition.iY );
+		aStream.WriteInt16L( iScript[i].iPosition.iZ );
+		
+		// Velocity of the update
+		aStream.WriteInt8L( iScript[i].iVelocity.iScalar );
+		aStream.WriteUint16L( iScript[i].iVelocity.iScalarVelocity );
+		aStream.WriteInt16L( iScript[i].iVelocity.iXVector );
+		aStream.WriteInt16L( iScript[i].iVelocity.iYVector );
+		aStream.WriteInt16L( iScript[i].iVelocity.iZVector );
+		
+		// Time reserved for the update.
+		aStream.WriteUint16L( iScript[i].iDTime );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::InternalizeL
+// Internalizes pattern from readstream
+// -----------------------------------------------------------------------------
+//
+void C3DAudioPattern::InternalizeL(	RReadStream& aStream )
+	{
+	// Internalize the name from stream.
+	delete iName;
+	iName = NULL;
+	iName = HBufC8::NewL( aStream, KMaxPatternNameLength );
+	
+	// Initial doppler and reverberation
+	iInitialDoppler = aStream.ReadInt8L();
+	iInitialReverb = aStream.ReadUint8L();
+
+	// Reset the array of loops.
+	iLoops.Reset();
+	TInt loopCount = aStream.ReadUint8L();
+	// Read each loop.
+	for (TInt i = 0; i < loopCount; ++i)
+		{
+		T3DLoop tempLoop;
+		tempLoop.iLoopStart = aStream.ReadUint8L();
+		tempLoop.iLoopEnd = aStream.ReadUint8L();
+		tempLoop.iCount = aStream.ReadUint8L();
+		iLoops.Append( tempLoop );
+		}
+	
+	// Reset the array of loops.
+	iScript.Reset();
+	TInt scriptCount = aStream.ReadUint8L();
+	// Read each update.
+	for (TInt i = 0; i < scriptCount; ++i)
+		{
+		T3DPosition tempPosition;
+		tempPosition.iX = aStream.ReadInt16L();
+		tempPosition.iY = aStream.ReadInt16L();
+		tempPosition.iZ = aStream.ReadInt16L();
+		
+		T3DVelocity tempVelocity;
+		tempVelocity.iScalar = aStream.ReadInt8L();
+		tempVelocity.iScalarVelocity = aStream.ReadUint16L();
+		tempVelocity.iXVector = aStream.ReadInt16L();
+		tempVelocity.iYVector = aStream.ReadInt16L();
+		tempVelocity.iZVector = aStream.ReadInt16L();
+		
+		T3DScriptUpdate tempScript;
+		tempScript.iDTime = aStream.ReadUint16L();
+		tempScript.iPosition = tempPosition;
+		tempScript.iVelocity = tempVelocity;
+		iScript.Append( tempScript );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::SetName
+// Set the name of the pattern. Memory will be allocated.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioPattern::SetNameL( const TDesC8& aName )
+	{
+	delete iName;
+	iName = NULL;
+	iName = aName.AllocL();
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::SetReverb
+// Set the value of reverberation.
+// -----------------------------------------------------------------------------
+//	
+void C3DAudioPattern::SetReverb( const TUint aReverb )
+	{
+	iInitialReverb = aReverb;
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::SetDoppler
+// Set the status of doppler.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioPattern::SetDoppler( const TBool aDoppler )
+	{
+	iInitialDoppler = aDoppler;
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::AddUpdate
+// Adds a update to script.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioPattern::AddUpdateL( T3DScriptUpdate& aUpdate )
+	{
+	User::LeaveIfError( iScript.Append( aUpdate ) );
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::StartLoop
+// Start loop at current place in the script.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioPattern::StartLoopL( TUint& aCount )
+	{
+	// Create T3DLoop and append it to array.
+	T3DLoop loop = { iScript.Count(), 0, aCount };
+	User::LeaveIfError( iLoops.Append( loop ) );
+	
+	// 	Update open loops array, to be able to determine which loop to end.
+	User::LeaveIfError( iOpenLoops.Append( iLoops.Count() - 1 ) );
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::EndLoop
+// End the lastly started loop.
+// -----------------------------------------------------------------------------
+//	
+void C3DAudioPattern::EndLoop()
+	{
+	// There is at least one open loop.
+	if ( iOpenLoops.Count() != 0 )
+		{
+		// Get the index of the loop.
+		TInt aIndex = iOpenLoops[ iOpenLoops.Count() - 1 ];
+		// Set the index of loop end and remove loop from array of open loops.
+		iLoops[ aIndex ].iLoopEnd = iScript.Count() - 1;
+		iOpenLoops.Remove( iOpenLoops.Count() - 1 );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::Name
+// Get the name of the pattern.
+// -----------------------------------------------------------------------------
+//	
+const TDesC8& C3DAudioPattern::Name()
+    {
+    return *iName;
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::Script
+// Get the script of pattern.
+// -----------------------------------------------------------------------------
+//	
+RArray< T3DScriptUpdate > C3DAudioPattern::Script()
+	{
+	return iScript;
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::DopplerAvailable
+// Is doppler available in the pattern.
+// -----------------------------------------------------------------------------
+//		
+TBool C3DAudioPattern::DopplerAvailable() const
+	{
+	return iInitialDoppler;
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::Reverb
+// Get initial reverb of pattern.
+// -----------------------------------------------------------------------------
+//			
+TInt C3DAudioPattern::Reverb() const
+	{
+	return iInitialReverb;
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioPattern::C3DAudioPattern
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+C3DAudioPattern::C3DAudioPattern(): 
+	iScript( KPatternArrayGranularity )
+    {
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/src/C3DAudioTimeOutTimer.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Timer for reading 3D pattern data.
+*
+*/
+
+
+// INCLUDE FILES
+#include "C3DAudioTimeOutTimer.h"
+
+
+
+// ========================= MEMBER FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// C3DAudioTimeOutTimer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+C3DAudioTimeOutTimer* C3DAudioTimeOutTimer::NewL( 
+	const TInt aPriority,
+    M3DAudioTimeOutNotifier* aTimeOutNotify )
+    {
+    C3DAudioTimeOutTimer* self = C3DAudioTimeOutTimer::NewLC( aPriority, 
+    														  aTimeOutNotify );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioTimeOutTimer::NewLC
+// Two-phased constructor. Leaves pointer on cleanup stack.
+// -----------------------------------------------------------------------------
+//
+C3DAudioTimeOutTimer* C3DAudioTimeOutTimer::NewLC( 
+	const TInt aPriority,
+	M3DAudioTimeOutNotifier* aTimeOutNotify )
+    {
+    C3DAudioTimeOutTimer* self = new ( ELeave ) C3DAudioTimeOutTimer( aPriority,
+                                                        			  aTimeOutNotify );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioTimeOutTimer::C3DAudioTimeOutTimer
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+C3DAudioTimeOutTimer::C3DAudioTimeOutTimer( 
+	const TInt aPriority,
+	M3DAudioTimeOutNotifier* aTimeOutNotify ):
+ 	CTimer( aPriority ), 
+ 	iNotify( aTimeOutNotify )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioTimeOutTimer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioTimeOutTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add( this );
+    }
+
+// Destructor.
+C3DAudioTimeOutTimer::~C3DAudioTimeOutTimer()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// C3DAudioTimeOutTimer::RunError
+// Called when RunL() leaves.
+// -----------------------------------------------------------------------------
+//
+TInt C3DAudioTimeOutTimer::RunError( TInt /*aError*/ )
+	{
+	return KErrNone;				 
+	}
+
+// -----------------------------------------------------------------------------
+// C3DAudioTimeOutTimer::RunL
+// Called when operation completes.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioTimeOutTimer::RunL()
+    {
+    // Timer request has completed, so notify the timer's owner
+    if ( iStatus == KErrNone )
+        {
+        iNotify->TimerExpiredL();
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/src/C3DAudioXMLParser.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,2073 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  XML-Parser used to parse motion patterns.
+*
+*/
+
+
+// INCLUDE FILES
+#include "C3DAudioXMLParser.h"
+#include "tdaudioconstants.h"	// K3DAudioRepositoryUid
+#include <f32file.h>			// RFs
+#include <s32mem.h>				// RBufWriteStream
+#include <centralrepository.h>	// CRepository
+
+
+#include "RingingTone3DPluginDebug.h"
+#include <ProfileInternal.hrh> // for TProfile3DToneEffect and TProfile3DToneEcho
+
+#include <pathinfo.h>
+#include <driveinfo.h>
+#include <data_caging_path_literals.hrh>
+
+
+//CONSTANTS
+const TInt32 KRingingTone3DAudioEComPluginUID = 0x10208ADF;
+
+
+// 3DTone pattern dir
+_LIT( K3DTonesDir, "3DTones" );
+
+// 3DTone pattern files
+_LIT( KPatternCircle,     "1circular.xml" );
+_LIT( KPatternFlyBy,      "2flyby.xml" );
+_LIT( KPatternZigZag,     "3zigzag.xml" );
+_LIT( KPatternRandomWalk, "4meander.xml" );
+_LIT( KPatternChaos,      "5random.xml" );
+
+
+// Elements
+_LIT8( KInitElement, "initialization");
+_LIT8( KPositionElement, "position" );
+_LIT8( KUpdateElement, "update" );
+_LIT8( KVelocityElement, "velocity" );
+_LIT8( KLoopElement, "loop" );
+
+// Attribute names.
+_LIT8( KPatternName, "name" );
+_LIT8( KPatternReverb, "reverb" );
+_LIT8( KPatternDoppler, "doppler" );
+_LIT8( KXCoordinate, "x" );
+_LIT8( KYCoordinate, "y" );
+_LIT8( KZCoordinate, "z" );
+_LIT8( KDTime, "dTime" );
+_LIT8( KScalarVelocity, "scalar" );
+_LIT8( KLoopCount, "count" );
+
+// Attribute values
+_LIT8( KReverbPresetOne, "Livingroom" );
+_LIT8( KReverbPresetTwo, "Cave" );
+_LIT8( KReverbPresetThree, "Stone Corridor" );
+_LIT8( KReverbPresetFour, "Forest" );
+_LIT8( KReverbPresetFive, "Sewerpipe" );
+_LIT8( KReverbPresetSix, "Underwater" );
+_LIT8( KBooleanTrue, "true" );
+
+
+
+/******************************************************************************
+ * class C3DAudioXMLParser
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//		
+C3DAudioXMLParser* C3DAudioXMLParser::NewL()
+	{
+	C3DAudioXMLParser* self = C3DAudioXMLParser::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::NewLC
+// Two-phased constructor. Leaves pointer on cleanup stack.
+// -----------------------------------------------------------------------------
+//		
+C3DAudioXMLParser* C3DAudioXMLParser::NewLC()
+	{
+	C3DAudioXMLParser * self = new ( ELeave ) C3DAudioXMLParser();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;	
+	}
+
+
+// Destructor
+C3DAudioXMLParser::~C3DAudioXMLParser()
+	{
+	delete iParser;
+	delete iParsedPattern;
+   	iFsSession.Close();
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::C3DAudioXMLParser
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//		
+C3DAudioXMLParser::C3DAudioXMLParser():
+	iParser( NULL ),
+	iParsedPattern( NULL )
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::ConstructL()
+    {
+    _LIT8( KParserMimeType, "text/xml" );
+    
+	iPatternId = KErrNotFound;
+	
+	iParser = Xml::CParser::NewL( KParserMimeType, *this );
+	
+	User::LeaveIfError( iFsSession.Connect() );
+    }	
+    
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::Count
+//
+// -----------------------------------------------------------------------------
+//		
+TInt C3DAudioXMLParser::CountL()
+    {
+    User::LeaveIfNull( iParsedPattern );
+    const RArray<T3DScriptUpdate>& script = iParsedPattern->Script();
+    
+    return script.Count();
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::PositionL
+//
+// -----------------------------------------------------------------------------
+//		
+const T3DPosition& C3DAudioXMLParser::PositionL( TInt aIndex )
+    {
+    User::LeaveIfNull( iParsedPattern );
+    const RArray<T3DScriptUpdate>& script = iParsedPattern->Script();
+    
+    if ( aIndex < 0 || aIndex >= script.Count() )
+        {
+        User::Leave( KErrArgument );
+        }
+        
+    return script[ aIndex ].iPosition;
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::VelocityL
+//
+// -----------------------------------------------------------------------------
+//		
+const T3DVelocity& C3DAudioXMLParser::VelocityL( TInt aIndex )
+    {
+    User::LeaveIfNull( iParsedPattern );
+    const RArray<T3DScriptUpdate>& script = iParsedPattern->Script();
+    
+    if ( aIndex < 0 || aIndex >= script.Count() )
+        {
+        User::Leave( KErrArgument );
+        }
+        
+    return script[ aIndex ].iVelocity;
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::TimeL
+//
+// -----------------------------------------------------------------------------
+//		
+const TInt& C3DAudioXMLParser::TimeL( TInt aIndex )
+    {
+    User::LeaveIfNull( iParsedPattern );    
+    const RArray<T3DScriptUpdate>& script = iParsedPattern->Script();
+    
+    if ( aIndex < 0 || aIndex >= script.Count() )
+        {
+        User::Leave( KErrArgument );
+        }
+        
+    return script[ aIndex ].iDTime;
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::Attribute
+//
+// -----------------------------------------------------------------------------
+//		
+TInt C3DAudioXMLParser::Attribute( TInt aKey )
+    {
+    TInt num = KErrNotFound;
+    
+    switch ( aKey )
+        {
+        case EKeyPatternId:
+            {
+            num = iPatternId;
+            break;
+            }
+        case EKeyDopplerUsed:
+            {
+            num = iParsedPattern->DopplerAvailable();
+            break;
+            }
+        case EKeyVelocity:
+            {
+            num = KMotionPatternDefaultVelocity;
+            break;
+            }
+        default:
+            {
+            break;    
+            }
+        }
+        
+    return num;
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ParseL
+//
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::ParseL( TInt aPatternId )
+	{
+	FLOG( _L("C3DAudioXMLParser::ParseL START") );
+
+	if ( ReadFromPatternCacheL( aPatternId ) )
+	    {
+
+#ifdef _DEBUG
+        // parsed pattern data found in cache (publish and subcribe)
+        FlogPatternL( aPatternId );
+#endif
+
+	    }
+	else
+	    {
+    	GetPatternFullPathL( iFullPath, aPatternId );
+	    ParseL( iFullPath );
+
+	    WriteToPatternCacheL( aPatternId );
+	    
+	    FLOG( _L("pattern '%S' parsed and written to cache"), &iFullPath );
+	    }
+	    
+	iPatternId = aPatternId;
+	
+#ifdef _DEBUG                         
+    AssertParseDataL( aPatternId );
+#endif
+
+	
+	FLOG( _L("C3DAudioXMLParser::ParseL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ParseL
+//
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::ParseL( const TDesC& aFileName )
+	{
+	delete iParsedPattern;
+    iParsedPattern = NULL;
+	iParsedPattern = C3DAudioPattern::NewL();
+	
+	//
+	// read xml-format pattern file into descriptor
+	//
+	CBufFlat* buf = ReadPatternFileL( aFileName );
+	CleanupStack::PushL( buf );
+	
+	//
+	// parse xml-format pattern into C3DAudioPattern
+	//
+	TPtr8 ptr = buf->Ptr( 0 );
+    iParser->ParseL( ptr );
+    iParser->ParseEndL();
+    
+    RArray<T3DScriptUpdate> script = iParsedPattern->Script();
+	if ( script.Count() == 0 )
+	    {
+        User::Leave( KErrNotFound );
+	    }
+
+   	CleanupStack::PopAndDestroy( buf );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ReadFromPatternCacheL
+//
+// -----------------------------------------------------------------------------
+//		
+TBool C3DAudioXMLParser::ReadFromPatternCacheL( TInt aPatternId )
+	{
+   	C3DPatternPS* pubSub = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID );
+    
+    TInt patternId = pubSub->IntL( C3DPatternPS::EKeyPatternId );
+    if ( patternId == aPatternId )
+        {
+        // buffer for 3D pattern data
+        CBufFlat* buf = pubSub->DataLC();
+                
+        // readstream to construct the pattern.
+        RBufReadStream readstream( *buf );
+        CleanupClosePushL( readstream );
+                
+        // create C3DAudioPattern for accessing 3D ringing tone data 
+        delete iParsedPattern;
+        iParsedPattern = NULL;
+        iParsedPattern = C3DAudioPattern::NewL( readstream );
+    
+	    CleanupStack::PopAndDestroy( &readstream );
+	    CleanupStack::PopAndDestroy( buf );
+        }
+       
+	CleanupStack::PopAndDestroy( pubSub );
+	
+	if ( patternId == aPatternId )
+	    {
+	    return ETrue;
+	    }
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::WriteToPatternCacheL
+//
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::WriteToPatternCacheL( TInt aPatternId )
+	{
+    const TInt KGranularity = 1024;
+	
+   	C3DPatternPS* pubSub = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID );
+
+    //
+    // write binary-format (parsed) pattern data into descriptor
+    //
+    CBufFlat* buf = CBufFlat::NewL( KGranularity );
+    CleanupStack::PushL( buf );
+    
+    RBufWriteStream writestream( *buf );
+    CleanupClosePushL( writestream );
+    iParsedPattern->ExternalizeL( writestream );
+   	writestream.CommitL();
+	CleanupStack::PopAndDestroy( &writestream );
+
+#ifdef _DEBUG
+    TInt oldPatternId = pubSub->IntL( C3DPatternPS::EKeyPatternId );
+    FlogPatternsL( oldPatternId, aPatternId );
+#endif    
+    
+    //
+    // write pattern data and attributes into public and subscribe
+    //
+    pubSub->SetIntL( C3DPatternPS::EKeyPatternId, KErrNotFound );
+	pubSub->SetIntL( C3DPatternPS::EKeyDopplerUsed, iParsedPattern->DopplerAvailable() );
+	pubSub->SetIntL( C3DPatternPS::EKeyVelocity, KMotionPatternDefaultVelocity );
+	pubSub->SetDataL( buf->Ptr( 0 ) );
+	pubSub->SetIntL( C3DPatternPS::EKeyPatternId, aPatternId );
+	
+	CleanupStack::PopAndDestroy( buf );
+	
+	CleanupStack::PopAndDestroy( pubSub );
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnStartDocumentL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//	
+void C3DAudioXMLParser::OnStartDocumentL( 
+	const Xml::RDocumentParameters& /*aDocParam*/, 
+	TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnEndDocumentL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnEndDocumentL( 
+	TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnStartElementL
+// Proceed depending on the element.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnStartElementL( 
+	const Xml::RTagInfo& aElement, 
+	const Xml::RAttributeArray& aAttributes, 
+	TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	
+	CopyL( iElementName, aElement.LocalName().DesC() );
+	
+	// Proceed depending of the element.
+	if ( iElementName.CompareC( KUpdateElement ) == 0 )
+		{
+		ProcessUpdateAttributesL( aAttributes );
+		iLastTag = EUpdate;
+		}
+	else if ( iElementName.CompareC( KPositionElement ) == 0 )
+		{
+		// Do not take position in initialization in account.
+		if ( iLastTag == EUpdate )
+			{
+			ProcessPositionAttributesL( aAttributes );
+			}
+		}
+	else if ( iElementName.CompareC( KVelocityElement ) == 0 )
+		{
+		// Do not take velocity in initialization in account.
+		if ( iLastTag == EUpdate )
+			{
+			ProcessVelocityAttributesL( aAttributes );	
+			}
+		}
+	else if ( iElementName.CompareC( KInitElement ) == 0 )
+		{
+		// pasi
+		// Create new motion pattern and process the attributes of it.
+		delete iParsedPattern;
+    	iParsedPattern = NULL;
+		iParsedPattern = C3DAudioPattern::NewL();
+		
+		ProcessInitAttributesL( aAttributes );
+		iLastTag = EInitialization;
+		}
+	else if ( iElementName.CompareC( KLoopElement ) == 0 )
+		{
+		ProcessLoopAttributesL( aAttributes );
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnEndElementL
+// Proceed for elements that need processing.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnEndElementL( const Xml::RTagInfo& aElement, TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	
+	CopyL( iElementName, aElement.LocalName().DesC() );
+	
+	if ( iElementName.CompareC( KUpdateElement ) == 0 )
+		{
+		// Update-element ended, add the update to script.
+		iParsedPattern->AddUpdateL( iCurrentUpdate );
+		}
+	else if ( iElementName.CompareC( KLoopElement ) == 0 )
+		{
+		// Loop-element ended, end the loop.
+		iParsedPattern->EndLoop();
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnContentL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnContentL( const TDesC8& /*aBytes*/, TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnStartPrefixMappingL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//	
+void C3DAudioXMLParser::OnStartPrefixMappingL( const RString& /*aPrefix*/, 
+	                                           const RString& /*aUri*/, 
+	                                           TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnEndPrefixMappingL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnEndPrefixMappingL( const RString& /*aPrefix*/, 
+	                                         TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnIgnorableWhiteSpaceL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnIgnorableWhiteSpaceL(	const TDesC8& /*aBytes*/, 
+	                                            TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnSkippedEntityL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnSkippedEntityL( const RString& /*aName*/, 
+	                                      TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnProcessingInstructionL
+// Leave if error, otherwise nothing to do.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnProcessingInstructionL( const TDesC8& /*aTarget*/, 
+	                                              const TDesC8& /*aData*/, 
+	                                              TInt aErrorCode )
+	{
+	// Leave if error occurred.
+	User::LeaveIfError( aErrorCode );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::OnError
+// Print error code to debug.
+// -----------------------------------------------------------------------------
+//		
+void C3DAudioXMLParser::OnError( TInt aErrorCode )
+	{
+	if ( aErrorCode != KErrNone )
+	    {
+	    FLOG( _L("### C3DAudioXMLParser::OnError (%d) ###"), aErrorCode );    
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::GetExtendedInterface
+// Not implemented
+// -----------------------------------------------------------------------------
+//
+TAny* C3DAudioXMLParser::GetExtendedInterface( const TInt32 /*aUid*/ )
+	{
+	return NULL;
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ProcessInitAttributesL
+// Process the initialization attributes.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::ProcessInitAttributesL( const Xml::RAttributeArray& aAttributes )
+	{
+	// Check each attribute.	
+	for ( TUint i = 0; i < aAttributes.Count(); ++i )
+		{
+		CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() );
+		CopyL( iAttributeValue, aAttributes[i].Value().DesC() );
+		
+		// Set the name of the pattern.
+		if ( iAttributeName.CompareC( KPatternName ) == 0 )
+			{
+			iParsedPattern->SetNameL( iAttributeValue );
+			}
+		else if ( iAttributeName.CompareC( KPatternReverb ) == 0 )
+			{
+			TUint selectedReverb = EReverbNotEnabled;
+
+			// Determine the reverberation.			
+			if ( iAttributeValue.CompareC( KReverbPresetOne ) == 0 )
+				{
+				selectedReverb = EReverbPresetOne;	
+				}
+			else if ( iAttributeValue.CompareC( KReverbPresetTwo ) == 0 )
+				{
+				selectedReverb = EReverbPresetTwo;
+				}
+			else if ( iAttributeValue.CompareC( KReverbPresetThree ) == 0 )
+				{
+				selectedReverb = EReverbPresetThree;
+				}
+			else if ( iAttributeValue.CompareC( KReverbPresetFour ) == 0 )
+				{
+				selectedReverb = EReverbPresetFour;
+				}
+			else if ( iAttributeValue.CompareC( KReverbPresetFive ) == 0 )
+				{
+				selectedReverb = EReverbPresetFive;
+				}
+			else if ( iAttributeValue.CompareC( KReverbPresetSix ) == 0 )
+				{
+				selectedReverb = EReverbPresetSix;
+				}
+				
+			// Set the reverberation to pattern.				
+			iParsedPattern->SetReverb( selectedReverb );
+			}
+		else if ( iAttributeName.CompareC( KPatternDoppler ) == 0)
+			{
+			// Set doppler.			
+			if ( iAttributeValue.CompareC( KBooleanTrue ) == 0 )
+				{
+				iParsedPattern->SetDoppler( ETrue );
+				}
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ProcessLoopAttributes
+// Process the loop-element attributes.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::ProcessLoopAttributesL( const Xml::RAttributeArray& aAttributes )
+	{
+	TLex8 lex;
+			
+	for ( TUint i = 0; i < aAttributes.Count(); ++i )
+		{
+		CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() );
+		CopyL( iAttributeValue, aAttributes[i].Value().DesC() );
+
+		lex.Assign( iAttributeValue );
+		
+		if ( iAttributeName.CompareC( KLoopCount ) == 0 )
+			{
+			TUint loopCount;
+			User::LeaveIfError ( lex.Val( loopCount ) );
+			
+			// Start the loop in pattern.
+			iParsedPattern->StartLoopL( loopCount );
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ProcessPositionAttributes
+// Process the position-element attributes.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::ProcessPositionAttributesL( const Xml::RAttributeArray& aAttributes )
+	{
+	TLex8 lex;
+	T3DPosition position = T3DPosition();
+		
+    TInt count = aAttributes.Count();
+	for ( TUint i = 0; i < count; ++i )
+		{
+		CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() );
+		CopyL( iAttributeValue, aAttributes[i].Value().DesC() );
+
+		lex.Assign( iAttributeValue );
+		
+		if ( iAttributeName.CompareC( KXCoordinate ) == 0 )
+			{
+			User::LeaveIfError( lex.Val( position.iX ) );
+			}
+		else if ( iAttributeName.CompareC( KYCoordinate ) == 0 )
+			{
+			User::LeaveIfError( lex.Val( position.iY ) );
+			}
+		else if ( iAttributeName.CompareC( KZCoordinate ) == 0)
+			{
+			User::LeaveIfError( lex.Val( position.iZ ) );
+			}
+		}
+		
+	// Set position for current update.
+	iCurrentUpdate.iPosition = position;	
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ProcessUpdateAttributes
+// Process the update-element attributes.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::ProcessUpdateAttributesL( const Xml::RAttributeArray& aAttributes )
+	{
+	TLex8 lex;
+	// New update-element.
+	iCurrentUpdate = T3DScriptUpdate();
+		
+	for ( TUint i = 0; i < aAttributes.Count(); ++i )
+		{
+		CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() );
+		CopyL( iAttributeValue, aAttributes[i].Value().DesC() );
+
+		lex.Assign( iAttributeValue );
+		
+		if ( iAttributeName.CompareC( KDTime ) == 0 )
+			{
+			// Set the dTime for the update.			
+			User::LeaveIfError( lex.Val( iCurrentUpdate.iDTime ) );
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::ProcessVelocityAttributes
+// Process the velocity-element attributes.
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::ProcessVelocityAttributesL( const Xml::RAttributeArray& aAttributes )
+	{
+	TLex8 lex;
+	T3DVelocity velocity = T3DVelocity();
+		
+	for ( TUint i = 0; i < aAttributes.Count(); ++i )
+		{
+		CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() );
+		CopyL( iAttributeValue, aAttributes[i].Value().DesC() );
+
+		lex.Assign( iAttributeValue );
+		
+		if ( iAttributeName.CompareC( KScalarVelocity ) == 0 )
+			{
+			velocity.iScalar = ETrue;
+			User::LeaveIfError( lex.Val( velocity.iScalarVelocity ) );
+			velocity.iXVector = 0;
+			velocity.iYVector = 0;
+			velocity.iZVector = 0;
+			break;
+			}
+		else if ( iAttributeName.CompareC( KXCoordinate ) == 0 )
+			{
+			User::LeaveIfError( lex.Val( velocity.iXVector ) );
+			}
+		else if ( iAttributeName.CompareC( KYCoordinate ) == 0 )
+			{
+			User::LeaveIfError( lex.Val( velocity.iYVector ) );
+			}
+		else if ( iAttributeName.CompareC( KZCoordinate ) == 0)
+			{
+			User::LeaveIfError( lex.Val( velocity.iZVector ) );
+			}
+		}
+	// Set velocity for current update.	
+	iCurrentUpdate.iVelocity = velocity;
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::CopyL
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::CopyL( TDes8& aTarget, const TDesC8& aSource )
+	{
+	if ( aSource.Length() > aTarget.MaxLength() )
+	    {
+
+#ifdef _DEBUG			                
+        Panic( KErrArgument );
+#endif        
+
+	    User::Leave( KErrTooBig );
+	    }
+	    
+	aTarget.Copy( aSource );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::Panic()
+//
+// -----------------------------------------------------------------------------
+//    
+void C3DAudioXMLParser::Panic(TInt aReason)
+    {
+	_LIT(KPanicCategory,"RingingTone3DAudioPlugin");
+	
+	User::Panic(KPanicCategory, aReason); 
+    }
+    
+
+// -------------------------------------------------------------------------------
+// C3DAudioXMLParser::ReadPatternFileL
+//
+// -------------------------------------------------------------------------------
+//
+CBufFlat* C3DAudioXMLParser::ReadPatternFileL( const TDesC& aFullName )
+    {
+    const TInt KGranularity = 1024;
+    
+    RFile file;
+	User::LeaveIfError( file.Open( iFsSession, aFullName, EFileRead ) );
+	CleanupClosePushL( file );
+
+  	CBufFlat* buf = CBufFlat::NewL( KGranularity );
+	CleanupStack::PushL( buf );
+	
+	TInt size = 0;
+	file.Size( size );
+	buf->ResizeL( size );
+	
+	TPtr8 ptr = buf->Ptr( 0 );
+	User::LeaveIfError( file.Read( ptr ) );
+
+	CleanupStack::Pop( buf );
+	CleanupStack::PopAndDestroy( &file );
+	
+	return buf;
+    }
+    
+    
+// -------------------------------------------------------------------------------
+// C3DAudioXMLParser::GetPatternFullPathL
+//
+// -------------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::GetPatternFullPathL(TDes& aText, TInt aPatternId)
+    {
+    _LIT( KFormatString, "%S%S%S\\%S");
+
+    TBuf<KBufSize32> pattern;
+
+    // emulator dir  "\epoc32\release\winscw\udeb\Z\resource\3DTones"
+    // hardware dir  "z:\data\Z\resource\3DTones"
+
+    switch (aPatternId)
+        {
+        case EProfile3DEffectCircle:
+            {
+            pattern = KPatternCircle;
+            break;
+            }
+        case EProfile3DEffectFlyby:
+            {
+            pattern = KPatternFlyBy;
+            break;
+            }
+        case EProfile3DEffectZigZag:
+            {
+            pattern = KPatternZigZag;
+            break;
+            }
+        case EProfile3DEffectRandomWalk:
+            {
+            pattern = KPatternRandomWalk;
+            break;
+            }
+        case EProfile3DEffectChaos:
+            {
+            pattern = KPatternChaos;
+            break;
+            }
+        default:
+            {
+            User::Leave( KErrNotSupported );
+            break;
+            }
+        }
+        
+  	TDriveUnit drive( EDriveZ );
+	TDriveName driveName = drive.Name();
+	
+	aText.Format(KFormatString, &driveName, &KDC_RESOURCE_FILES_DIR, &K3DTonesDir, &pattern);
+    }
+    
+
+
+
+
+
+#ifdef _DEBUG
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::AssertParseDataL
+//
+// -----------------------------------------------------------------------------
+//
+void C3DAudioXMLParser::AssertParseDataL( TInt aPatternId )
+	{
+	const TInt KGranularity = 1024;
+	
+   	C3DPatternPS* ps = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID );
+	   	
+    CBufFlat* buf = CBufFlat::NewL( KGranularity );
+    CleanupStack::PushL( buf );
+    
+    RBufWriteStream writestream( *buf );
+    CleanupClosePushL( writestream );
+    iParsedPattern->ExternalizeL( writestream );
+   	writestream.CommitL();
+	CleanupStack::PopAndDestroy( &writestream );
+	
+	CBufFlat* buf2 = ps->DataLC();
+
+
+    TInt id = ps->IntL(C3DPatternPS::EKeyPatternId);
+    if ( id != aPatternId )
+        {
+        Panic( KErrGeneral );
+        }
+    
+    TPtr8 p1 = buf->Ptr( 0 );
+    TPtr8 p2 = buf2->Ptr( 0 );
+    
+    TInt ret = p1.Compare( p2 );
+    if ( ret != 0 )
+        {
+        Panic( KErrGeneral );
+        }
+    TInt doppler = ps->IntL( C3DPatternPS::EKeyDopplerUsed );
+    if ( doppler != iParsedPattern->DopplerAvailable() )
+        {
+        Panic( KErrGeneral );
+        }
+    TInt velocity = ps->IntL( C3DPatternPS::EKeyVelocity );
+    if (velocity != KMotionPatternDefaultVelocity)
+        {
+        Panic( KErrGeneral );
+        }
+    
+    CleanupStack::PopAndDestroy( buf2 );
+    CleanupStack::PopAndDestroy( buf );
+    CleanupStack::PopAndDestroy( ps );
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::FlogPatternsL()
+//
+// -----------------------------------------------------------------------------
+//    
+void C3DAudioXMLParser::FlogPatternsL(TInt aOldPattern, TInt aNewPattern)
+    {
+    TBuf<128> buf; TBuf<128> buf2;
+    
+    GetPatternString(buf, aOldPattern);
+    GetPatternString(buf2, aNewPattern);
+    FLOG( _L("pattern changed from '%S' to '%S'"), &buf, &buf2 );
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::FlogPatternL()
+//
+// -----------------------------------------------------------------------------
+//    
+void C3DAudioXMLParser::FlogPatternL(TInt aPattern)
+    {
+    TBuf<128> buf;
+    
+    GetPatternString(buf, aPattern);
+    FLOG( _L("pattern '%S' found in cache"), &buf );
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::GetPatternString()
+//
+// -----------------------------------------------------------------------------
+//    
+void C3DAudioXMLParser::GetPatternString(TDes& aText, TInt aPattern)
+    {
+	switch (aPattern)
+		{
+		case EProfile3DEffectOff:
+			aText = _L("EProfile3DEffectOff");
+			break;
+		case EProfile3DEffectCircle:
+			aText = _L("EProfile3DEffectCircle");
+			break;
+		case EProfile3DEffectFlyby:
+			aText = _L("EProfile3DEffectFlyby");
+			break;
+		case EProfile3DEffectZigZag:
+			aText = _L("EProfile3DEffectZigZag");
+			break;
+		case EProfile3DEffectRandomWalk:
+			aText = _L("EProfile3DEffectRandomWalk");
+			break;
+		case EProfile3DEffectChaos:
+			aText = _L("EProfile3DEffectChaos");
+			break;
+		case EProfile3DEffectStereoWidening:
+			aText = _L("EProfile3DEffectStereoWidening");
+			break;
+		case KErrNotFound:
+			aText = _L("KErrNotFound");
+			break;
+
+		default:
+			aText = _L("### unknown pattern ###");
+			break;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::FlogPubSubL()
+//
+// -----------------------------------------------------------------------------
+//    
+void C3DAudioXMLParser::FlogPubSubL(TInt aEcho)
+    {
+    FLOG( _L("------ start pubsub data ------") );
+    
+    TInt num = 0;
+    TBuf<128> buf;
+    
+    C3DPatternPS* pubSub = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID );
+	
+	num = pubSub->IntL(C3DPatternPS::EKeyPatternId);
+    C3DAudioXMLParser::GetPatternString(buf, num);
+    FLOG( _L("pattern: %S (%d)"), &buf, num );
+    
+    GetEchoString(buf, aEcho);
+    FLOG( _L("echo: %S (%d)"), &buf, aEcho );
+ 
+    num = pubSub->IntL(C3DPatternPS::EKeyVelocity);
+    FLOG( _L("velocity: %d"), num );
+    
+    num = pubSub->IntL(C3DPatternPS::EKeyDopplerUsed);
+    FLOG( _L("doppler: %d"), num );
+    
+    num = pubSub->IntL(C3DPatternPS::EKeyDataSize);
+    FLOG( _L("data size: %d"), num );
+    
+    CleanupStack::PopAndDestroy( pubSub );
+    
+    FLOG( _L("------ end pubsub data ------") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DAudioXMLParser::GetEchoString()
+//
+// -----------------------------------------------------------------------------
+//    
+void C3DAudioXMLParser::GetEchoString(TDes& aText, TInt aEcho)
+    {
+	switch (aEcho)
+		{
+		case EProfile3DEchoOff:
+			aText = _L("EProfile3DEchoOff");
+			break;
+		case EProfile3DEchoLivingRoom:
+			aText = _L("EProfile3DEchoLivingRoom");
+			break;
+		case EProfile3DEchoCave:
+			aText = _L("EProfile3DEchoCave");
+			break;
+		case EProfile3DEchoStoneCorridor:
+			aText = _L("EProfile3DEchoStoneCorridor");
+			break;
+		case EProfile3DEchoForest:
+			aText = _L("EProfile3DEchoForest");
+			break;
+		case EProfile3DEchoSewerPipe:
+			aText = _L("EProfile3DEchoSewerPipe");
+			break;
+		case EProfile3DEchoUnderwater:
+			aText = _L("EProfile3DEchoUnderwater");
+			break;
+		default:
+			aText = _L("### unknown echo ###");
+			break;
+		}
+    }
+
+#endif // _DEBUG
+
+
+
+
+/******************************************************************************
+ * class C3DPatternPS
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::NewLC
+//
+// -----------------------------------------------------------------------------
+//		
+C3DPatternPS* C3DPatternPS::NewLC( TInt aStoreId )
+	{
+	C3DPatternPS* self = new ( ELeave ) C3DPatternPS( aStoreId );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;	
+	}
+
+
+// Destructor
+C3DPatternPS::~C3DPatternPS()
+	{
+	iProperty.Close();
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::C3DPatternPS
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//		
+C3DPatternPS::C3DPatternPS( TInt aStoreId )
+	{
+	iStoreUid.iUid = aStoreId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void C3DPatternPS::ConstructL()
+    {
+    TBool ret = DefineKeyL( EKeyPatternId, RProperty::EInt );
+    if ( ret )
+        {
+        // first time initialization
+        TInt err = iProperty.Set( iStoreUid, EKeyPatternId, KErrNotFound );
+        User::LeaveIfError( err );
+        }
+        
+    DefineKeyL( EKeyDopplerUsed, RProperty::EInt );
+    DefineKeyL( EKeyVelocity, RProperty::EInt );
+    DefineKeyL( EKeyDataSize, RProperty::EInt );
+    DefineKeyL( EKeyPatternData, RProperty::ELargeText );
+    }	
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::DefineKeyL
+//
+// -----------------------------------------------------------------------------
+//
+TBool C3DPatternPS::DefineKeyL( TInt aKeyId, TInt aKeyType )
+    {
+    TInt err = iProperty.Define( iStoreUid, aKeyId, aKeyType );
+
+    if ( err != KErrNone && err != KErrAlreadyExists )
+        {
+        User::Leave( err );    
+        }
+        
+    if ( err == KErrNone )
+        {
+        return ETrue; // key was created
+        }
+        
+    return EFalse;    // key already existed
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::IntL
+//
+// -----------------------------------------------------------------------------
+//
+TInt C3DPatternPS::IntL( TInt aKey )
+    {
+    TInt num = KErrNotFound;
+    TInt err = iProperty.Get( iStoreUid, aKey, num );
+    User::LeaveIfError( err );
+    
+    return num;
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::SetIntL
+//
+// -----------------------------------------------------------------------------
+//
+void C3DPatternPS::SetIntL( TInt aKey, TInt aValue )
+    {
+    TInt err = iProperty.Set( iStoreUid, aKey, aValue );
+    User::LeaveIfError( err );
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::SetDataL
+//
+// -----------------------------------------------------------------------------
+//
+void C3DPatternPS::SetDataL( const TDesC8& aData )
+    {
+    const TInt KMaxSize = 65536;
+    
+    if ( aData.Size() > KMaxSize )
+        {
+        User::Leave( KErrOverflow );
+        }
+
+    TInt err = iProperty.Set( iStoreUid, EKeyPatternData, aData );
+    User::LeaveIfError( err );
+    
+    TInt size = aData.Size();
+    err = iProperty.Set( iStoreUid, EKeyDataSize, size );
+    User::LeaveIfError( err );
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::GetDataL
+//
+// -----------------------------------------------------------------------------
+//
+void C3DPatternPS::GetDataL( TDes8& aData )
+    {
+    TInt err = iProperty.Get( iStoreUid, EKeyPatternData, aData );
+    User::LeaveIfError( err );
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternPS::DataLC
+//
+// -----------------------------------------------------------------------------
+//
+CBufFlat* C3DPatternPS::DataLC()
+    {
+    const TInt KGranularity = 1024;
+
+    CBufFlat* buf = CBufFlat::NewL( KGranularity );
+    CleanupStack::PushL( buf );
+
+    TInt size = IntL( C3DPatternPS::EKeyDataSize );
+    buf->ResizeL( size );
+    TPtr8 ptr8 = buf->Ptr( 0 );
+    GetDataL( ptr8 );
+    
+    return buf;
+    }
+
+
+
+
+
+    
+////////////////////////////////////// START TEST CODE //////////////////////////
+
+// element names
+_LIT(KKInitElement, "initialization");
+_LIT(KKUpdateElement, "update");
+_LIT(KKPositionElement, "position");
+_LIT(KKVelocityElement, "velocity");
+
+// attribute names
+_LIT( KKXCoordinate, "x" );
+_LIT( KKYCoordinate, "y" );
+_LIT( KKZCoordinate, "z" );
+
+_LIT( KKPatternName, "name" );
+_LIT( KKEchoName, "reverb" );
+_LIT( KKDoppler, "doppler" );
+_LIT( KKDTime, "dTime" );
+
+// attribute values
+_LIT( KKBooleanTrue, "true" );
+
+
+
+
+// "Z:\\resource\\10208ADF\\3zigzag.xml"
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+C3DPatternParser* C3DPatternParser::NewL()
+    {
+    C3DPatternParser* self = new (ELeave) C3DPatternParser();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+C3DPatternParser::~C3DPatternParser()
+    {
+    iPositionList.Close();
+    iVelocityList.Close();
+   	delete iParser;
+   	iFsSession.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::C3DPatternParser
+// 
+// -----------------------------------------------------------------------------
+//
+C3DPatternParser::C3DPatternParser()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::ConstructL()
+    {
+    _LIT8(KMimeType, "text/xml");
+    
+	iParser = Xml::CParser::NewL( KMimeType, *this );
+	
+	User::LeaveIfError( iFsSession.Connect() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::ReadFileL
+// 
+// -----------------------------------------------------------------------------
+//
+CBufFlat* C3DPatternParser::ReadDocumentL(const TDesC& aFullName)
+    {
+    const TInt KGranularity = 1024;
+    
+    RFile file;
+	User::LeaveIfError( file.Open(iFsSession, aFullName, EFileRead) );
+	CleanupClosePushL(file);
+
+  	CBufFlat* buffer = CBufFlat::NewL(KGranularity);
+	CleanupStack::PushL(buffer);
+	
+	TInt size = 0;
+	file.Size(size);
+	buffer->ResizeL(size);
+	
+	TPtr8 ptr = buffer->Ptr(0);
+	User::LeaveIfError( file.Read(ptr) );
+
+	CleanupStack::Pop(buffer);
+	CleanupStack::PopAndDestroy(&file);
+	
+	return buffer;
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::ParseDocumentL
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::ParseDocumentL(const TDesC& aFullName)
+    {
+    iVelocityUsed = EFalse;
+    iDopplerUsed = EFalse;
+    
+    iPositionList.Reset();
+    iVelocityList.Reset();
+
+    
+    CBufFlat* buf = ReadDocumentL(aFullName);
+    CleanupStack::PushL(buf);
+    TPtr8 ptr = buf->Ptr(0);
+    
+    iParser->ParseL(ptr);
+    
+    iParser->ParseEndL();
+    
+    ///Print();
+    
+    CleanupStack::PopAndDestroy(buf);
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::ParseDocumentL
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::ParseDocumentL(TInt aPatternId)
+    {
+    TFileName name;
+    GetPatternFileNameL(name, aPatternId);
+    
+    ParseDocumentL(name);
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::GetPatternName
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::GetPatternName(TDes& aText)
+    {
+    StrCopy(aText, iPatternName);
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::GetEchoName
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::GetEchoName(TDes& aText)
+    {
+    StrCopy(aText, iEchoName);
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::GetEchoName
+// 
+// -----------------------------------------------------------------------------
+//
+TBool C3DPatternParser::DopplerEnabled()
+    {
+    return iDopplerUsed;
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::PositionCount
+// 
+// -----------------------------------------------------------------------------
+//
+TInt C3DPatternParser::PositionCount()
+    {
+    return iPositionList.Count();
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::Position
+// 
+// -----------------------------------------------------------------------------
+//
+T3DPatternData& C3DPatternParser::Position(TInt aIndex)
+    {
+    if (aIndex < 0 || aIndex >= iPositionList.Count())
+        {
+        Panic(KErrArgument);
+        }
+        
+    return iPositionList[aIndex];
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::Velocity
+// 
+// -----------------------------------------------------------------------------
+//
+T3DPatternData& C3DPatternParser::Velocity(TInt aIndex)
+    {
+    if (aIndex < 0 || aIndex >= iVelocityList.Count())
+        {
+        Panic(KErrArgument);
+        }
+        
+    return iVelocityList[aIndex];
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::AssertPosition
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::AssertPosition(TInt aIndex, TInt aX, TInt aY, TInt aZ)
+    {
+    T3DPatternData d = Position(aIndex);
+    
+    if (d.iX != aX || d.iY != aY || d.iZ != aZ)
+        {
+        Panic(KErrArgument);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::AssertVelocity
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::AssertVelocity(TInt aIndex, TInt aX, TInt aY, TInt aZ)
+    {
+    T3DPatternData d = Velocity(aIndex);
+    
+    if (d.iX != aX || d.iY != aY || d.iZ != aZ)
+        {
+        Panic(KErrArgument);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::AssertTime
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::AssertTime(TInt aIndex, TInt aTime)
+    {
+    T3DPatternData d = Position(aIndex);
+    
+    if (d.iTime != aTime)
+        {
+        Panic(KErrArgument);
+        }
+    }
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::StrCopy
+//
+// String copy with lenght check.
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::StrCopy(TDes& aTarget, const TDesC8& aSource)
+    {
+	TInt len = aTarget.MaxLength();
+    if(len < aSource.Length()) 
+	    {
+		aTarget.Copy(aSource.Left(len));
+		return;
+	    }
+	aTarget.Copy(aSource);
+    }
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::StrCopy
+//
+// String copy with lenght check.
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::StrCopy(TDes& aTarget, const TDesC& aSource)
+    {
+	TInt len = aTarget.MaxLength();
+    if(len < aSource.Length()) 
+	    {
+		aTarget.Copy(aSource.Left(len));
+		return;
+	    }
+	aTarget.Copy(aSource);
+    }
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::StrToIntL
+//
+// -------------------------------------------------------------------------------
+//
+TInt C3DPatternParser::StrToIntL(const TDesC& aText)
+	{
+	TInt num = KErrNotFound;
+	
+    TLex lex(aText);
+
+    User::LeaveIfError( lex.Val(num) ); 
+	return num;
+	}
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::Panic
+//
+// -----------------------------------------------------------------------------
+//    
+void C3DPatternParser::Panic(TInt aReason)
+    {
+	_LIT(KPanicCategory,"C3DPatternParser");
+	
+	User::Panic(KPanicCategory, aReason); 
+    }
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::GetPatternFileNameL
+//
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::GetPatternFileNameL(TDes& aText, TInt aPatternId)
+    {
+    _LIT( KFormatString, "%S%S%S%S");
+    _LIT( KPatternDir, "3DTones\\" );
+
+    _LIT( KPatternCircle,     "1circular.xml" );
+    _LIT( KPatternFlyBy,      "2flyby.xml" );
+    _LIT( KPatternZigZag,     "3zigzag.xml" );
+    _LIT( KPatternRandomWalk, "4meander.xml" );
+    _LIT( KPatternChaos,      "5random.xml" );
+
+    TBuf<KBufSize32> pattern;
+
+    switch (aPatternId)
+        {
+        case EProfile3DEffectCircle:
+            {
+            pattern = KPatternCircle;
+            break;
+            }
+        case EProfile3DEffectFlyby:
+            {
+            pattern = KPatternFlyBy;
+            break;
+            }
+        case EProfile3DEffectZigZag:
+            {
+            pattern = KPatternZigZag;
+            break;
+            }
+        case EProfile3DEffectRandomWalk:
+            {
+            pattern = KPatternRandomWalk;
+            break;
+            }
+        case EProfile3DEffectChaos:
+            {
+            pattern = KPatternChaos;
+            break;
+            }
+        default:
+            {
+            User::Leave( KErrNotSupported );
+            break;
+            }
+        }
+        
+  	TDriveUnit drive(EDriveZ);
+	TDriveName driveName = drive.Name();
+	
+	aText.Format(KFormatString, &driveName, &KDC_RESOURCE_FILES_DIR, &KPatternDir, &pattern);
+    }
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::ReadPositionAttributesL
+//
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::ReadPositionAttributesL(const Xml::RAttributeArray& aAttributes)
+	{
+    TInt count = aAttributes.Count();
+	
+	for (TUint i=0; i<count; ++i)
+		{
+    	StrCopy(iAttributeName, aAttributes[i].Attribute().LocalName().DesC());
+		StrCopy(iAttributeValue, aAttributes[i].Value().DesC());
+
+		if (iAttributeName.CompareC(KKXCoordinate) == 0)
+			{
+			iCurrentPosition.iX = StrToIntL(iAttributeValue);
+			}
+		else if (iAttributeName.CompareC(KKYCoordinate) == 0)
+			{
+			iCurrentPosition.iY = StrToIntL(iAttributeValue);
+			}
+		else if (iAttributeName.CompareC(KKZCoordinate) == 0)
+			{
+			iCurrentPosition.iZ = StrToIntL(iAttributeValue);
+			}
+		}
+	}
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::ReadVelocityAttributesL
+//
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::ReadVelocityAttributesL(const Xml::RAttributeArray& aAttributes)
+	{
+    TInt count = aAttributes.Count();
+	
+	for (TUint i=0; i<count; ++i)
+		{
+		
+		StrCopy(iAttributeName, aAttributes[i].Attribute().LocalName().DesC());
+		StrCopy(iAttributeValue, aAttributes[i].Value().DesC());
+
+		if (iAttributeName.CompareC(KKXCoordinate) == 0)
+			{
+			iCurrentVelocity.iX = StrToIntL(iAttributeValue);
+			}
+		else if (iAttributeName.CompareC(KKYCoordinate) == 0)
+			{
+			iCurrentVelocity.iY = StrToIntL(iAttributeValue);
+			}
+		else if (iAttributeName.CompareC(KKZCoordinate) == 0)
+			{
+			iCurrentVelocity.iZ = StrToIntL(iAttributeValue);
+			}
+		}
+		
+    iVelocityUsed = ETrue;
+	}
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::ReadInitAttributesL
+//
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::ReadInitAttributesL(const Xml::RAttributeArray& aAttributes)
+	{
+    TInt count = aAttributes.Count();
+	for ( TUint i = 0; i < count; ++i )
+		{
+		StrCopy(iAttributeName, aAttributes[i].Attribute().LocalName().DesC());
+		StrCopy(iAttributeValue, aAttributes[i].Value().DesC());
+		
+		if (iAttributeName.CompareC(KKPatternName) == 0)
+			{
+			StrCopy(iPatternName, iAttributeValue);
+			}
+		else if (iAttributeName.CompareC(KKEchoName) == 0)
+			{
+			StrCopy(iEchoName, iAttributeValue);
+			}
+		else if (iAttributeName.CompareC(KKDoppler) == 0)
+			{
+			if (iAttributeValue.CompareC(KKBooleanTrue) == 0)
+				{
+				iDopplerUsed = ETrue;
+				}
+		    else
+		        {
+		        iDopplerUsed = EFalse;
+		        }
+			}
+		}
+	}
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::ReadUpdateAttributesL
+//
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::ReadUpdateAttributesL( const Xml::RAttributeArray& aAttributes )
+	{
+    TInt count = aAttributes.Count();
+	for ( TUint i = 0; i < aAttributes.Count(); ++i )
+		{
+		StrCopy(iAttributeName, aAttributes[i].Attribute().LocalName().DesC());
+		StrCopy(iAttributeValue, aAttributes[i].Value().DesC());
+
+    	if (iAttributeName.CompareC(KKDTime) == 0)
+			{
+			iCurrentPosition.iTime = StrToIntL(iAttributeValue);
+			}
+		}
+	}
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::Print
+//
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::Print()
+	{
+	FLOG( _L("----- start pattern data -----") );
+	
+	TBuf<KBufSize128> buf; TBuf<KBufSize128> buf2;
+	
+	GetPatternName(buf);
+	GetEchoName(buf2);
+	FLOG( _L("pattern: '%S'  echo: '%S' doppler: %d"), &buf, &buf2, iDopplerUsed);
+	
+	FLOG( _L("init position and velocity:") );
+	PrintCoordinates(iInitPosition, EFalse);
+	PrintCoordinates(iInitVelocity, ETrue);
+	
+	FLOG( _L("positions and velocities:") );
+	
+	TInt count = PositionCount();
+	for (TInt i=0; i<count; i++)
+	    {
+	    T3DPatternData data = Position(i);
+	    PrintCoordinates(data, EFalse);
+	    
+	    if (iVelocityUsed)
+	        {
+    	    T3DPatternData data = Velocity(i);
+	        PrintCoordinates(data, ETrue);
+	        }
+	    }
+	    
+	    
+	FLOG( _L("----- end pattern data -----") );
+	}
+
+
+// -------------------------------------------------------------------------------
+// C3DPatternParser::PrintCoordinates
+//
+// -------------------------------------------------------------------------------
+//
+void C3DPatternParser::PrintCoordinates(T3DPatternData& aData, TBool aVelocity)
+	{
+	if (aVelocity)
+	    {
+	    FLOG( _L("velocity: x=%5d   y=%5d   z=%5d"), aData.iX, aData.iY, aData.iZ);
+	    }
+    else
+        {
+        FLOG( _L("position: x=%5d   y=%5d   z=%5d   time=%4d"), aData.iX, aData.iY, aData.iZ, aData.iTime);
+        }	
+	}
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnStartDocumentL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnStartDocumentL(const Xml::RDocumentParameters& /*aDocParam*/, TInt /*aErrorCode*/)
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnEndDocumentL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnEndDocumentL(TInt /*aErrorCode*/)
+    {
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnStartElementL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnStartElementL(const Xml::RTagInfo& aElement, 
+                                 const Xml::RAttributeArray& aAttributes, 
+							     TInt /*aErrorCode*/)
+    {
+    StrCopy(iElementName, aElement.LocalName().DesC());
+    
+    if (iElementName.Compare(KKInitElement) == 0)
+        {
+        ReadInitAttributesL(aAttributes);
+        }
+    else if (iElementName.Compare(KKUpdateElement) == 0)
+        {
+        ReadUpdateAttributesL(aAttributes);
+        }
+    else if (iElementName.Compare(KKPositionElement) == 0)
+        {
+        ReadPositionAttributesL(aAttributes);
+        }
+    else if (iElementName.Compare(KKVelocityElement) == 0)
+        {
+        ReadVelocityAttributesL(aAttributes);
+        }
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnEndElementL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnEndElementL(const Xml::RTagInfo& aElement, TInt /*aErrorCode*/)
+    {
+    StrCopy(iElementName, aElement.LocalName().DesC());
+    
+    if (iElementName.Compare(KKUpdateElement) == 0)
+        {
+        iPositionList.AppendL(iCurrentPosition);
+        if (iVelocityUsed)
+            {
+            iVelocityList.AppendL(iCurrentVelocity);
+            }
+        }
+        
+    if (iElementName.Compare(KKInitElement) == 0)
+        {
+        iInitPosition = iCurrentPosition;
+        if (iVelocityUsed)
+            {
+            iInitVelocity = iCurrentVelocity;
+            }
+        }
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnContentL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnContentL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/)
+    {
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnStartPrefixMappingL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnStartPrefixMappingL(const RString& /*aPrefix*/, 
+                                             const RString& /*aUri*/, 
+				     				         TInt /*aErrorCode*/)
+    {
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnEndPrefixMappingL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt /*aErrorCode*/)
+    {
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnIgnorableWhiteSpaceL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/)
+    {
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnSkippedEntityL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnSkippedEntityL(const RString& /*aName*/, TInt /*aErrorCode*/)
+    {
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnProcessingInstructionL  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnProcessingInstructionL(const TDesC8& /*aTarget*/, 
+                                          const TDesC8& /*aData*/, TInt /*aErrorCode*/)
+    {
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// C3DPatternParser::OnError  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+void C3DPatternParser::OnError(TInt aErrorCode)
+    {
+    if ( aErrorCode != KErrNone )
+        {
+        FLOG( _L("### C3DPatternParser::OnError (%d) ###"), aErrorCode);
+        }
+    }
+    
+
+// -----------------------------------------------------------------------------
+// C3DPatternParser::GetExtendedInterface  (from MContentHandler)
+// 
+// -----------------------------------------------------------------------------
+//
+TAny* C3DPatternParser::GetExtendedInterface(const TInt32 /*aUid*/)
+    {
+    return 0;
+    }
+    
+    
+////////////////////////////////////// END TEST CODE ////////////////////////////
+
+
+
+
+    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/src/CRingingTone3DPlugin.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,1404 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Plug-In that implements C3DRingingToneInterface.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CRingingTone3DPlugin.h"
+#include "tdaudioconstants.h"
+#include "RingingTone3DPluginDebug.h"
+
+#include <EnvironmentalReverbUtility.h>       // CEnvironmentalReverbUtility
+#include <SourceDopplerBase.h>                // CSourceDoppler
+#include <SourceLocationBase.h>               // CSourceLocation
+#include <ListenerLocationBase.h>             // CListenerLocation
+
+#ifndef SPP_NSS_3D_RINGING_TONE_STW_DISABLED
+#include <StereoWideningBase.h>               // CStereoWidening
+#endif
+
+
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileTones.h>
+#include <MProfileExtraSettings.h>
+#include <MProfile3DToneSettings.h>
+#include <MProfileName.h>
+#include <ProfileInternal.hrh> // for TProfile3DToneEffect and TProfile3DToneEcho
+
+
+// CONSTANTS
+const TUint32 KDopplerFactor = 100;
+
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CRingingTone3DPlugin* CRingingTone3DPlugin::NewL( TAny* aParameter )
+    {
+    // aParameter comes from REComSession::CreateImplementationL
+    // (TAny *aConstructionParameters)
+    
+    CRingingTone3DPlugin* self = new ( ELeave ) CRingingTone3DPlugin();
+    CleanupStack::PushL( self );
+    self->ConstructL( aParameter );
+    CleanupStack::Pop();
+    
+    return self;
+    }
+
+// Destructor
+CRingingTone3DPlugin::~CRingingTone3DPlugin()
+    {
+    
+    // Stop() may leave because of CDrmPlayerUtility error
+    // (CMMFDrmAudioPlayerUtility::IsValidCustomCommandDestination
+    // uses CleanupClosePushL).
+    TRAP_IGNORE( Stop() );
+    
+    delete iTimer;
+    delete iParser;
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Stop
+// Stop the playback.
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::Stop()
+    {
+    FLOG( _L("CRingingTone3DPlugin::Stop START") );
+    
+    // Stop the playback and timer.
+    if ( iTimer )
+        {
+        iTimer->Cancel();    
+        }
+    
+    StopRingingTone();
+
+    delete iReverbEffect;
+    iReverbEffect = NULL;
+    
+    delete iDopplerEffect;
+    iDopplerEffect = NULL;
+    
+    delete iListener;
+    iListener = NULL;
+    
+    delete iSource;
+    iSource = NULL;
+    
+#ifdef __STEREO_WIDENING_EFFECT_UI     
+    delete iStereoWidening;
+    iStereoWidening = NULL;
+#endif    
+    
+    FLOG( _L("CRingingTone3DPlugin::Stop END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::CRingingTone3DPlugin
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CRingingTone3DPlugin::CRingingTone3DPlugin()
+    {
+    iPlaying = EFalse;
+    iPlayerType = KErrNotFound;
+    iProfileId = KErrNotFound;
+ 
+    iProfile3DToneEffect = KErrNotFound;
+    iProfile3DToneEcho = KErrNotFound;
+    iRingingTone = KNullDesC;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::ConstructL( TAny* aParameter )
+    {
+    FLOG( _L("CRingingTone3DPlugin::ConstructL START") );
+
+    iTimer = C3DAudioTimeOutTimer::NewL( EPriorityHigh, this );
+    iParser = C3DAudioXMLParser::NewL();
+
+    FLOG( _L("CRingingTone3DPlugin::ConstructL END") ); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Init
+// 
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::Init( CMdaAudioPlayerUtility* aSamplePlayer )
+    {
+    FLOG( _L("CRingingTone3DPlugin::InitL START") );
+    
+    __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) );
+    
+    iAudioPlayerUtility = aSamplePlayer;
+    iPlayerType = EMdaAudioPlayerUtility;
+  
+#ifdef _DEBUG			                
+    FlogPlayer( iPlayerType );
+#endif        
+    
+    FLOG( _L("CRingingTone3DPlugin::InitL END") );
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Init
+// 
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::Init( CMdaAudioToneUtility* aSamplePlayer )
+    {
+    FLOG( _L("CRingingTone3DPlugin::InitL START") );
+    
+    __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) );
+    
+    iAudioToneUtility = aSamplePlayer;
+    iPlayerType = EMdaAudioToneUtility;
+
+#ifdef _DEBUG			                
+    FlogPlayer( iPlayerType );
+#endif        
+    
+    FLOG( _L("CRingingTone3DPlugin::InitL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Init
+// 
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::Init( CDrmPlayerUtility* aSamplePlayer )
+    {
+    //FLOG( _L("CRingingTone3DPlugin::InitL START") );
+    
+    __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) );
+    
+    iDrmPlayerUtility = aSamplePlayer;
+    iPlayerType = EDrmPlayerUtility;
+
+#ifdef _DEBUG			                
+    FlogPlayer( iPlayerType );
+#endif        
+    
+    //FLOG( _L("CRingingTone3DPlugin::InitL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Init
+// 
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::Init( CVideoPlayerUtility* aSamplePlayer )
+    {
+    FLOG( _L("CRingingTone3DPlugin::InitL START") );
+    
+    __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) );
+    
+    iVideoPlayerUtility = aSamplePlayer;
+    iPlayerType = EVideoPlayerUtility;
+
+#ifdef _DEBUG			                
+    FlogPlayer( iPlayerType );
+#endif        
+    
+    FLOG( _L("CRingingTone3DPlugin::InitL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::SetAttr (from C3DRingingToneInterface.h)
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CRingingTone3DPlugin::SetAttr( T3DRingingToneInterfaceAttr aAttributeKey,
+                                    TInt aValue )
+    {
+    switch (aAttributeKey)
+        {
+        case E3DRTIAttrProfileId:
+            {
+            iProfileId = aValue;
+            break;
+            }
+        case E3DRTIAttr3DEffect:
+            {
+            iProfile3DToneEffect = aValue;
+            break;
+            }
+        case E3DRTIAttr3DEcho:
+            {
+            iProfile3DToneEcho = aValue;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+        
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::SetAttr  (from C3DRingingToneInterface.h)
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CRingingTone3DPlugin::SetAttr( T3DRingingToneInterfaceAttr aAttributeKey,
+                                    const TDesC& aValue )
+    {
+    switch (aAttributeKey)
+        {
+        case E3DRTIAttr3DRingingTone:
+            {
+            if ( aValue.Length() < iRingingTone.MaxLength() )
+                {
+                iRingingTone = aValue;    
+                }
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+        
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::SetAttr  (from C3DRingingToneInterface.h)
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CRingingTone3DPlugin::SetAttr( TInt aAttributeKey, TAny* aValue )
+    {
+    switch (aAttributeKey)
+        {
+        case E3DRTIAttrAudioPlayerUtility:
+            {
+            Init( ( CMdaAudioPlayerUtility* )aValue );
+            break;
+            }
+        case E3DRTIAttrAudioToneUtility:
+            {
+            Init( ( CMdaAudioToneUtility* )aValue );
+            break;
+            }
+        case E3DRTIAttrDrmPlayerUtility:
+            {
+            Init( ( CDrmPlayerUtility* )aValue );
+            break;
+            }
+        case E3DRTIAttrVideoPlayerUtility:
+            {
+            Init( ( CVideoPlayerUtility* )aValue );
+            break;
+            }
+
+        default:
+            {
+            break;
+            }
+        }
+        
+    return KErrNone;    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::PlayL
+// Start the playback, initialize first in case there has been changes.
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::PlayL()
+    {
+    TInt err = KErrNone;
+    
+    TRAP( err, DoPlayL() );
+    
+    if ( err != KErrNone )
+        {
+        // 3D play failed - play normal ringing tone
+        UnInitialize();
+        PlayRingingTone();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::DoPlayL
+//
+// Start the playback, initialize first in case there has been changes.
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::DoPlayL()
+    {
+    FLOG( _L("CRingingTone3DPlugin::DoPlayL START") );
+    
+    __ASSERT_ALWAYS( iPlayerType != KErrNotFound, Panic(KErrNotReady) );
+    
+    TInt err = KErrNone;
+
+    if ( iTimer )
+        {
+        iTimer->Cancel();    
+        }
+    else
+        {
+        User::Leave( KErrNoMemory );  // ConstructL has failed
+        }
+    
+    TRAP( err, InitializeL() );  // Initialize the plug-in
+
+    if ( err != KErrNone )
+        {
+        FLOG( _L("### CRingingTone3DPlugin::InitializeL failed (%d) ###"), err);
+        User::Leave(err);
+        }
+        
+    if ( iProfile3DToneEffect == EProfile3DEffectOff )
+        {
+        PlayRingingTone();  // play normal ringing tone
+        
+        FLOG( _L("CRingingTone3DPlugin::DoPlayL END") );
+        return;
+        }
+  
+
+#ifdef __STEREO_WIDENING_EFFECT_UI
+    if ( iStereoWidening )
+        {
+        if ( !iStereoWidening->IsEnabled() )
+            {
+            FLOG( _L("### CStereoWidening not enabled ###") );
+            
+            TRAP( err, iStereoWidening->EnableL() );
+            if ( err != KErrNone )
+                {
+                FLOG( _L("### CStereoWidening::EnableL failed (%d) ###"), err);
+                User::Leave( err );    
+                }
+            }
+
+        // play normal ringing tone with stereowidening
+        PlayRingingTone();  
+        
+        FLOG( _L("CRingingTone3DPlugin::DoPlayL END") );
+        return;
+        }
+#endif
+
+
+    iCurrentUpdate = KErrNotFound;
+
+    SetNext3DPatternPositionL();
+        
+    PlayRingingTone();  // Start playing 3D ringing tone.
+    
+    FLOG( _L("CRingingTone3DPlugin::DoPlayL END") );      
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::TimerExpiredL
+// Callback method for timer expiration.
+// Used to update the location and doppler-effects.
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::TimerExpiredL()
+    {
+    //FLOG( _L("CRingingTone3DPlugin::TimerExpiredL START") );
+    
+    if ( iCurrentUpdate % 10 == 0 )
+        {
+        FLOG( _L("CRingingTone3DPlugin::TimerExpiredL called (count = %d)"), iCurrentUpdate);
+        }
+
+    SetNext3DPatternPositionL();
+        
+    //FLOG( _L("CRingingTone3DPlugin::TimerExpiredL END") );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::SetNext3DPatternPositionL
+//
+// Used to update the location and doppler-effects.
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::SetNext3DPatternPositionL()
+    {
+    //FLOG( _L("CRingingTone3DPlugin::SetNext3DPatternPositionL START") );
+    
+    TInt err = KErrNone;
+    
+    if ( !iSource || !iListener )
+        {
+        FLOG( _L("### CSourceLocation or CListenerLocation or C3DAudioPattern is NULL ###") );
+        User::Leave( KErrDied );
+        }
+    
+    if ( iCurrentUpdate == KErrNotFound )
+        {
+        iCurrentUpdate = 0;  // first position
+        }
+    else
+        {
+        iCurrentUpdate++;  // next position
+        }
+    
+    // iCurrentUpdate out of bounds. Start from the beginning.
+    if ( iCurrentUpdate >= iParser->CountL() )
+        {
+        iCurrentUpdate = 0;
+        }
+ 
+
+    //
+    // update doppler-effect
+    //
+    if ( iDoppler  && iDopplerEffect )
+        {
+        // Current doppler-velocity.
+        T3DVelocity velocity = iParser->VelocityL( iCurrentUpdate );
+        
+        // Update the velocity and apply.
+        TRAP( err, iDopplerEffect->SetCartesianVelocityL( ( TInt32& )velocity.iXVector, 
+                                                          ( TInt32& )velocity.iYVector, 
+                                                          ( TInt32& )velocity.iZVector ) );
+        if ( err != KErrNone )
+            {
+            FLOG( _L("### CSourceDoppler::SetCartesianVelocityL failed (%d) ###"), err);
+            User::Leave( err );
+            }                                                            
+
+        if ( !iDopplerEffect->IsEnabled() )
+            {
+            FLOG( _L("### CSourceDoppler not enabled ###") );
+            
+            TRAP( err, iDopplerEffect->EnableL() );
+
+            if ( err != KErrNone )
+                {
+                FLOG( _L("### CSourceDoppler::EnableL failed (%d) ###"), err);
+                User::Leave( err );
+                }
+            }
+        
+        TRAP( err, iDopplerEffect->ApplyL() );
+        if ( err != KErrNone )
+            {
+            FLOG( _L("### CSourceDoppler::ApplyL failed (%d) ###"), err);
+            User::Leave( err );
+            }
+            
+#ifdef _DEBUG			                
+        //FlogVelocityL( velocity, iCurrentUpdate );
+#endif        
+        
+        }
+        
+        
+    //
+    // set new 3D pattern position
+    //
+    T3DPosition position = iParser->PositionL( iCurrentUpdate );
+    
+    TRAP( err, iSource->SetLocationCartesianL( ( TInt32& )position.iX, 
+                                               ( TInt32& )position.iY, 
+                                               ( TInt32& )position.iZ ) );
+    if ( err != KErrNone )
+        {
+        FLOG( _L("### CSourceLocation::SetLocationCartesianL failed (%d) ###"), err);
+        User::Leave( err );
+        }
+        
+    if ( !iSource->IsEnabled() )
+        {
+        FLOG( _L("### CSourceLocation not enabled ###") );
+
+        TRAP( err, iSource->EnableL() );
+        if ( err != KErrNone )
+            {
+            FLOG( _L("### CSourceLocation::EnableL failed (%d) ###"), err);
+            User::Leave( err );
+            }          
+        }
+    
+    TRAP( err, iSource->ApplyL() );    
+    if ( err != KErrNone )
+        {
+        FLOG( _L("### CSourceLocation::ApplyL failed (%d) ###"), err);
+        User::Leave( err );
+        }          
+      
+
+#ifdef _DEBUG			                
+    //FlogPositionL( position, iCurrentUpdate );
+#endif        
+
+      
+    //
+    // if reverb is created and not enabled try to enable it.
+    //
+    if ( iReverbEffect )
+        {
+        TBool enabled = iReverbEffect->EnvironmentalReverb().IsEnabled();
+        if ( !enabled )
+            {
+            FLOG( _L("### CEnvironmentalReverb not enabled ###") );
+
+            TRAP( err, iReverbEffect->EnvironmentalReverb().EnableL() );
+            if ( err != KErrNone )
+                {
+                FLOG( _L("### CEnvironmentalReverb::EnableL failed (%d) ###"), err);
+                User::Leave( err );
+                }          
+            }
+        }
+  
+  
+    //
+    // if listener location is created and not enabled try to enable it
+    //
+    if ( !iListener->IsEnabled() )
+        {
+        FLOG( _L("### CListnerLocation not enabled ###") );
+        
+        TRAP( err, iListener->EnableL() );
+        if ( err != KErrNone )
+            {
+            FLOG( _L("### CListnerLocation::EnableL failed (%d) ###"), err);
+            User::Leave( err );
+            }
+        }        
+
+
+    // Get the update time and calculate it according to velocity set.
+    TInt dTime = iParser->TimeL( iCurrentUpdate ) * 1000;
+    
+    CalculateDTime( dTime );
+    
+#ifdef _DEBUG			                
+    //FlogTimeL( dTime, iCurrentUpdate );
+#endif        
+
+    // Start the timer if pattern changes.
+    if ( dTime != 0 )
+        {
+        iTimer->After( dTime );    
+        }
+        
+    //FLOG( _L("CRingingTone3DPlugin::SetNext3DPatternPositionL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::CalculateDTime
+// Calculate the time spent in current update, depending on the velocity set.
+// -----------------------------------------------------------------------------
+void CRingingTone3DPlugin::CalculateDTime( TInt& aTime )
+    {
+    // Velocity is set to zero, so no movement will appear.    
+    if ( iVelocity == 0 )
+        {
+        aTime = 0;
+        }
+    // Velocity is under five (default), so the updates take more time.
+    else if ( iVelocity < KMotionPatternDefaultVelocity )
+        {
+        aTime = aTime + ( ( aTime / 5 ) * ( KMotionPatternDefaultVelocity - iVelocity ) );
+        }
+    // Velocity is over five (default), so the updates take less time.
+    else if ( iVelocity > KMotionPatternDefaultVelocity )
+        {
+        aTime = aTime - ( ( aTime / 6 ) * ( iVelocity - KMotionPatternDefaultVelocity ) );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::InitializeL()
+// Initialize the plugin to current settings.
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::UnInitialize()
+    {
+    if ( iReverbEffect )
+        {
+        TRAP_IGNORE( iReverbEffect->DisableEnvironmentalReverbL() );
+        }
+    if ( iListener )
+        {
+        TRAP_IGNORE( iListener->DisableL() );
+        }
+    if ( iSource )
+        {
+        TRAP_IGNORE( iSource->DisableL() );
+        }
+        
+    if ( iDopplerEffect )
+        {
+        TRAP_IGNORE( iDopplerEffect->DisableL() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::InitializeL()
+// Initialize the plugin to current settings.
+// -----------------------------------------------------------------------------
+//
+void CRingingTone3DPlugin::InitializeL()
+    {
+    FLOG( _L("CRingingTone3DPlugin::InitializeL START") );
+    
+    if ( iProfile3DToneEffect == KErrNotFound || iProfile3DToneEcho == KErrNotFound )
+        {
+        // profile 3D settings not available - get them from active profile 
+        ReadActiveProfileL();
+        }
+ 
+    // if ringing tone has been set (SetAttr), check its validity
+    if ( !CheckRingingTone() ) 
+        {
+        FLOG( _L("### invalid 3D ringing tone ###") );
+        FLOG( _L("CRingingTone3DPlugin::InitializeL END") );
+        User::Leave(KErrNotFound);
+        }
+
+    if ( iProfile3DToneEffect == EProfile3DEffectOff )
+        {
+        FLOG( _L("3D ringing tones not enabled") );
+        FLOG( _L("CRingingTone3DPlugin::InitializeL END") );
+        return;
+        }
+
+#ifdef _DEBUG
+    Check3DPatternL(iProfile3DToneEffect);
+    Check3DEchoL(iProfile3DToneEcho);
+#endif    
+        
+
+#ifdef __STEREO_WIDENING_EFFECT_UI
+    if ( iProfile3DToneEffect == EProfile3DEffectStereoWidening )        
+        {
+        const TInt KStereoWideningLevel = 50;
+        
+        if ( !iStereoWidening )
+            {
+            iStereoWidening = StereoWideningL();    
+            }
+                 
+        iStereoWidening->SetStereoWideningLevelL( KStereoWideningLevel );
+        iStereoWidening->EnableL();
+        
+        FLOG( _L("CStereoWidening used as 3D effect") );
+        FLOG( _L("CRingingTone3DPlugin::InitializeL END") );
+        return;
+        }
+#endif
+
+    //
+    // parse 3D pattern
+    //
+    TInt err = KErrNone;
+    TRAP( err ,iParser->ParseL( iProfile3DToneEffect ) );
+    if ( err != KErrNone )
+        {
+        FLOG( _L("### C3DAudioXMLParser::ParseL failed (err=%d, pattern=%d) ###"), err, iProfile3DToneEffect);
+        User::Leave( err );
+        }
+      
+    
+#ifdef _DEBUG                         
+    C3DAudioXMLParser::FlogPubSubL( iProfile3DToneEcho );
+#endif
+
+    iVelocity = iParser->Attribute( C3DAudioXMLParser::EKeyVelocity );
+    iDoppler = iParser->Attribute( C3DAudioXMLParser::EKeyDopplerUsed );
+    
+    if ( iProfile3DToneEcho != EProfile3DEchoOff )
+        {
+        TInt err = KErrNone;
+        
+        if ( !iReverbEffect ) 
+            {
+            TRAP( err, iReverbEffect = EnvironmentalReverbUtilityL());
+            if ( err != KErrNone )
+                {
+                FLOG( _L("### CEnvironmentalReverbUtility::NewL failed (%d) ###"), err);
+                User::Leave(err);    
+                }
+            }
+
+        // Apply the preset. This also enables reverb effect.
+        TRAP( err, iReverbEffect->ApplyPresetL( iProfile3DToneEcho ) );
+        if ( err != KErrNone )
+            {
+            FLOG( _L("### CEnvironmentalReverbUtility::ApplyPresetL failed (%d) ###"), err);
+            User::Leave(err);    
+            }
+        }
+               
+                
+    // SourceLocation and ListenerLocation are not created.
+    if ( !iSource ) 
+        {
+        iSource = SourceLocationL();
+        }
+           
+    if ( !iListener ) 
+        {
+        iListener = ListenerLocationL();
+        }
+
+    // Veriable to set the location.
+    TInt32 zeroInt = 0;
+                         
+    // Set both locations to (0, 0, 0) and enable them.
+    iListener->SetLocationCartesianL( zeroInt, zeroInt, zeroInt );
+    iListener->EnableL();
+                
+    iSource->SetLocationCartesianL( zeroInt, zeroInt, zeroInt );
+    iSource->EnableL();
+
+    // Doppler is enabled
+    if ( iDoppler )
+        {
+        // The effect is not created
+        if ( !iDopplerEffect ) 
+            {
+            iDopplerEffect = SourceDopplerL();
+            }
+                    
+        TInt maxFactor = iDopplerEffect->FactorMax();
+        if ( KDopplerFactor > maxFactor )
+            {
+            iDopplerEffect->SetFactorL( maxFactor );
+            FLOG( _L("### CSourceDoppler::SetFactorL: max factor (%d) overflow ###"), maxFactor );  
+            }
+        else
+            {
+            // Set doppler factor.
+            iDopplerEffect->SetFactorL( KDopplerFactor );
+            }
+                  
+        // Enable the effect.                
+        iDopplerEffect->EnableL();
+        }
+    
+
+    FLOG( _L("CRingingTone3DPlugin::InitializeL END") );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::EnvironmentalReverbUtilityL()
+//
+// -----------------------------------------------------------------------------
+//    
+CEnvironmentalReverbUtility* CRingingTone3DPlugin::EnvironmentalReverbUtilityL()
+    {
+    CEnvironmentalReverbUtility* ret = NULL;
+    
+    switch ( iPlayerType )
+        {
+        case EMdaAudioPlayerUtility:
+            {
+            ret = CEnvironmentalReverbUtility::NewL( *iAudioPlayerUtility );
+            break;
+            }
+        case EMdaAudioToneUtility:
+            {
+            ret = CEnvironmentalReverbUtility::NewL( *iAudioToneUtility );
+            break;
+            }
+        case EDrmPlayerUtility:
+            {
+            ret = CEnvironmentalReverbUtility::NewL( *iDrmPlayerUtility );
+            break;
+            }
+        case EVideoPlayerUtility:
+            {
+            ret = CEnvironmentalReverbUtility::NewL( *iVideoPlayerUtility );
+            break;
+            }
+        default:
+            {
+            Panic(KErrArgument);
+            break;
+            }
+        }
+        
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::SourceLocationL()
+//
+// -----------------------------------------------------------------------------
+//    
+CSourceLocation* CRingingTone3DPlugin::SourceLocationL()
+    {
+    CSourceLocation* ret = NULL;
+    
+    switch ( iPlayerType )
+        {
+        case EMdaAudioPlayerUtility:
+            {
+            ret = CSourceLocation::NewL( *iAudioPlayerUtility );
+            break;
+            }
+        case EMdaAudioToneUtility:
+            {
+            ret = CSourceLocation::NewL( *iAudioToneUtility );
+            break;
+            }
+        case EDrmPlayerUtility:
+            {
+            ret = CSourceLocation::NewL( *iDrmPlayerUtility );
+            break;
+            }
+        case EVideoPlayerUtility:
+            {
+            ret = CSourceLocation::NewL( *iVideoPlayerUtility );
+            break;
+            }
+        default:
+            {
+            Panic(KErrArgument);
+            break;
+            }
+        }
+        
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::ListenerLocationL()
+//
+// -----------------------------------------------------------------------------
+//    
+CListenerLocation* CRingingTone3DPlugin::ListenerLocationL()
+    {
+    CListenerLocation* ret = NULL;
+    
+    switch ( iPlayerType )
+        {
+        case EMdaAudioPlayerUtility:
+            {
+            ret = CListenerLocation::NewL( *iAudioPlayerUtility );
+            break;
+            }
+        case EMdaAudioToneUtility:
+            {
+            ret = CListenerLocation::NewL( *iAudioToneUtility );
+            break;
+            }
+        case EDrmPlayerUtility:
+            {
+            ret = CListenerLocation::NewL( *iDrmPlayerUtility );
+            break;
+            }
+        case EVideoPlayerUtility:
+            {
+            ret = CListenerLocation::NewL( *iVideoPlayerUtility );
+            break;
+            }
+        default:
+            {
+            Panic(KErrArgument);
+            break;
+            }
+        }
+        
+    return ret;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::SourceDopplerL()
+//
+// -----------------------------------------------------------------------------
+//    
+CSourceDoppler* CRingingTone3DPlugin::SourceDopplerL()
+    {
+    CSourceDoppler* ret = NULL;
+    
+    switch ( iPlayerType )
+        {
+        case EMdaAudioPlayerUtility:
+            {
+            ret = CSourceDoppler::NewL( *iAudioPlayerUtility );
+            break;
+            }
+        case EMdaAudioToneUtility:
+            {
+            ret = CSourceDoppler::NewL( *iAudioToneUtility );
+            break;
+            }
+        case EDrmPlayerUtility:
+            {
+            ret = CSourceDoppler::NewL( *iDrmPlayerUtility );
+            break;
+            }
+        case EVideoPlayerUtility:
+            {
+            ret = CSourceDoppler::NewL( *iVideoPlayerUtility );
+            break;
+            }
+        default:
+            {
+            Panic(KErrArgument);
+            break;
+            }
+        }
+        
+    return ret;
+    }
+
+
+
+#ifdef __STEREO_WIDENING_EFFECT_UI
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::StereoWideningL()
+//
+// -----------------------------------------------------------------------------
+//    
+CStereoWidening* CRingingTone3DPlugin::StereoWideningL()
+    {
+    CStereoWidening* ret = NULL;
+    
+    switch ( iPlayerType )
+        {
+        case EMdaAudioPlayerUtility:
+            {
+            ret = CStereoWidening::NewL( *iAudioPlayerUtility );
+            break;
+            }
+        case EMdaAudioToneUtility:
+            {
+            ret = CStereoWidening::NewL( *iAudioToneUtility );
+            break;
+            }
+        case EDrmPlayerUtility:
+            {
+            ret = CStereoWidening::NewL( *iDrmPlayerUtility );
+            break;
+            }
+        case EVideoPlayerUtility:
+            {
+            ret = CStereoWidening::NewL( *iVideoPlayerUtility );
+            break;
+            }
+        default:
+            {
+            Panic(KErrArgument);
+            break;
+            }
+        }
+        
+    return ret;
+    }
+#endif
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::PlayRingingTone()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::PlayRingingTone()
+    {
+    if ( iPlaying )
+        {
+        return;
+        }
+    iPlaying = ETrue;
+    
+    switch ( iPlayerType )
+        {
+        case EMdaAudioPlayerUtility:
+            {
+            iAudioPlayerUtility->Play();
+            break;
+            }
+        case EMdaAudioToneUtility:
+            {
+            iAudioToneUtility->Play();
+            break;
+            }
+        case EDrmPlayerUtility:
+            {
+            iDrmPlayerUtility->Play();
+            break;
+            }
+        case EVideoPlayerUtility:
+            {
+            iVideoPlayerUtility->Play();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::StopRingingTone()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::StopRingingTone()
+    {
+    if ( !iPlaying )
+        {
+        return;
+        }
+    iPlaying = EFalse;
+        
+    switch ( iPlayerType )
+        {
+        case EMdaAudioPlayerUtility:
+            {
+            iAudioPlayerUtility->Stop();
+            break;
+            }
+        case EMdaAudioToneUtility:
+            {
+            iAudioToneUtility->CancelPlay();
+            break;
+            }
+        case EDrmPlayerUtility:
+            {
+            iDrmPlayerUtility->Stop();
+            break;
+            }
+        case EVideoPlayerUtility:
+            {
+            iVideoPlayerUtility->Stop();
+            break;
+            }
+        default:
+            {
+            Panic(KErrArgument);
+            break;
+            }
+        }
+        
+    FLOG( _L("CRingingTone3DPlugin::StopRingingTone: ringing stopped") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Panic()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::Panic(TInt aReason)
+    {
+	_LIT(KPanicCategory,"RingingTone3DAudioPlugin");
+	
+	User::Panic(KPanicCategory, aReason); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::ReadActiveProfileL()
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::ReadActiveProfileL()
+    {
+    MProfileEngine* profileEngine = CreateProfileEngineL();
+    CleanupReleasePushL( *profileEngine );
+    
+    MProfile* activeProfile  = profileEngine->ActiveProfileL();
+    CleanupReleasePushL( *activeProfile );
+        
+#ifdef _DEBUG        
+    FlogProfileL(activeProfile);
+#endif        
+
+    //const MProfileTones& profileTones = activeProfile->ProfileTones();
+    //iRingingTone = profileTones.RingingTone1();
+      
+    const MProfileExtraSettings& extra = activeProfile->ProfileExtraSettings();
+    const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings();
+    
+    iProfile3DToneEffect = threeD.Effect();
+    iProfile3DToneEcho = threeD.Echo();
+   
+    CleanupStack::PopAndDestroy(activeProfile); 
+    CleanupStack::PopAndDestroy( profileEngine );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::CheckRingingTone()
+// -----------------------------------------------------------------------------
+//    
+TBool CRingingTone3DPlugin::CheckRingingTone()
+    {
+    if ( iRingingTone.Length() == 0 )
+        {
+        return ETrue; // nothing to check
+        }
+        
+    TParsePtr fileParser( iRingingTone );
+    TPtrC extPtr = fileParser.Ext();
+    
+    // Ringing tone is valid for 3D-playback, i.e not a .rng-tone or "No ringing tone".
+    // Or the user has set the RingingToneInUse flag to EFalse in CR.
+    if ( extPtr.Compare( KRngType ) == 0 || iRingingTone.Compare( KNoToneFileName ) == 0 ) 
+        {
+        return EFalse;
+        }
+        
+    return ETrue;
+    }
+
+
+
+#ifdef _DEBUG
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Check3DPatternL()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::Check3DPatternL(TInt aPattern)
+    {
+    
+    if ( aPattern != EProfile3DEffectOff && aPattern != EProfile3DEffectCircle &&
+         aPattern != EProfile3DEffectFlyby && aPattern != EProfile3DEffectZigZag &&
+         aPattern != EProfile3DEffectRandomWalk && aPattern != EProfile3DEffectChaos &&
+         aPattern != EProfile3DEffectStereoWidening )
+        {
+        User::Leave(KErrArgument);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::Check3DEchoL()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::Check3DEchoL(TInt aEcho)
+    {
+    
+    if ( aEcho != EProfile3DEchoOff && aEcho != EProfile3DEchoLivingRoom &&
+         aEcho != EProfile3DEchoCave && aEcho != EProfile3DEchoStoneCorridor &&
+         aEcho != EProfile3DEchoForest && aEcho != EProfile3DEchoSewerPipe &&
+         aEcho != EProfile3DEchoUnderwater )
+        {
+        User::Leave(KErrArgument);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::FlogRepository()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::FlogRepositoryL(CRepository* aRepository, TInt aEcho)
+    {
+    FLOG( _L("------ start repository data ------") );
+    
+    TInt num = 0;
+    TBuf<128> buf;
+    
+    User::LeaveIfError( aRepository->Get( E3DAudioRepositoryPattern, num ) );
+    C3DAudioXMLParser::GetPatternString(buf, num);
+    FLOG( _L("pattern: %S (%d)"), &buf, num );
+    
+    User::LeaveIfError( aRepository->Get( E3DAudioRepositoryReverb, num ) );
+    C3DAudioXMLParser::GetEchoString(buf, num);
+    
+    C3DAudioXMLParser::GetEchoString(buf, aEcho);
+    FLOG( _L("echo: %S (%d)"), &buf, aEcho );
+ 
+    User::LeaveIfError( aRepository->Get( E3DAudioRepositoryVelocity, num ) );
+    FLOG( _L("velocity: %d"), num );
+    
+    User::LeaveIfError( aRepository->Get( E3DAudioRepositoryDoppler, num ) );
+    FLOG( _L("doppler: %d"), num );
+    
+    User::LeaveIfError( aRepository->Get( E3DAudioRepositoryBlockCount, num ) );
+    FLOG( _L("block count: %d"), num );
+    
+    FLOG( _L("------ end repository data ------") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::FlogProfile()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::FlogProfileL(MProfile* aProfile)
+    {
+    FLOG( _L("------ start profile data ------") );
+    
+    TInt num = 0;
+    TBuf<128> buf;
+    
+    const MProfileName& name = aProfile->ProfileName();
+    buf = name.Name();
+    FLOG( _L("profile name: %S"), &buf );
+    
+    const MProfileTones& profileTones = aProfile->ProfileTones();
+    TFileName ringingTone = profileTones.RingingTone1();
+    FLOG( _L("ringing tone: %S"), &ringingTone );
+  
+    const MProfileExtraSettings& extra = aProfile->ProfileExtraSettings();
+    const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings();
+    
+    num = threeD.Effect();
+    C3DAudioXMLParser::GetPatternString(buf, num);
+    FLOG( _L("pattern: %S (%d)"), &buf, num );
+    
+    num = threeD.Echo();
+    C3DAudioXMLParser::GetEchoString(buf, num);
+    FLOG( _L("echo: %S (%d)"), &buf, num );
+
+    
+    FLOG( _L("------ end profile data ------") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::FlogPlayer()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::FlogPlayer(TInt aPlayer)
+    {
+    TBuf<128> buf;
+    
+  	switch ( aPlayer )
+		{
+		case EMdaAudioPlayerUtility:
+			buf = _L("EMdaAudioPlayerUtility");
+			break;
+		case EMdaAudioToneUtility:
+			buf = _L("EMdaAudioToneUtility");
+			break;
+		case EDrmPlayerUtility:
+			buf = _L("EDrmPlayerUtility");
+			break;
+		case EVideoPlayerUtility:
+			buf = _L("EVideoPlayerUtility");
+			break;
+			
+		default:
+			buf = _L("### unknown player ###");
+			break;
+		}
+
+    
+    FLOG( _L("player type: %S"), &buf );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::FlogPositionL()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::FlogPositionL(T3DPosition& aPosition, TInt aIndex)
+    {
+    TBuf<128> buf;
+    TInt x = aPosition.iX;
+    TInt y = aPosition.iY;
+    TInt z = aPosition.iZ;
+    
+    buf.Format(_L("%d:  position x=%d y=%d z=%d"), aIndex, x,y,z);
+    FLOG(buf);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::FlogVelocityL()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::FlogVelocityL(T3DVelocity& aVelocity, TInt aIndex)
+    {
+    TBuf<128> buf;
+    
+    TInt x = aVelocity.iXVector;
+    TInt y = aVelocity.iYVector;
+    TInt z = aVelocity.iZVector;
+    
+    buf.Format(_L("%d:  velocity x=%d y=%d z=%d"), aIndex, x,y,z);
+    FLOG(buf);
+    }
+
+// -----------------------------------------------------------------------------
+// CRingingTone3DPlugin::FlogTimeL()
+//
+// -----------------------------------------------------------------------------
+//    
+void CRingingTone3DPlugin::FlogTimeL(TInt aTime, TInt aIndex)
+    {
+    TBuf<128> buf;
+  
+    buf.Format(_L("%d:  time = %d"), aIndex, aTime);
+    FLOG(buf);
+    }
+
+#endif   // _DEBUG
+
+
+
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/RingingTone3DPlugin/src/CRingingTone3DPluginImplementationTable.cpp	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation proxy for this plugin.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <implementationproxy.h>
+#include "CRingingTone3DPlugin.h"	
+
+// Map the interface UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] =
+	{
+	IMPLEMENTATION_PROXY_ENTRY( KRingingTone3DAudioEComPluginUID, 
+								CRingingTone3DPlugin::NewL )
+	};
+
+// Exported proxy for instantiation method resolution
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy ( TInt& aTableCount )
+	{
+	aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+	return ImplementationTable;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for 
+*               building profilesservices.
+*
+*/
+
+
+// Middleware layer
+// profile ADO
+
+//Components:
+
+//profilesservices
+#include "../FileList/group/bld.inf"
+#include "../MediaFileList/group/bld.inf"
+#include "../ProfileEngine/group/bld.inf"
+#include "../RingingTone3DPlugin/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/tsrc/public/basic/group/bld.inf	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file provides the information required for building the
+*    ProfilesApplication tests
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+
+#include "../../../../FileList/tsrc/public/basic/group/bld.inf"
+#include "../../../../ProfileEngine/tsrc/public/basic/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/tsrc/public/basic/rom/ProfilesServices_ats3.iby	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*  Top level ROM image definition for ProfilesApplication automated tests
+*       
+*
+*/
+
+
+#ifndef __PROFILESSERVICES_ATS3_IBY__
+#define __PROFILESSERVICES_ATS3_IBY__
+
+// File list rom files
+file=ABI_DIR\BUILD_DIR\T_CFLDFileList.dll   SHARED_LIB_DIR\T_CFLDFileList.dll
+data=ZRESOURCE\FLDTEST.RSC                  RESOURCE_FILES_DIR\FLDTEST.RSC
+
+// Profiles rom files
+file=ABI_DIR\BUILD_DIR\T_ProfileEngine.dll		    SHARED_LIB_DIR\T_ProfileEngine.dll
+file=ABI_DIR\BUILD_DIR\T_ProfileEngineWrapper.dll	SHARED_LIB_DIR\T_ProfileEngineWrapper.dll
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesservices/tsrc/public/basic/test.xml	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<test>
+    <name>ProfilesServices 5.0 Automated Tests</name>
+    <target>
+        <device rank="none" alias="DEFAULT">
+            <property name="HARNESS" value="EUNIT" />
+            <property name="TYPE" value="Ariane" />
+        </device>
+    </target>
+    <plan name="ProfilesServices Automated Test Plan" harness="EUNIT" enabled="true" passrate="100">
+        <session name="session" harness="EUNIT" enabled="true" passrate="100">
+            <set name="set" harness="EUNIT" enabled="true" passrate="100">
+                <target>
+                    <device rank="master" alias="DEFAULT"/>
+                </target>
+                <case name="Test Case 1" harness="EUNIT" enabled="true" passrate="100">
+                    <flash target-alias="DEFAULT" images="ATS3Drop/images/sydo_ProfilesServices_ats3_image.fpsx" />
+                    <flash target-alias="DEFAULT" images="ATS3Drop/images/sydo_ProfilesServices_ats3_image_udaerase.fpsx" />
+                    
+                    <step name="Create CTC log dir" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>makedir</command>
+                        <params>
+                            <param dir="c:\data\ctc\"/>
+                        </params>
+                    </step>
+                    
+                    <step name="CTC start" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>execute</command>
+                        <params>
+                            <param file="z:\sys\bin\ctcman.exe"/>
+                        </params>
+                    </step>
+
+                    <step name="Create EUnit log dir" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>makedir</command>
+                        <params>
+                            <param dir="c:\shared\eunit\logs\"/>
+                        </params>
+                    </step>
+
+                    <step name="Execute tests" harness="EUNIT" enabled="true" passrate="100" significant="true">
+                        <command>execute</command>
+                        <params>
+                            <param parameters="/l xml /e s60appenv /w 30 /r warning T_CFLDFileList T_ProfileEngine T_ProfileEngineWrapper"/>
+                            <param timeout="720"/>
+                            <param result-file="c:\shared\eunit\logs\EUnit_log.xml"/>
+                            <param file="z:\sys\bin\EUNITEXERUNNER.EXE"/>
+                        </params>
+                    </step>
+                    
+                    <step name="Save CTC data" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>execute</command>
+                        <params>
+                            <param parameters="writefile"/>
+                            <param file="z:\sys\bin\ctcman.exe"/>
+                        </params>
+                    </step>
+                    
+                    <step name="Fetch and clean CTC data" harness="EUNIT" enabled="true" passrate="100" significant="false">
+                        <command>fetch-log</command>
+                        <params>
+                            <param delete="true"/>
+                            <param path="c:\data\ctc\ctcdata.txt"/>
+                        </params>
+                    </step>
+                </case>
+            </set>
+        </session>
+    </plan>
+    <files>
+        <file>ATS3Drop/images/sydo_ProfilesServices_ats3_image.fpsx</file>
+        <file>ATS3Drop/images/sydo_ProfilesServices_ats3_image_udaerase.fpsx</file>
+    </files>
+    
+    <postAction>
+        <type>SendEmailAction</type>
+        <params>
+            <param name="type" value="ATS3_REPORT"/>
+            <param name="to" value="olli.an.makinen@nokia.com;pasi.p.keranen@nokia.com"/>
+            <param name="subject" value="ATS3 report for §RUN_NAME§ §RUN_START_DATE§ §RUN_START_TIME§"/>
+            <param name="send-files" value="true"/>
+        </params>
+    </postAction>
+    
+    <postAction>
+        <type>FileStoreAction</type>
+        <params>
+            <param name="to-folder" value="\\ousrv058\data$\ATS3Reports\S60_5_0\SyDo\profile\ProfilesServices\"/>
+        </params>
+    </postAction>
+</test>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Thu Dec 17 08:52:52 2009 +0200
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>